Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Commit

Permalink
Unqueue invalid transactions when skipping
Browse files Browse the repository at this point in the history
The check was intially added by: #5121

But a later pr fixed it properly: #9789

TLDR: We don't need to check for skipped anymore, as we already remove all transactions that are
being unlocked by an invalid transactions and thus, we will not tag them as invalid directly because
the nonce for example is incorrect.

Fixes: #13911
  • Loading branch information
bkchr committed Apr 13, 2023
1 parent e155ab8 commit 6f0c80c
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions client/basic-authorship/src/basic_authorship.rs
Original file line number Diff line number Diff line change
Expand Up @@ -474,14 +474,6 @@ where
break EndProposingReason::HitBlockWeightLimit
}
},
Err(e) if skipped > 0 => {
pending_iterator.report_invalid(&pending_tx);
trace!(
"[{:?}] Ignoring invalid transaction when skipping: {}",
pending_tx_hash,
e
);
},
Err(e) => {
pending_iterator.report_invalid(&pending_tx);
debug!("[{:?}] Invalid transaction: {}", pending_tx_hash, e);
Expand Down Expand Up @@ -740,8 +732,11 @@ mod tests {
);
}

// This test ensures that if one transaction of a user was rejected, because for example
// the weight limit was hit, we don't mark the other transactions of the user as invalid because
// the nonce is not matching.
#[test]
fn should_not_remove_invalid_transactions_when_skipping() {
fn should_not_remove_invalid_transactions_from_the_same_sender_after_one_was_invalid() {
// given
let mut client = Arc::new(substrate_test_runtime_client::new());
let spawner = sp_core::testing::TaskExecutor::new();
Expand Down

0 comments on commit 6f0c80c

Please sign in to comment.