Skip to content

Send Fallback Batch tx only after Auth tx Confirms (m3)#467

Open
lukeiannucci wants to merge 3 commits into
espresso/batcher-fallbackfrom
espresso/batcher-fallback-audit-m3
Open

Send Fallback Batch tx only after Auth tx Confirms (m3)#467
lukeiannucci wants to merge 3 commits into
espresso/batcher-fallbackfrom
espresso/batcher-fallback-audit-m3

Conversation

@lukeiannucci

@lukeiannucci lukeiannucci commented Jul 3, 2026

Copy link
Copy Markdown
Collaborator

Aims to fix the nonce-gap hazard from the M3 review comment. See: #458 (comment)

Previously the auth tx and batch tx were submitted together at consecutive nonces. If the auth tx failed asynchronously, txmgr's nonce reset left the in-flight batch tx gapped, colliding with the next pair and forcing channel rewinds.

Now the batch tx is only sent after the auth tx is confirmed; any auth failure stops the pair with an error receipt so the frames are resubmitted. This also lets us delete the receipt-watcher goroutine and authGroup, since receipts are now delivered inline.

@lukeiannucci lukeiannucci changed the title address audit m3 Send Fallback Batch tx only after Auth tx Confirms Jul 3, 2026
@lukeiannucci lukeiannucci marked this pull request as ready for review July 3, 2026 18:18

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: af73e32614

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

// The auth tx is confirmed on L1. Now send the batch tx
batchReceiptCh := make(chan txmgr.TxReceipt[txRef], 1)
queue.Send(transactionReference, *candidate, batchReceiptCh)
batchResult := <-batchReceiptCh

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Avoid waiting for the batch receipt in the publish loop

In post-Espresso fallback-auth mode, dispatchAuthenticatedSendTx is called synchronously from the single publishStateToL1 loop, so this receive keeps the publisher inside sendTransaction until the batch inbox tx has a txmgr receipt. Since txmgr only returns that receipt after the configured confirmation depth, multiple ready frames are now serialized through an auth confirmation plus a batch confirmation cycle, effectively bypassing MaxPendingTransactions and making the batcher publish at most one batch per pair of confirmation waits under load. The batch send only needs to be gated on the auth receipt; after queue.Send for the batch, its receipt should be forwarded without blocking the publisher.

Useful? React with 👍 / 👎.

@lukeiannucci lukeiannucci changed the title Send Fallback Batch tx only after Auth tx Confirms Send Fallback Batch tx only after Auth tx Confirms (m3) Jul 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant