Repository navigation
feat: exit_certificate pending step and claimer support for unclaimed pre-certificate bridges - #1929
Conversation
… pre-certificate bridges The exit_certificate_claimer could not claim L2->L1 asset bridges emitted before the exit certificate, because they are in the local exit tree but not in the certificate's bridge_exits. - exit_certificate: new standalone `--step pending` that lists the unclaimed (isClaimed on L1) pre-certificate leaf_type=0 bridges to L1 and writes step-pending-l2-bridges.json. - exit_certificate_claimer: optional pendingBridgesPath (auto-detected from the exit_certificate output dir); /bridges and /claim-params also serve those bridges, with proofs verified against the certificate's new_local_exit_root. - e2e: new 46-check_pending_bridges.sh; 60-claim checks the claimer lists and claims the bridge. Closes #1928 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
f82eb6d to
f7aef56
Compare
|
@claude review |
|
Claude finished @joanestebanr's task in 55s —— View job Review of PR #1929:
|
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f7aef56c08
ℹ️ About Codex in GitHub
Your team has set up Codex to 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 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| syncer, err := bridgesyncerlite.New(ctx, bridgesyncerlite.Config{DBPath: dbPath}, nil) | ||
| if err != nil { | ||
| return nil, fmt.Errorf("open local exit tree DB %q: %w", dbPath, err) | ||
| } | ||
| bridges, err := syncer.GetBridges(ctx) |
There was a problem hiding this comment.
Handle certificates with no new bridge exits
When bridgeExitCount is zero, RunStepG2 returns early without creating step-g-l2bridgesyncerlite.sqlite; opening that path here creates and migrates a new empty SQLite database. Consequently, a valid certificate with no newly synthesized exits but with unclaimed pre-certificate L2→L1 leaves produces an empty pending list instead of reading those leaves from the Step G1 database. Use the G1 database in this case or ensure G2 always copies/builds its database before this step reads it.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Addressed in e9b1f90, with a different approach than reading the G1 DB. When the certificate has no bridge exits, G2 returns early with NewLocalExitRoot = EmptyLER, so the pre-certificate leaves could not be proven against that root anyway (the claimer would reject them in VerifyProof). The step now fails explicitly in that case, and also checks with os.Stat that the step-g DB exists before opening it, so it no longer creates an empty sqlite or reports an empty list. Both are covered by tests.
… data race Tests read finder.addrToNetworkID without a lock while discoverRollup writes it from the listener goroutine, so -race flaked in TestLiveDiscovery_AllowNetworkIDs. Add an isWatchedAddr helper that takes the read lock and use it everywhere the map was read bare. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… zero certificate exits Address PR review: opening a missing step-g DB created a stray empty sqlite and reported misleading errors or an empty list; with no certificate exits G2 builds no tree, so say so explicitly. Also avoid copying BridgeLeaf in selectPendingCandidates. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…p; move orderedSteps comment Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
Follow-up on the review comments (commits e9b1f90 and 2051947). Done
Intentionally not changed
Happy to revisit any of these if you feel strongly. |
🔄 Changes Summary
exit_certificate: new standalone step--step pending_claims(not part ofall) that lists the L2→L1 asset bridges (leaf_type=0) emitted before the exit certificate that are still unclaimed on L1 (isClaimedon the L1 bridge) and writesstep-pending-l2-bridges.json. It reads the Step G local exit tree DB, so it needs step g first.exit_certificate_claimer: optionalpendingBridgesPath(auto-detected in the exit_certificate output dir)./bridgesand/claim-paramsalso serve those bridges, with proofs verified against the certificate'snew_local_exit_root. Pending bridges are matched bydeposit_count, so identical leaves are not collapsed.test/e2e-exit_certificate): new46-check_pending_bridges.sh;60-claim_exit_certificate_funds.shchecks that the claimer lists the pending bridge, claims it, and thatisClaimedis true on L1.pendingBridgesPathis optional).--step pending_claimsvalue.📋 Config Updates
pendingBridgesPath(derived from the exit_certificate output dir when the file exists).🔌 API Updates
🔌 Bridge service API
🔌 Proxy API
🔌 Others API
GET /bridgesandGET /claim-paramsappend the pending pre-certificate bridges after the certificate's exits when the pending file is present. Not a breaking change; without the file the responses are unchanged.metadataof pending entries in/bridgesis the raw bridge metadata.✅ Testing
go test ./tools/exit_certificate/... ./tools/exit_certificate_claimer/...(new unit tests for the step and the claimer, with a real lite DB). New e2e step46-check_pending_bridges.shand extra checks in60-claim_exit_certificate_funds.sh(not run yet).isClaimed(depositCount, l2NetworkId)for rollup leaves).🐞 Issues
🔗 Related PRs
📝 Notes
leaf_type=1) are out of scope: the claimer does not supportclaimMessage.make lintand validation with real data.🤖 Generated with Claude Code