-
Notifications
You must be signed in to change notification settings - Fork 0
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
Add awesome avatars multi-block-migration with pallet-migrations #21
Conversation
8be8a4c
to
9073b1b
Compare
parameter_types! { | ||
pub MbmServiceWeight: Weight = Perbill::from_percent(80) * RuntimeBlockWeights::get().max_block; | ||
} |
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.
Todo: Double check if we should be more conservative here. Substrate doesn't have meaningful example value in their test runtime, but I think 80% should be ok.
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.
Parity has now introduced the same weight as mine. 80% percent allowed usage of a max value seems to be the rule of thumb for any weight-limited operation: https://github.com/paritytech/polkadot-sdk/pull/4251/files
impl FailedMigrationHandler for MockedFailedMigrationHandler { | ||
fn failed(migration: Option<u32>) -> FailedMigrationHandling { | ||
log::error!("FailedMigrationHandler failed at: {migration:?}"); | ||
FailedMigrationHandling::ForceUnstuck |
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.
This will make the chain resume normal operation and allow extrinsics again, but it will not continue the migration. Here, I suggest we assume that it works now after testing with the production data. Otherwise we could start integrating the pallet-safe-mode, which is not audited yet though.
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 suggest keeping it at ForceUnstuck
. The only thing that could go wrong here is that a few entries are messed up, but no system logic is touched. pallet-safe-mode
can be evaluated at another time.
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.
To me it looks like you are actually using the freeze option @clangenb :
type FailedMigrationHandler = frame_support::migrations::FreezeChainOnFailedMigration;
.
Anything starting with "Mock" should only be used for testing/benchmarking - not prod.
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.
ooops, good catch. Fuck up on my end. Thanks for pointing this out!
@@ -157,13 +158,8 @@ pub type Executive = frame_executive::Executive< | |||
frame_system::ChainContext<Runtime>, | |||
Runtime, | |||
AllPalletsWithSystem, | |||
Migrations, |
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.
This is obsolete now, the single block migrations are also configured in frame-system now.
Tested by cloning all storage values of AAA and running the multiblock migration on a rococo-local setup:
Migration Metadata
Migration duration estimate: 108206 storage keys / 687 (avg migrations/block) = 157.5 blocks
Migration starting block: 118
Migration end estimate block = 118 + 158 = 276
Estimated elapsed time: 158 * 12s = 1896s = 31.6 min
Effective migration end in test = block 261
Post migration tests:
minted_at: 0
field. 👍TradeStatsMap
is empty after the migration 👍SeasonMetas
,SeasonSchedules
,SeasonTradeFilters
. We have 2 seasons, hence we get 6 more keys. 👍Todo:
Reproduce test results
zombienet/rococo-local-with-bajun-runtime-upgrade.toml
file.