refactor(node-config): remove reth deps, add FromEnv to RPC configs#113
refactor(node-config): remove reth deps, add FromEnv to RPC configs#113
Conversation
1cd7a2b to
8e7eca9
Compare
f138e32 to
c98993f
Compare
8e7eca9 to
84ba68b
Compare
c98993f to
42a76db
Compare
crates/rpc/src/config/rpc_config.rs
Outdated
| default_gas_price: env.default_gas_price.or(defaults.default_gas_price), | ||
| ignore_price: env.ignore_price.or(defaults.ignore_price), | ||
| max_price: env.max_price.or(defaults.max_price), |
There was a problem hiding this comment.
Should these be non-optional in StorageRpcConfig now that we're setting defaults for the None cases?
There was a problem hiding this comment.
so there's a bit of an intent mismatch that we need to address here. some of these have "uncapped" behavior that we probably want to specify via a sentinel 0
setting a default value for the None case means these should be optional in the derive
There was a problem hiding this comment.
[Claude Code]
Good catch — the Option wrapping is intentional here because None has semantic meaning in the gas oracle: default_gas_price: None returns zero when no recent txs exist, ignore_price: None includes all tips (no floor), and max_price: None removes the cap.
The problem was that the From<StorageRpcConfigEnv> impl used .or(defaults.*), which meant the env path could never actually produce None — the defaults always filled in Some(...).
Fixed by adding a nonzero helper that maps 0 → None. The conversion now uses .map_or(default, nonzero), so:
- Env var unset → uses the default (
Some(1 Gwei),Some(2 wei),Some(500 Gwei)) - Env var set to 0 → disables the guardrail (
None) - Env var set to any other value → uses that value
Also added [default: ...] annotations to all FromEnv desc strings across StorageRpcConfigEnv, ServeConfigEnv, and HostRpcConfig so the behavior when unset is always documented.
…nfig Strip SignetNodeConfig of reth-coupled fields (static_path, http_port, ws_port, ipc_endpoint) and methods (static_file_ro/rw, chain_spec, spec_id). Remove reth, reth-chainspec, trevm, and signet-evm dependencies from Cargo.toml. Simplify test_utils to match the reduced API surface. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…t config Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Make ServeConfigEnv-to-ServeConfig conversion fallible (TryFrom) so that malformed SIGNET_HTTP_ADDR / SIGNET_WS_ADDR values surface an error instead of silently falling back to 0.0.0.0. Replace `ignore` doctest on HostRpcConfig with a compilable `no_run` example. Add rustdoc examples to StorageRpcConfigEnv and ServeConfigEnv. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
42a76db to
842b1f0
Compare
…le prices Address review feedback: the three gas oracle price fields (default_gas_price, ignore_price, max_price) now treat 0 as a sentinel to disable the guardrail (mapping to None), rather than silently overriding None with the default. All FromEnv desc strings across StorageRpcConfigEnv, ServeConfigEnv, and HostRpcConfig now document the default value or behavior when unset. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
[Claude Code]
Closes ENG-2078
Summary
reth,reth-chainspec,trevm,signet-evmdependencies fromsignet-node-configstatic_path,http_port,ws_port,ipc_endpoint) and methods (chain_spec(),spec_id(), static file accessors, port/ipc accessors)ServeConfigEnvwithFromEnvderive for env-based RPC transport configurationStorageRpcConfigEnvwithFromEnvderive for env-based RPC behavior configurationHostRpcConfigtosignet-host-rpcwithFromEnvderive for host RPC notifier configuration (provider URL, buffer capacity, backfill batch size)signet-node-teststo work with slimmedSignetNodeConfigContext
Part of the host context adapter refactor (ENG-2056). This ensures both
host-rethandhost-rpcmodes have a clean, unified configuration surface.signet-node-configis now reth-free —cargo tree -p signet-node-config | grep rethreturns nothing.PR stack
Stacks on #112 (blobber abstraction)
Test plan
cargo clippy --workspace --all-features --all-targets— cleancargo clippy -p signet-node-config --no-default-features --all-targets— cleancargo +nightly fmt— cleancargo t -p signet-node-config— 2 passedcargo t -p signet-rpc— 6 passedcargo t -p signet-host-rpc— 1 passed (1 ignored)cargo tree -p signet-node-config --depth 1 | grep reth— no output (zero reth deps)Review Fixes
ServeConfigEnv→ServeConfigconversion fallible (TryFrom) so malformedSIGNET_HTTP_ADDR/SIGNET_WS_ADDRreturns an error instead of silently falling back to0.0.0.0ignoredoctest onHostRpcConfigwith compilableno_runexampleStorageRpcConfigEnvandServeConfigEnvReviewed and updated by Claude Code.
🤖 Generated with Claude Code