Skip to content

Commit

Permalink
PR feedback
Browse files Browse the repository at this point in the history
Signed-off-by: tomg10 <[email protected]>
  • Loading branch information
tomg10 committed Sep 24, 2024
1 parent b9b018e commit b335a02
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions core/node/eth_watch/src/event_processors/priority_ops.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,23 +85,24 @@ impl EventProcessor for PriorityOpsEventProcessor {
APP_METRICS.processed_txs[&TxStage::added_to_mempool()].inc();
APP_METRICS.processed_l1_txs[&TxStage::added_to_mempool()].inc();
let processed_priority_transactions = sl_client.get_total_priority_txs().await?;
let mut ops_to_insert = new_ops
let ops_to_insert: Vec<&L1Tx> = new_ops
.iter()
.take_while(|op| processed_priority_transactions <= op.serial_id().0);
.take_while(|op| processed_priority_transactions <= op.serial_id().0)
.collect();

for new_op in ops_to_insert.by_ref() {
for new_op in &ops_to_insert {
storage
.transactions_dal()
.insert_transaction_l1(new_op, new_op.eth_block())
.await
.map_err(DalError::generalize)?;
}
stage_latency.observe();
if let Some(last_op) = ops_to_insert.by_ref().last() {
if let Some(last_op) = ops_to_insert.last() {
self.next_expected_priority_id = last_op.serial_id().next();
}

Ok(skipped_ops + ops_to_insert.count())
Ok(skipped_ops + ops_to_insert.len())
}

fn relevant_topic(&self) -> H256 {
Expand Down

0 comments on commit b335a02

Please sign in to comment.