Send Fallback Batch tx only after Auth tx Confirms (m3)#467
Send Fallback Batch tx only after Auth tx Confirms (m3)#467lukeiannucci wants to merge 3 commits into
m3)#467Conversation
There was a problem hiding this comment.
💡 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 |
There was a problem hiding this comment.
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 👍 / 👎.
m3)
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.