Repository navigation
feat: add the EVM RPC keys sei-chain reads that the schema was missing - #54
Conversation
sei-chain's [evm] section has 32 keys the unified schema did not model, including the new per-IP rate limiting (rate_limiting_enabled, ip_rate_limit_rps, ip_rate_limit_burst, trusted_proxy_cidrs) and the request-admission limits around it. BuildRegistry never produced them, so ApplyOverrides rejected each as unknown and the controller could not set them, and WriteConfigToDir dropped them from app.toml, leaving every managed node on seid's compiled-in defaults. The fields mirror seid's key names and defaults, so the override key is evm.<seid key>. Validate() now rejects what seid refuses to start with: max_filters or max_block_filter_hashes of 0, negative connection or timeout limits, non-native tracer names, invalid trusted proxy CIDRs, malformed rpc_method_timeouts entries, and a rate-limit burst below batch_request_limit. ReadConfigFromDir seeds these keys with defaults before decoding app.toml. Files rendered by earlier versions lack them, and decoding into a zero value would let an incremental apply write rate_limiting_enabled = false and max_filters = 0 back to the node. Keys present in the file, including an explicit empty list, still decode as written. Refs PLT-1553 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
PR SummaryMedium Risk Overview Defaults match Reviewed by Cursor Bugbot for commit 0a1a71c. Bugbot is set up for automated code reviews on this repo. Configure here. |
|
@seidroid review |
There was a problem hiding this comment.
Adds the 32 missing seid [evm] keys to EVMConfig and the legacy mapping, with seid's defaults, read-time seeding for older app.toml files, validation, and enrichments. I approve because the new validation matches seid's startup checks in evmrpc/config/config.go. One suggestion covers an edge case where the read-time seeding is stricter than seid. The codex reading (zero RPS should bypass the burst-vs-batch check) is dropped: seid applies the same check without exempting ip_rate_limit_rps = 0, so sei-config matches seid there. No Go toolchain was available, so the tests were not run.
Non-blocking
1 finding on the changed lines, as inline comments.
seidroid review · decision approve · session 98b271ef973a4fbf95c7ff16a2670b1a · turn resp_claude_b7435c9cd119174336b0e8069d7f34fc · item a27828c040d555f3bc3773e0314ea478
Findings: 0 blocking | 1 non-blocking | 1 posted inline
| TraceBakeWindowBlocks: d.TraceBakeWindowBlocks, | ||
| TraceBakeUseSnapshot: d.TraceBakeUseSnapshot, | ||
| TraceBakeSnapshotWindow: d.TraceBakeSnapshotWindow, | ||
| RateLimitingEnabled: d.RateLimitingEnabled, |
There was a problem hiding this comment.
suggestion — When an app.toml has no rate_limiting_enabled key, this seeds it as true. seid treats an absent key more gently: it raises ip_rate_limit_burst to batch_request_limit and logs a warning instead of failing. seid versions between #3507 and #4403 wrote ip_rate_limit_burst without the switch, and one of those files with a burst below the batch limit now fails Validate() here. Re-rendering it also writes rate_limiting_enabled = true explicitly, which turns seid's warning into a startup failure. Consider applying the same burst raise when the switch was absent from the file, or recording that it was absent so the check can be skipped.
There was a problem hiding this comment.
The difference is real, but its reach is much narrower than this suggests, so I'm leaving the code as is.
- The window is #3507 to #3779 (Jun 16 to Aug 5), not up to #4403. From #3779 on, seid's template writes
rate_limiting_enabledexplicitly (asfalseuntil #4403). With the switch off, the burst-vs-batch check doesn't run. - Default values in that window pass. The template's default
ip_rate_limit_burstwas 400, and sei-config fills inbatch_request_limit = 100. It only fails if an operator set the burst below 100 by hand. - Controller-managed nodes don't have such files. Incremental apply reads
app.tomlfiles that sei-config itself wrote earlier. Those files have none of these keys, so the burst gets the default 200 as well. The case needs a file seid generated during that window, then hand-edited, then read by sei-config. - It fails safely.
Validate()errors and namesip_rate_limit_burstandbatch_request_limit, the apply stops before writing anything, and a single override fixes it.
Matching seid's "raise the burst if the switch was missing" logic would mean tracking whether each key was present in the file. That isn't worth the complexity for a hand-edited file from a short window that has since closed.
Resolves PLT-1553.
Problem
sei-chain's
[evm]section has 32 keys thatSeiConfigdoesn't model, including the new per-IP rate limiting. Because sei-k8s-controller renders node config through sei-config:ApplyOverridesrejects these keys asunknown override key, so the controller can't set them.WriteConfigToDirdrops them fromapp.toml, so every managed node runs on seid's compiled-in defaults and the values can't be tuned.Changes
EVMConfigandlegacyEVM, flat and with seid's exact key names (override key =evm.<seid key>), and mapped intoLegacyApp()/fromLegacy().rate_limiting_enabled,ip_rate_limit_rps,ip_rate_limit_burst,trusted_proxy_cidrsbatch_request_limit,batch_response_max_size,max_request_body_bytes,max_concurrent_request_bytes,body_read_idle_timeout,ws_admission_timeout,max_open_connections,rpc_default_timeout,rpc_method_timeoutsmax_filters,max_block_filter_hashes,max_subscriptions_logs,max_log_bytes,enable_simulation,max_estimate_gas_calls,max_state_override_accounts,max_state_override_slotsmax_trace_struct_log_bytes,trace_allowed_tracers,trace_allow_js_tracers,enable_parallelized_block_trace,trace_bake_*(7 keys)evmrpc/config.DefaultConfig, with no mode-specific overrides.validateEVMnow rejects what seid refuses to start with:max_filters/max_block_filter_hashesof 0max_open_connections,body_read_idle_timeout,rpc_default_timeouttrusted_proxy_cidrsrpc_method_timeoutsip_rate_limit_burst < batch_request_limitwhen rate limiting is enabledFollow-up
github.com/sei-protocol/sei-configin sei-k8s-controller.