Allow timeout configuration for JSON-RPC requests - #923
Conversation
WalkthroughThe changes add a configurable JSON-RPC request timeout feature. A new Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes
Suggested labels
Suggested reviewers
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Tip 📝 Customizable high-level summaries are now available in beta!You can now customize how CodeRabbit generates the high-level summary in your pull requests — including its content, structure, tone, and formatting.
Example instruction:
Note: This feature is currently in beta for Pro-tier users, and pricing will be announced later. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
api/server.go(1 hunks)cmd/run/cmd.go(1 hunks)config/config.go(1 hunks)
🔇 Additional comments (2)
config/config.go (1)
127-129: LGTM!The new
RpcRequestTimeoutfield is well-documented and properly typed. The comment clearly explains its purpose for controlling JSON-RPC request timeout duration.cmd/run/cmd.go (1)
294-294: LGTM! CLI flag is well-defined.The
--rpc-request-timeoutflag is properly configured with a sensible default of 120 seconds and a clear description. The use ofDurationVarallows operators to specify values like "2m" or "90s" naturally.Note: While the flag definition is correct, validation of the value should be added in
api/server.goto handle edge cases (e.g., very small or zero values). This has been flagged in a separate comment.
Closes: #723
Description
Currently, the request timeout is hard-coded to
30seconds, which is the default from Geth. However, for certain JSON-RPC calls, such as traces, we need a higher timeout. Setting the default to120seconds, and operators can tune this as they see fit.For contributor use:
masterbranchFiles changedin the Github PR explorerSummary by CodeRabbit
--rpc-request-timeoutflag to control the maximum duration for RPC requests before timing out (default: 120 seconds), providing greater control over request handling behavior.