fix(tx-submitter): recover discarded rollup txs via rebuild instead of self-transfer - #1054
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (4)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughThe change adds rollup method classification and uses rollup-specific recovery when discarded transaction resubmission fails. Non-rollup transactions retain transfer replacement behavior. Tests cover classification and rollup calldata retention. ChangesRollup discard recovery
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: 🔵 Low · up to The PR makes dropped rollup transactions retry their intended L1 operation instead of consuming the nonce with an empty transfer. It is mergeable with owner awareness that interrupted recovery or cleanup failures could leave stale pending transaction records and complicate later recovery. Sequence Diagram(s)sequenceDiagram
participant handleDiscardedTx
participant IsRollupMethod
participant tryRecoverDiscardedRollupTx
participant ReSubmitTx
handleDiscardedTx->>IsRollupMethod: classify transaction method
IsRollupMethod-->>handleDiscardedTx: rollup or non-rollup
handleDiscardedTx->>tryRecoverDiscardedRollupTx: failed rollup resubmission
tryRecoverDiscardedRollupTx->>ReSubmitTx: ReSubmitTx(false, tx)
ReSubmitTx-->>tryRecoverDiscardedRollupTx: recovery result
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Warning Billing warning: we have not been able to collect payment for this subscription for more than 72 hours. Please update the payment method or pay any pending invoices in Billing to avoid service interruption. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
When a pending
commitBatch,commitState, orfinalizeBatchtransaction is dropped from the L1 mempool,handleDiscardedTxpreviously fell back tocreateReplacementTransferTx: a zero-value self-transfer with empty calldata that reuses the same nonce.For rollup operations, that permanently abandons the batch/finalize attempt while consuming the nonce. The submitter then moves on as if recovery succeeded, but the batch may never land on L1.
This PR changes discarded-tx recovery for rollup methods to retry via fee-bump resubmit and commit rebuild (
tryRecoverDiscardedRollupTx→ReSubmitTx(false)), which already handlescommitBatch↔commitStatetransitions throughtryRebuildRollupCommitTx.Non-rollup pending txs still use the self-transfer fallback to unstick the nonce.
Changes
constants.IsRollupMethod()forcommitBatch,commitState, andfinalizeBatchhandleDiscardedTxon rollup vs non-rollup recovery pathstryRecoverDiscardedRollupTx()helperIsRollupMethodand rollup discarded-tx recovery (no empty transfer fallback)Test plan
go test ./tx-submitter/constants/... ./tx-submitter/services/... -run 'TestIsRollupMethod|TestHandleDiscardedTx'Summary by CodeRabbit