feat: cherry-pick: configurable batch block header retrieval via RPCClientConfig#1606
Conversation
…1601) ## 🔄 Changes Summary - Moves `BlockHeadersResult`, `ErrNotFound` and `IsErrNotFound` from `etherman` to the `types` package - Adds `RetrieveBlockHeaders(ctx, blockNumbers, maxConcurrency)` to the `CustomEthereumClienter` interface, implemented by `DefaultEthClient` - Adds `BatchBlockHeaderRetrieval bool` (default `true`) to `RPCClientConfig` — operators can disable batch RPC requests for nodes that do not support them - Simplifies `multidownloader` call sites: the three `etherman.RetrieveBlockHeaders(ctx, log, ethClient, rpcClient, ...)` calls collapse to `dh.ethClient.RetrieveBlockHeaders(ctx, ...)` - Documents `RPCClientConfig` in `docs/common_config.md` ##⚠️ Breaking Changes N/A ## 📋 Config Updates - 🧾 New optional field in `[L1NetworkConfig.RPC]` and `[Common.L2RPC]`: ```toml BatchBlockHeaderRetrieval = true # default, disable for nodes without batch support ``` ## ✅ Testing - 🤖 **Automatic**: existing unit tests updated (`TestEVMMultidownloader_MoveUnsafeToSafeIfPossible`, `TestEVMMultidownloader_StepSafe`); `TestLoadDefaultConfig` asserts the new default - 🖱️ **Manual**: build passes (`go build ./...`), unit tests pass (`go test ./types/... ./etherman/... ./multidownloader/... ./config/...`) ## 📝 Notes - `etherman.BlockHeadersResult` and `etherman.NewBlockHeadersResult` are kept as type aliases for backward compatibility with existing callers - `etherman.ErrNotFound` and `etherman.IsErrNotFound` are kept as wrappers delegating to `types` - The standalone `etherman.RetrieveBlockHeaders`, `RetrieveBlockHeadersBatch`, `RetrieveBlockHeadersLegacy` functions remain for direct use in tests and other callers outside the multidownloader --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Claude finished @joanestebanr's task in 2m 12s —— View job PR Review Complete ✅I've completed a comprehensive review of PR #1606. This is a well-structured cherry-pick that adds configurable batch block header retrieval functionality. 🚀 What's New
🐛 Bug FixesNone. 📋 Config UpdatesNew optional field in BatchBlockHeaderRetrieval = true # default; set to false for nodes without batch support
|
|



🔄 Changes Summary
Cherry-pick of #1601 (originally merged into
release/0.10) intodevelop.BlockHeadersResult,ErrNotFoundandIsErrNotFoundfromethermanto thetypespackageRetrieveBlockHeaders(ctx, blockNumbers, maxConcurrency)to theCustomEthereumClienterinterface, implemented byDefaultEthClientBatchBlockHeaderRetrieval bool(defaulttrue) toRPCClientConfig— operators can disable batch RPC requests for nodes that do not support themmultidownloadercall sites: the threeetherman.RetrieveBlockHeaders(ctx, log, ethClient, rpcClient, ...)calls collapse todh.ethClient.RetrieveBlockHeaders(ctx, ...)RPCClientConfigindocs/common_config.mdN/A
📋 Config Updates
[L1NetworkConfig.RPC]and[Common.L2RPC]:✅ Testing
TestLoadDefaultConfigasserts the new default📝 Notes
etherman.BlockHeadersResultandetherman.NewBlockHeadersResultare kept as type aliases for backward compatibilityetherman.ErrNotFoundandetherman.IsErrNotFoundare kept as wrappers delegating totypes🤖 Generated with Claude Code