fix(cketh): derive the balance-scan batch size from the EIP-3860 initcode limit - #11489
Merged
gregorydemay merged 4 commits intoSep 8, 2026
Merged
Conversation
…3860 initcode limit * A full batch of MAX_CALLS_PER_BATCH balanceOf calls is rejected by anvil with "max initcode size exceeded". * The encoding is 165 bytes of init code, one length word and 64 bytes per call, so at most 764 calls fit in 49152 bytes. * The test fails until the cap is lowered. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AV18LEDjdNim5BecwhcqeV
…atches * One create-style eth_call carries at most 764 pairs because initcode is capped at 49152 bytes. * Larger watchlists are split into several calls per tick, each retried whole on failure. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AV18LEDjdNim5BecwhcqeV
…P-3860 initcode limit * A create-style eth_call is bounded by the 49152-byte initcode limit, not only by the provider gas cap. * The batch size is now derived from the encoding, which yields 764 calls for the current batcher. * A chunk that always exceeded the limit was retried whole every tick and its deposits were never detected. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AV18LEDjdNim5BecwhcqeV
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The reviewed changes have no unresolved approval-blocking issues.
Pull request overview
Derives the ckETH balance-scan batch limit from EIP-3860’s initcode ceiling to prevent oversized batches from failing indefinitely.
Changes:
- Replaces the 1,000-call limit with a derived 764-call limit.
- Adds boundary unit and Anvil integration tests.
- Documents the limit and chunking behavior.
File summaries
| File | Description |
|---|---|
rs/ethereum/cketh/minter/tests/deposit_from_cex.rs |
Verifies Anvil accepts 764 calls and rejects 765. |
rs/ethereum/cketh/minter/src/balance_scan/mod.rs |
Uses the derived batch limit. |
rs/ethereum/cketh/minter/src/balance_scan/batcher/tests.rs |
Tests encoded-size boundaries. |
rs/ethereum/cketh/minter/src/balance_scan/batcher/mod.rs |
Derives the maximum batch size. |
rs/ethereum/cketh/docs/deposit_from_cex.md |
Documents EIP-3860 chunking. |
Review details
- Files reviewed: 5/5 changed files
- Comments generated: 0
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
gregorydemay
marked this pull request as ready for review
September 8, 2026 10:37
|
✅ No security or compliance issues detected. Reviewed everything up to a050db4. Security Overview
Detected Code Changes
|
mbjorkqvist
approved these changes
Sep 8, 2026
Address review feedback on the batch-size derivation: - derive MAX_CALLS_PER_BATCH from both the EIP-3860 initcode limit and the EIP-170 code-size limit on the returned blob, taking the smaller, so the cap stays valid if the batcher encoding ever changes shape - fund the last holder of the full-batch anvil test so the assertion proves the offset arithmetic addressed pair 763, not just that an all-zero blob of the right size came back - drop the redundant re-export of MAX_CALLS_PER_BATCH from balance_scan Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016Yv31YXb6YH1Gp71G54cL9
gregorydemay
enabled auto-merge
September 8, 2026 12:21
gregorydemay
deleted the
gdemay/DEFI-2996-balance-scan-initcode-limit
branch
September 8, 2026 12:49
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reported in the forum.
Problem
eth_callthat runs the deployless batcher as init code.Changes
max initcode size exceeded.🤖 Generated with Claude Code
https://claude.ai/code/session_01AV18LEDjdNim5BecwhcqeV