-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: stmgr: add env to disable premigrations #10283
Conversation
log.Warn("SKIPPING pre-migration", "height", height) | ||
return | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My original thought was to just set the PreMigration
array for each migration to empty during the construction of the state manager when this environment var is set. This would lead to nothing getting scheduled.
If we had a way to print the current schedule / next scheduled task I think this would still be the correct way to go. However, I don't believe we have that functionality. So instead I'm opting to just exit pre-migrations early.
This will ensure that a log message is created around the time the pre-migration was supposed to run stating that it was skipped. I think this will make debugging things a bit easier
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is a pretty good way to go about it, honestly.
Is there any documentation in this lotus here that also should be updated as part of this PR? Otherwise I think the migration documentation I want to write will be the location of this new environment variable. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thank you!
This would be relatively easy to test -- we can spin up custom upgrade schedules in itests (eg.
lotus/itests/migration_nv18_test.go
Line 42 in cdf3812
Migration: filcns.UpgradeActorsV10, |
I don't think it's critical to have this test, but worth doing.
log.Warn("SKIPPING pre-migration", "height", height) | ||
return | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is a pretty good way to go about it, honestly.
Setting the environment variable `LOTUS_DISABLE_PRE_MIGRATIONS=1` will discard premigrations for all upgrade.
0e18e96
to
2dcaddf
Compare
Setting the environment variable
LOTUS_DISABLE_PRE_MIGRATIONS=1
will discard premigrations for all upgrade.Related Issues
#10048
Proposed Changes
LOTUS_DISABLE_PRE_MIGRATIONS
which when set to1
stops pre-migrations from being executed.Additional Info
Checklist
Before you mark the PR ready for review, please make sure that:
<PR type>: <area>: <change being made>
fix: mempool: Introduce a cache for valid signatures
PR type
: fix, feat, build, chore, ci, docs, perf, refactor, revert, style, testarea
, e.g. api, chain, state, market, mempool, multisig, networking, paych, proving, sealing, wallet, deps