From b800909dae9ed2fa6e408cdf03340aec72592382 Mon Sep 17 00:00:00 2001 From: Svyatoslav Nikolsky Date: Tue, 2 Jun 2020 20:07:10 +0300 Subject: [PATCH] block.tx[0] is not invalid if on_initialize is too heavy (#6217) --- substrate/client/basic-authorship/src/basic_authorship.rs | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/substrate/client/basic-authorship/src/basic_authorship.rs b/substrate/client/basic-authorship/src/basic_authorship.rs index fe64097e42..cd241f3884 100644 --- a/substrate/client/basic-authorship/src/basic_authorship.rs +++ b/substrate/client/basic-authorship/src/basic_authorship.rs @@ -225,7 +225,6 @@ impl Proposer // proceed with transactions let block_timer = time::Instant::now(); - let mut is_first = true; let mut skipped = 0; let mut unqueue_invalid = Vec::new(); let pending_iterator = match executor::block_on(future::select( @@ -261,10 +260,7 @@ impl Proposer } Err(ApplyExtrinsicFailed(Validity(e))) if e.exhausted_resources() => { - if is_first { - debug!("[{:?}] Invalid transaction: FullBlock on empty block", pending_tx_hash); - unqueue_invalid.push(pending_tx_hash); - } else if skipped < MAX_SKIPPED_TRANSACTIONS { + if skipped < MAX_SKIPPED_TRANSACTIONS { skipped += 1; debug!( "Block seems full, but will try {} more transactions before quitting.", @@ -287,8 +283,6 @@ impl Proposer unqueue_invalid.push(pending_tx_hash); } } - - is_first = false; } self.transaction_pool.remove_invalid(&unqueue_invalid);