diff --git a/substrate/frame/contracts/src/lib.rs b/substrate/frame/contracts/src/lib.rs index 52e1ac7e0a7c5..6894c876d9930 100644 --- a/substrate/frame/contracts/src/lib.rs +++ b/substrate/frame/contracts/src/lib.rs @@ -411,8 +411,9 @@ pub mod pallet { use migration::MigrateResult::*; loop { - let (result, weight) = Migration::::migrate(remaining_weight); - remaining_weight.saturating_reduce(weight); + const reduced_weight_factor: u64 = 4; + let (result, weight) = Migration::::migrate(remaining_weight.saturating_div(reduced_weight_factor)); + remaining_weight.saturating_reduce(weight.saturating_mul(reduced_weight_factor)); match result { // There is not enough weight to perform a migration, or make any progress, we