-
Notifications
You must be signed in to change notification settings - Fork 15
Open
Description
pallet_migrations reads storage ShouldPauseXcm on every block in on_initialize, even though this is only needed for one block, during (or after?) a runtime upgrade:
moonkit/pallets/migrations/src/lib.rs
Lines 169 to 180 in 9df5da6
| fn on_initialize(_: BlockNumberFor<T>) -> Weight { | |
| if ShouldPauseXcm::<T>::get() { | |
| // Suspend XCM execution | |
| if let Err(error) = T::XcmExecutionManager::suspend_xcm_execution() { | |
| <Pallet<T>>::deposit_event(Event::FailedToSuspendIdleXcmExecution { error }); | |
| } | |
| // Account on_finalize write | |
| T::DbWeight::get().reads_writes(1, 1) | |
| } else { | |
| T::DbWeight::get().reads(1) | |
| } | |
| } |
Explore an alternative approach that pauses xcm execution in some other way that doesn't require the on_initialize hook.
Same for on_finalize.
Metadata
Metadata
Assignees
Labels
No labels