-
Notifications
You must be signed in to change notification settings - Fork 1
Execution Header Cleanup Multi-Block Migration #148
Conversation
Cool. Though my concern is what we do here is a trivial task to delete the unused storage, so I'm a bit hesistant to use MBM for that. The problem is that the chain is in lockdown mode(i.e. not allowing any transaction) for as long as an MBM is ongoing. polkadot-sdk/substrate/frame/executive/src/lib.rs Lines 554 to 560 in e96ce3a
|
Hey @yrong! It is true that MBM might be blocking, however I am not too worried about it because the migration will take a single digit number of blocks to complete the migration. Calculation:
|
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.
Looks good! Please upstream this :)
Migration to cleanup the previous implementation's execution headers. Execution headers are no longer stored in Snowbridge 1.1.0 and sent with the message instead.
Note: The step migration weight is slightly overweight. It specifies
4
writes instead of2
,12_000_000
weight instead of10_000_000
. The reason is because theExecutionHeaderIndex
andLatestExecutionState
is cleaned up in the last step of the migration. In the benchmark code, even if there is only 1 header added to storage, the last step to cleanupExecutionHeaderIndex
andLatestExecutionState
will still be executed. I have not found a way to prevent the last step from running. I think this is OK though, rather overweight than underweight, and the discrepancy is small (the migration might run for 1 block longer than necessary).