feat: autoclaim L1 -> L2#1644
Conversation
|
Claude finished @arnaubennassar's task in 2m 59s —— View job Code Review: Auto Claim L1 to L2 FeatureI've completed a comprehensive review of this PR introducing the Auto Claim service for automated L1 to L2 bridge claims. This is a substantial feature addition with ~14K lines of new code across 77 files. 🚀 What's NewThis PR implements an automated bridge claim system that:
The implementation includes comprehensive unit tests (10 test files), E2E tests, and detailed documentation. 🐛 Bug FixesNone - this is a new feature. 📋 Config UpdatesNew top-level config section: [AutoClaim]
Enabled = false # Default: disabled
StoragePath = "{{PathRWData}}/autoclaim.sqlite"
[AutoClaim.API]
Enabled = false
Host = "0.0.0.0"
Port = 5579
[AutoClaim.L1ToL2Watchdog]
Enabled = true
PollInterval = "3s"
RetryAfterErrorPeriod = "1s"
MaxRetryAttemptsAfterError = -1
EtrogL1UpgradeBlock = 0
[AutoClaim.L2ToLxWatchdog]
Enabled = false # Must stay false - not implemented
[[AutoClaim.Claimers]]
Enabled = true
ID = "l2-primary"
NetworkType = "EVM"
NetworkID = 1
URLRPC = "http://l2-rpc:8545"
BridgeAddr = "0x..."
PolicyName = "allow-all" # Options: allow-all, api-approve, no-message, basic-filter
GasOffset = 100000
WaitPeriod = "1s"
RetryAfter = "1s"
MaxRetries = 30
[AutoClaim.Claimers.Policy]
AllowMessageClaims = false
AllowedOrigins = [0]
AllowedTokens = []
ManualFallback = false
MaxGas = 500000
[AutoClaim.Claimers.EthTxManager]
# Standard EthTxManager config per claimer
StoragePath = "/var/lib/aggkit/ethtxmanager-autoclaim-l2-primary.sqlite"
# ... other EthTxManager fields
|
# Conflicts: # multidownloader/evm_multidownloader_reorg.go # multidownloader/evm_multidownloader_reorg_test.go
…tic logs - config/config_test.go: move testify/urfave imports to end of non-stdlib group to satisfy gci two-group ordering (fixes CI lint failure) - config/default.go: set AutoClaim.L1ToL2Watchdog Enabled = true to match the assertion in TestLoadDefaultConfig (fixes unit test failure) - autoclaim/proof/preparer.go: add debug logs in selectL1InfoTreeIndex to surface whether the proof is blocked by l1InfoTree lag or gerSyncer lag - autoclaim/claimer/claimer.go: log info when proof not ready so E2E logs clearly show the pending state on each poll cycle Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…rackedBlocks wipe reorgDetector.Start calls loadTrackedHeaders which replaces the in-memory trackedBlocks map entirely from DB. If l2gersync.New (which calls Subscribe internally) ran first, the subscription entry it added would be wiped by the subsequent loadTrackedHeaders call, causing every AddBlockToTrack to return "subscriber not subscribed" forever. The per-claimer l2gersync was stuck in a retry loop at the first GER injection block (block 24), never processing the GER that covered the bridge deposit, so GetFirstGERAfterL1InfoTreeIndex always returned ErrNotFound and the claim proof was never prepared. Fix: call reorgDetector.Start synchronously before l2gersync.New so that loadTrackedHeaders completes before Subscribe adds the entry. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|

🔄 Changes Summary
📋 Config Updates
✅ Testing
🐞 Issues
🔗 Related PRs
📝 Notes