feat(rollup): shadow-fork testing switches, estimateGas cap, stranded-bundle logging#1814
feat(rollup): shadow-fork testing switches, estimateGas cap, stranded-bundle logging#1814lispc wants to merge 3 commits into
Conversation
Add opt-in config switches (all default off, production behavior unchanged) needed when running the relayer against a shadow fork with a DB imported from production: - l2_config.disable_l2_watcher: skip the missing-blocks fetch loop; an imported/empty l2_block table would otherwise trigger a genesis crawl. - chunk/batch/bundle proposer 'disable': turn off proposal loops independently. - bundle_propose_cooldown_sec: wall-clock cooldown between bundle proposals; on a shadow fork the L2 block timestamps are historical so the normal bundle timeout would fire immediately. - sender chain_nonce_only: initialize the sender nonce from the chain pending nonce only, ignoring stale pending_transaction rows in an imported DB.
Some nodes (e.g. Anvil) reject estimation requests that carry fee caps but leave Gas at the go-ethereum default of 0. go-ethereum's EstimateGas only uses CallMsg.Gas as the upper bound of its binary search, so a generous 30M cap does not change the estimation result.
… bundle - Commit/finalize failure logs dumped full calldata at Error level on every retry tick; move the calldata to a Debug log. - When a finalize tx confirms as failed, the bundle is marked RollupFinalizeFailed(7), which ProcessPendingBundles never picks up again (GetFirstPendingBundle only queries RollupPending). Emit a loud Error log with the bundle index making the required manual intervention (reset rollup_status to 1) explicit. - Drop the stale 'only used in unit tests' comment on GetBundles, now used by the relayer.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (10)
💤 Files with no reviewable changes (1)
📝 WalkthroughWalkthroughThe relayer gains configuration switches for watcher and proposer execution, bundle proposal cooldown tracking, chain-only nonce initialization, explicit gas estimation limits, and revised transaction failure diagnostics. ChangesRelayer controls and transaction handling
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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 |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## develop #1814 +/- ##
===========================================
- Coverage 35.44% 35.44% -0.01%
===========================================
Files 262 262
Lines 22596 22636 +40
===========================================
+ Hits 8010 8023 +13
- Misses 13748 13770 +22
- Partials 838 843 +5
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Split out from #1803 (second of two PRs, independent of #1813). All switches default off; production behavior is unchanged except where noted.
1. Shadow-fork testing switches (
feat)Opt-in config switches needed when running the relayer against a shadow fork with a DB imported from production:
l2_config.disable_l2_watcher: skip the missing-blocks fetch loop (an imported/emptyl2_blocktable would otherwise trigger a genesis crawl).disableon chunk/batch/bundle proposer configs: turn off proposal loops independently.bundle_propose_cooldown_sec: wall-clock cooldown between bundle proposals — on a shadow fork L2 block timestamps are historical, so the normal bundle timeout would fire immediately.sender.chain_nonce_only: initialize the sender nonce from the chain pending nonce only, ignoring stalepending_transactionrows in an imported DB.2.
eth_estimateGasexplicit gas cap (fix)Some nodes (e.g. Anvil) reject estimation requests that carry fee caps but leave⚠️ This touches the production path (all commit/finalize/blob estimations): go-ethereum's
Gasat the go-ethereum default of 0.CallMsg.Gasis now set to 30M.EstimateGasonly usesCallMsg.Gasas the upper bound of its binary search (and still caps it by balance), so a generous cap should not change results — worth one reviewer's confirmation.3. Relayer logging (
chore)RollupFinalizeFailed(7), whichProcessPendingBundlesnever picks up again (GetFirstPendingBundleonly queriesRollupPending). A loud Error log now records the bundle index and that manual intervention (resetrollup_statusto 1) is required.GetBundles, now used by the relayer.Test plan
go build ./...,go vet, gofmt/goimports,go mod tidycleanmake mock_abi && make lint(golangci-lint v1.57.2) passesgo testpasses forinternal/config,internal/controller/sender,internal/controller/relayer,internal/controller/watcher(testcontainers)Summary by CodeRabbit
New Features
Bug Fixes
Logging