Skip to content
This repository has been archived by the owner on Aug 28, 2024. It is now read-only.

Commit

Permalink
fix(eth-sender): revert commit changing which type of txs we resend f…
Browse files Browse the repository at this point in the history
…irst (matter-labs#2327)

Signed-off-by: tomg10 <[email protected]>
  • Loading branch information
tomg10 authored and irnb committed Jul 12, 2024
1 parent e795c18 commit 50b0e22
Showing 1 changed file with 23 additions and 9 deletions.
32 changes: 23 additions & 9 deletions core/node/eth_sender/src/eth_tx_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -250,35 +250,49 @@ impl EthTxManager {
.l1_interface
.get_operator_nonce(l1_block_numbers)
.await?;

let non_blob_tx_to_resend = self
.apply_inflight_txs_statuses_and_get_first_to_resend(
storage,
l1_block_numbers,
operator_nonce,
None,
)
.await?;

let blobs_operator_nonce = self
.l1_interface
.get_blobs_operator_nonce(l1_block_numbers)
.await?;
let blobs_operator_address = self.l1_interface.get_blobs_operator_account();

let mut blob_tx_to_resend = None;
if let Some(blobs_operator_nonce) = blobs_operator_nonce {
// need to check if both nonce and address are `Some`
if blobs_operator_address.is_none() {
panic!("blobs_operator_address has to be set its nonce is known; qed");
}
if let Some(res) = self
.monitor_inflight_transactions_inner(
blob_tx_to_resend = self
.apply_inflight_txs_statuses_and_get_first_to_resend(
storage,
l1_block_numbers,
blobs_operator_nonce,
blobs_operator_address,
)
.await?
{
return Ok(Some(res));
}
.await?;
}

self.monitor_inflight_transactions_inner(storage, l1_block_numbers, operator_nonce, None)
.await
// We have to resend non-blob transactions first, otherwise in case of a temporary
// spike in activity, all Execute and PublishProof would need to wait until all commit txs
// are sent, which may take some time. We treat them as if they had higher priority.
if non_blob_tx_to_resend.is_some() {
Ok(non_blob_tx_to_resend)
} else {
Ok(blob_tx_to_resend)
}
}

async fn monitor_inflight_transactions_inner(
async fn apply_inflight_txs_statuses_and_get_first_to_resend(
&mut self,
storage: &mut Connection<'_, Core>,
l1_block_numbers: L1BlockNumbers,
Expand Down

0 comments on commit 50b0e22

Please sign in to comment.