Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(eth-sender): revert commit changing which type of txs we resend first #2327

Merged
merged 3 commits into from
Jun 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading