Repository navigation
refactor: remove autoclaim - #1901
Conversation
Part of aggkit#1898. Plan sections A and B. - Delete the autoclaim/ package (70 files) and cmd/run_autoclaim_test.go. - cmd/run.go: drop the autoclaim imports, the standalone storage open, the runtime start/route registration, shouldRunAutoClaim and the AUTOCLAIM entries in the isNeeded lists of l1InfoTreeMustRun, the L1 reorg detector and runBridgeSyncL1IfNeeded. - common: remove the AUTOCLAIM component and its test cases. - config: drop the AutoClaim field plus its ApplyDefaults/Validate calls and the [AutoClaim] block from the defaults; add an AutoClaim deprecated-field hint so leftover operator configs fail with a clear message. - Drop the .mockery.yaml autoclaim entries and the Makefile generate-swagger-docs autoclaim lines and --exclude autoclaim/api. - Keep [AdminREST] and the admin server. - test/e2e: delete autoclaim_test.go (it imports the removed package and blocks build/tidy) and move the one symbol other suites shared with it, bridgeServiceBaseURL, into bridge_utils.go. - go mod tidy.
…-only helpers Remove the autoclaim-only GET /bridge/v1/claim-candidates route, its handler, the ClaimCandidate* response types, the GetClaimCandidatesReq metric and the client GetClaimCandidates/Params, with their tests. Dead-code sweep of #1705 additions that no longer have a non-test caller: - bridgesync GetBridgesInDepositRange (processor + BridgeSync) and buildDepositRangeFilterClause, plus the Bridger interface method and mock - l1infotreesync GetVerifiedBatchesInBlockRange (processor + L1InfoTreeSync) Kept (still used outside autoclaim): GetTotalNumberOfRecordsWithParams, queryPagedWithParams, bridgesync LeafType range validation, the claimsync storage duplicate-block hash check and the l1infotreesync VerifyBatchesTrustedAggregator comment. Regenerate swagger docs and delete docs/assets/swagger/autoclaim/.
…gh the proxy Section D of the autoclaim removal (#1898); step 4/6 of the plan on COM-4. - remove the [AutoClaim] blocks (and their trailing comments) from the anvil-2chains 001/002, op-pp 001 and op-pp-2chains 002 aggkit-config.toml - drop `autoclaim` from --components in the three docker-compose files, including the commented debug block in op-pp and the anvil-2chains README topology note - delete the anvil-2chains / autoclaim matrix group from test-go-e2e.yml and fix the stateful-suite comment that named it - remove the AutoClaim claim-race handling from test/e2e/bridge_utils.go: the IsClaimed pre-check, the AlreadyClaimed retry loop and the now-unused alreadyClaimedErrorSelector. Nothing claims a deposit concurrently any more, so the claim helpers go back to claim -> WaitMined -> status check. - publish the aggkit-proxy REST endpoint in the summary.json of the two envs that run one (anvil-2chains 15601, op-pp-2chains 12601) and read it in test/e2e/envs: the bridge/claim helpers now fetch the bridge, L1-info-tree index, injected leaf and claim proof through the proxy (which resolves the network_id of each request) when the env has one, and fall back to the per-L2 bridge service otherwise. go vet ./test/e2e/... and go test -c ./test/e2e both pass; `git grep -i autoclaim -- test .github` only matches the zkevm-bridge-service comments in test/e2e-exit_certificate/20-prepare_network.sh.
Section E of the autoclaim removal plan (#1898): - delete `docs/autoclaim.md` and its `docs/SUMMARY.md` entry; - `docs/common_config.md`: drop the `## AutoClaim` section; - `docs/bridge_service.md`: drop the Auto Claim reference in note 4, the whole "Claim candidates endpoint" section and the `get_claim_candidates` handler id from the Prometheus metrics list; - `docs/bridgetracker.md`: replace the pointer to `autoclaim.md#top-level-keys` with a self-contained table of `[BridgeServiceFinder]` keys and defaults (taken from `bridgeservicefinder/config.go`); - `docs/e2e_tests.md`: drop the "Auto Claim L1 -> L2" and "Auto Claim: claimer added after others" sections; the generic docker-compose resource note that lived under the first one moves to the "Single L2 network" intro. `docs/aggsender.md` is untouched: its two "auto claim" sequence-diagram arrows belong to the generic bridge flow, not to the aggkit component. Left alone as planned: `tools/exit_certificate/**`, `test/e2e-exit_certificate/**`, `tools/force_ger_update/PLAN.md` and `claimsync` `hasClaimCandidate`.
golangci-lint (whitespace) flags the blank line left at the end of TestGetLastVerifiedBatches when the autoclaim-only tests were removed.
|
Claude finished @arnaubennassar's task in 44s —— View job Review of PR #1901: remove autoclaim
SummaryThis is a clean removal. I found no leftover references to the deleted code in Go sources. A repo-wide grep for
Component registration, the 🔴 RequiredNone. 🟡 Suggested
🟢 Optional
PR summary🚀 What's NewRemoves the in-tree autoclaim feature (#1898) entirely:
🐛 Bug FixesNone. 📋 Config UpdatesThe -[AutoClaim]
-Enabled = true
-StoragePath = "/data/autoclaim.sqlite"There is no replacement. Stale
|
BridgeL2ToL2 resolved env.L2B.BridgeService before the env.L2B == nil guard, so a single-chain env panicked instead of returning the intended error. Move the bs/bsB initialisation below the guard, as in BridgeL2ToL2NoClaim. Addresses the PR #1901 review feedback (suggested item 1).
No component registers admin routes after the autoclaim removal, so the adminHasRoutes block is unreachable. Keep it and document that it is generic infrastructure, as the plan's assumption 3 decided. Addresses the PR #1901 review feedback (suggested item 2, option B).
|
Review feedback addressed — pushed as 🟡 Suggested
🟢 Optional
Verification — |
🔄 Changes Summary
Remove the autoclaim feature entirely (#1898). Autoclaim was an in-tree, opt-in component that watched bridges and submitted claim transactions itself; the bridge service / proxy already exposes everything needed to build that as an external service, so keeping a second, partially-overlapping claimer in the repo is dead weight.
autoclaim/package (70 files:api+ its swagger docs,apitypes,bridgedetector+ mocks,claimer,claimtx,config,policy,proof,runtime,sender,simulator,storage+ its 3 migrations,types+ mocks).cmd/run.go(standalone storage, runtime start, public/admin route registration,shouldRunAutoClaim, andAUTOCLAIMfrom theisNeededlists of the L1 info tree, L1 reorg detector and L1 bridge sync),common/components.goAUTOCLAIMcomponent constant + registry entry,.mockery.yamlentries, Makefile swagger target./autoclaim/v1/*(gone with the package) andGET /bridge/v1/claim-candidates, plus its bridgeservice types, metric (GetClaimCandidatesReq), client method (GetClaimCandidates) and tests. Swagger regenerated.GetBridgesInDepositRange(bridgesyncprocessor.go/bridgesync.go,Bridgerinterface, mock) and the autoclaim-only helpers inl1infotreesync(processor_verifybatches.go+ tests). Shared syncers' DB migrations andbridgeservicefinderare untouched.claimsync's unrelatedhasClaimCandidateis untouched.test/e2e/autoclaim_test.go(6 tests), drops the autoclaim race-handling/AlreadyClaimedretry loop from the claim helpers, dropsautoclaimfrom every--components=list, env[AutoClaim]configs and the CI matrix group, and routes the claim helpers through theaggkit-proxywhere an env runs one.docs/autoclaim.md(+docs/SUMMARY.mdentry,docs/assets/swagger/autoclaim/), the## AutoClaimsection ofdocs/common_config.md, the claim-candidates section/link/metric ofdocs/bridge_service.md, the autoclaim run instructions indocs/e2e_tests.md;docs/bridgetracker.mdis now self-contained instead of pointing atautoclaim.md.Net: 119 files changed, +265 / -29636.
[AutoClaim]section is removed. A config that still carries it now fails to load with a clear message (AutoClaim has been removed, delete the [AutoClaim] section from the configuration) via the repo's existing deprecated-field mechanism — no silent ignore. The same applies to everyAutoClaim.*key.--components=autoclaimis no longer a valid component (it fails the existing unknown-component validation).autoclaim.sqlite(and its WAL/SHM files) — aggkit no longer opens or migrates it.📋 Config Updates
Nothing replaces it: claim candidates can be read from
GET /bridge/v1/bridges//claims(directly or through the proxy) and claims submitted by an external claimer.🔌 API Updates
🔌 Bridge service API
GET /bridge/v1/claim-candidates(and itsClaimCandidateResponse,ClaimCandidatesResulttypes,GetClaimCandidatesclient method andget_claim_candidatesmetric) is removed together with autoclaim, its only consumer. No other/bridge/v1/*route changes;bridgeservice/docs/swagger.{json,yaml},bridgeservice/docs/docs.goanddocs/assets/swagger/bridge_service/swagger.jsonare regenerated accordingly.🔌 Proxy API
network_id-based routing for the claim helpers in envs that run one (anvil-2chains,op-pp-2chains).🔌 Others API
/autoclaim/v1/*surface (public and admin) is removed with the package, includingdocs/assets/swagger/autoclaim/and its swagger instance.[AdminREST]and the admin server stay (generic infrastructure; it is simply not started when no admin route is registered).✅ Testing
go test -c ./test/e2e/...).make test-e2egroups are left to CI (kurtosis/docker bring-up).🐞 Issues
🔗 Related PRs
fix/autoclaim-claimer-ethtxmanager-defaultsbranch becomes moot once this lands.📝 Notes
[AutoClaim]leftovers are reported as a load error rather than ignored.aggkit_autoclaim_enabledand emits_log_autoclaim_warninginaggkit.star; helm-charts may also carry the autoclaim component. Those need a companion cleanup before/with the next image bump — out of scope here.docs/aggsender.md's "auto claim" arrows were left alone: they describe generic bridge-service behaviour, not aggkit's autoclaim component.