Skip to content

Commit

Permalink
Do not trust TxSource::next
Browse files Browse the repository at this point in the history
  • Loading branch information
acerone85 committed Sep 19, 2024
1 parent 1caa9bc commit 592dfc6
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions crates/services/executor/src/executor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -589,6 +589,7 @@ where
let mut regular_tx_iter = l2_tx_source
.next(remaining_gas_limit, remaining_tx_count, remaining_size)
.into_iter()
.take(remaining_tx_count as usize)
.peekable();
while regular_tx_iter.peek().is_some() {
for transaction in regular_tx_iter {
Expand Down Expand Up @@ -619,6 +620,7 @@ where
regular_tx_iter = l2_tx_source
.next(remaining_gas_limit, remaining_tx_count, remaining_size)
.into_iter()
.take(remaining_tx_count as usize)
.peekable();
}

Expand Down

0 comments on commit 592dfc6

Please sign in to comment.