feat(evmrpc): configurable batch request limit and batch response size#3636
feat(evmrpc): configurable batch request limit and batch response size#3636amir-deris wants to merge 2 commits into
Conversation
PR SummaryLow Risk Overview New fields are defined on EVM RPC config with Config tests cover bad types, defaults when unset, and custom values including 0 to disable. Reviewed by Cursor Bugbot for commit a1ed39b. Bugbot is set up for automated code reviews on this repo. Configure here. |
|
The latest Buf updates on your PR. Results from workflow Buf / buf (pull_request).
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3636 +/- ##
==========================================
- Coverage 59.03% 58.15% -0.88%
==========================================
Files 2252 2176 -76
Lines 185682 176902 -8780
==========================================
- Hits 109625 102885 -6740
+ Misses 66248 64930 -1318
+ Partials 9809 9087 -722
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
Describe your changes and provide context
Adds two new EVM JSON-RPC config fields to bound the size of batched JSON-RPC calls (PLT-703):
evm.batch_request_limit— maximum number of requests allowed in a single JSON-RPC batch. Default1000.evm.batch_response_max_size— maximum number of bytes returned from a batched JSON-RPC call. Default25MB(25 * 1000 * 1000).Both apply to HTTP and WebSocket endpoints, and both can be set to
0to disable the limit. The values are wired through to go-ethereum'sbatchItemLimit/batchResponseSizeLimiton the HTTP and WebSocket server configs inevmrpc/server.go.Changes:
evmrpc/config/config.go— newConfigfields, defaults, flag names,ReadConfigparsing, andapp.tomltemplate entries with documentation.evmrpc/server.go— populatebatchItemLimit/batchResponseSizeLimitfor both the HTTP and WebSocket servers.Testing performed to validate your change
evmrpc/config/config_test.go:TestReadConfigfor both new fields.TestReadConfigBatchLimitscovering defaults flowing through and custom values (including0to disable) being parsed.go test ./evmrpc/config/...