diff --git a/client/basic-authorship-ver/src/basic_authorship.rs b/client/basic-authorship-ver/src/basic_authorship.rs index f6b754f17a921..435dfbf83785a 100644 --- a/client/basic-authorship-ver/src/basic_authorship.rs +++ b/client/basic-authorship-ver/src/basic_authorship.rs @@ -409,16 +409,22 @@ where let now = (self.now)(); let left = deadline.saturating_duration_since(now); let left_micros: u64 = left.as_micros().saturated_into(); + // NOTE reduce deadline by half as we want to avoid situation where + // fully filled previous block does not allow for any extrinsic to be included in following + // one let soft_deadline = - now + time::Duration::from_micros(self.soft_deadline_percent.mul_floor(left_micros)); + now + time::Duration::from_micros(self.soft_deadline_percent.mul_floor(left_micros) / 2); let block_timer = time::Instant::now(); let mut skipped = 0; let mut unqueue_invalid = Vec::new(); block_builder.apply_previous_block_extrinsics(seed.clone()); let mut t1 = self.transaction_pool.ready_at(self.parent_number).fuse(); + // NOTE reduce deadline by half ('/16' instead of '/8') as we want to avoid situation where + // fully filled previous block does not allow for any extrinsic to be included in following + // one let mut t2 = - futures_timer::Delay::new(deadline.saturating_duration_since((self.now)()) / 8).fuse(); + futures_timer::Delay::new(deadline.saturating_duration_since((self.now)()) / 16 ).fuse(); let mut pending_iterator = select! { res = t1 => res, @@ -432,7 +438,8 @@ where }, }; - let block_size_limit = block_size_limit.unwrap_or(self.default_block_size_limit); + let block_size_limit = block_size_limit.unwrap_or(self.default_block_size_limit) / 2; + debug!("Attempting to push transactions from the pool."); debug!("Pool status: {:?}", self.transaction_pool.status()); diff --git a/frame/balances/src/tests_composite.rs b/frame/balances/src/tests_composite.rs index a24be44927375..30d49430e143d 100644 --- a/frame/balances/src/tests_composite.rs +++ b/frame/balances/src/tests_composite.rs @@ -22,8 +22,7 @@ use crate::{self as pallet_balances, decl_tests, Config, Pallet}; use frame_support::{ parameter_types, - traits::{ConstU32, ConstU64, ConstU8}, - weights::{DispatchInfo, IdentityFee, Weight}, + traits::{ConstU32, ConstU64, ConstU8}, weights::{DispatchInfo, IdentityFee, Weight}, }; use pallet_transaction_payment::CurrencyAdapter; use sp_core::H256;