Repository navigation
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
For ranges longer than two blocks, the history check does not bind earlier logs to the candidate chain, even though the later Multicall is hash-pinned. If a load-balanced provider returns history from another fork, a canonical withdrawal could be missed while Multicall succeeds, leaving stale payer collateral in the new snapshot.
1 open issue
What changed in this PR
Reduces orchestrator RPC usage on Arbitrum One, addressing the polling costs reported in #103.
Changes:
- Adds Multicall snapshots and ranged payer-event polling.
- Skips unnecessary redemption reads and finalized nonce probes.
- Moves balance sampling into the observer and adds regression coverage.
| File | Description |
|---|---|
redemption/worker.go |
Skips snapshots for empty queues. |
redemption/worker_test.go |
Verifies idle passes make no RPC calls. |
redemption/redemption_recovery.go |
Skips nonce probes after finalized consumption. |
redemption/redemption_recovery_test.go |
Covers idle finalized-replacement recovery. |
orchestrator/metrics.go |
Removes separate readiness balance polling. |
orchestrator/metrics_test.go |
Updates readiness test setup. |
orchestrator/app.go |
Connects observer balance samples to metrics. |
internal/test/chainrpc.go |
Supports Multicall and ranged-log fixtures. |
eth/senderwatcher.go |
Adds ranged event queries and cache handling. |
eth/rpc.go |
Identifies Arbitrum One and verifies headers. |
eth/payment.go |
Refactors snapshot construction and validation. |
eth/payment_observer.go |
Integrates optimized polling and pinned recovery. |
eth/payment_multicall.go |
Implements aggregated payment snapshot reads. |
eth/payment_multicall_test.go |
Covers budgets, reorgs, cancellation, and recovery. |
eth/contracts.go |
Registers new bindings and shares contract names. |
Review effort: Balanced
There was a problem hiding this comment.
🔵 Needs a closer look
The observer/recovery refactor spans payment collateral caching, reorg invalidation, and durable nonce finality. Mocked RPC coverage does not settle its financial correctness or provider-consistency guarantees; those remain open for human review.
No open issues 🎉
1 resolved since last review
Review effort: Balanced
There was a problem hiding this comment.
🔵 Needs a closer look
The observer changes payment-safety invariants across reorg recovery, hash-pinned snapshots, and concurrent cached-collateral reads. Synthetic RPC coverage cannot establish production-provider consistency for these behaviors, leaving a payment-safety uncertainty that warrants human protocol review.
No open issues 🎉
Review effort: Balanced

Fixes #103.
Summary
The ranged log query relies on the RPC provider to return complete history for the candidate's chain. The pinned Multicall confirms the candidate and its retained ancestor. A provider that serves the range from a different fork can omit a withdrawal and leave cached payer collateral overstated.
Verification
govulncheck.