Repository navigation
feat: proxy: use HashFromJSON and configurable RPC clients for L1 and L2 1896 - #1897
Conversation
Add an L2RPC section to the proxy config (mode, retry policy, HashFromJSON, batching) used to dial every finder-resolved L2 client, and default both L1RPC and L2RPC to HashFromJSON=true so block hashes come from the RPC response, as in aggkit. Fixes #1896 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
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: 3e30885fda
ℹ️ 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".
| if err := validateL2RPC(cfg.L2RPC); err != nil { | ||
| return fmt.Errorf("invalid L2RPC config: %w", err) | ||
| } |
There was a problem hiding this comment.
Validate L2 RPC only when the tracker runs
When the binary is invoked with --components proxy, this unconditional check still rejects an invalid or unsupported [L2RPC] section even though only runTracker consumes that configuration and the proxy component never creates L2 clients. This breaks the component isolation already used for tracker-specific validation and can prevent an otherwise valid proxy-only deployment from starting; gate this validation on the tracker component or move it into runTracker.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in afba48b: the [L2RPC] validation now lives in runTracker, so it only runs when the tracker component is enabled.
|
@claude review |
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
Claude finished @joanestebanr's task in 31s —— View job Review of PR #1897The change is small, coherent and well tested. I found no blocking issues, only a few suggestions. 🚀 What's New
🐛 Bug FixesNone. 📋 Config Updates[L1RPC] # existing; now also sets the backoff and the two flags below explicitly
InitialBackoff = "2s"
MaxBackoff = "10s"
BackoffMultiplier = 2.0
HashFromJSON = true
BatchBlockHeaderRetrieval = true
[L2RPC] # new; URL is ignored
Mode = "basic"
RetryMode = "backoff"
MaxRetries = 5
InitialBackoff = "2s"
MaxBackoff = "10s"
BackoffMultiplier = 2.0
HashFromJSON = true
BatchBlockHeaderRetrieval = true
|
🔄 Changes Summary
HashFromJSON = true) instead of recomputing it from the RLP header, as aggkit does by default.[L2RPC]section in the proxy config: mode, retry policy,HashFromJSONandBatchBlockHeaderRetrievalfor every L2 client. Each network's URL still comes from the bridge service finder (L2RPC.URLis ignored).sources.NewFinderClientsnow receives the RPC config and builds every dialed client from it (before, it used hardcoded code defaults, soHashFromJSONwasfalse).proxyvalidates[L2RPC]at startup (onlybasicmode, valid retry policy).N/A
📋 Config Updates
🔌 API Updates
🔌 Bridge service API
🔌 Proxy API
🔌 Others API
✅ Testing
proxy/config),validateL2RPC(proxy/cmd) and thatFinderClientsdials with the provided config (bridgetracker/sources).[L2RPC] HashFromJSON = false/trueand check the hash source.🐞 Issues
CustomHeaderByNumber#1896🔗 Related PRs
📝 Notes
[L1RPC]now defaults toHashFromJSON = true: only the way the block hash is obtained changes (from the RPC response instead of RLP hashing), not any behaviour. SetHashFromJSON = falseto go back to the previous one.basicmode, like L1:opmode needs per-network extra params.🤖 Generated with Claude Code