diff --git a/substrate/frame/distribution/src/functions.rs b/substrate/frame/distribution/src/functions.rs index 880603f6ea8a..0ced63ed7c02 100644 --- a/substrate/frame/distribution/src/functions.rs +++ b/substrate/frame/distribution/src/functions.rs @@ -60,7 +60,7 @@ impl Pallet { // funds for created `SpendInfos`. the function will be use in a hook. pub fn begin_block(now: BlockNumberFor) -> Weight { - let max_block_weight = T::BlockWeights::get().max_block; + let max_block_weight = T::BlockWeights::get().max_block/10; let epoch = T::EpochDurationBlocks::get(); //We reach the check period diff --git a/substrate/frame/opf/src/functions.rs b/substrate/frame/opf/src/functions.rs index 40a55b3b24b9..932f24012236 100644 --- a/substrate/frame/opf/src/functions.rs +++ b/substrate/frame/opf/src/functions.rs @@ -265,13 +265,10 @@ impl Pallet { // To be executed in a hook, on_initialize pub fn on_idle_function(now: BlockNumberFor, limit: Weight) -> Weight { let mut meter = WeightMeter::with_limit(limit); - //let max_block_weight = T::BlockWeights::get().max_block; + let max_block_weight = T::BlockWeights::get().max_block/10; - if meter - .try_consume(::WeightInfo::unlock_funds(T::MaxWhitelistedProjects::get())) - .is_err() - { - return ::WeightInfo::unlock_funds(T::MaxWhitelistedProjects::get()); + if meter.try_consume(max_block_weight).is_err() { + return meter.consumed(); } let mut round_index = VotingRoundNumber::::get();