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:
|
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.
pallet_migrations reads storage
ShouldPauseXcmon every block inon_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
Explore an alternative approach that pauses xcm execution in some other way that doesn't require the
on_initializehook.Same for
on_finalize.