Skip to content

refactor(node-config): remove reth deps, add FromEnv to RPC configs#113

Merged
prestwich merged 7 commits intodevelopfrom
prestwich/eng-2078-config-restructure
Mar 23, 2026
Merged

refactor(node-config): remove reth deps, add FromEnv to RPC configs#113
prestwich merged 7 commits intodevelopfrom
prestwich/eng-2078-config-restructure

Conversation

@prestwich
Copy link
Member

@prestwich prestwich commented Mar 20, 2026

[Claude Code]

Closes ENG-2078

Summary

  • Remove reth, reth-chainspec, trevm, signet-evm dependencies from signet-node-config
  • Remove dead fields (static_path, http_port, ws_port, ipc_endpoint) and methods (chain_spec(), spec_id(), static file accessors, port/ipc accessors)
  • Add ServeConfigEnv with FromEnv derive for env-based RPC transport configuration
  • Add StorageRpcConfigEnv with FromEnv derive for env-based RPC behavior configuration
  • Add HostRpcConfig to signet-host-rpc with FromEnv derive for host RPC notifier configuration (provider URL, buffer capacity, backfill batch size)
  • Fix signet-node-tests to work with slimmed SignetNodeConfig

Context

Part of the host context adapter refactor (ENG-2056). This ensures both host-reth and host-rpc modes have a clean, unified configuration surface. signet-node-config is now reth-free — cargo tree -p signet-node-config | grep reth returns nothing.

PR stack

Stacks on #112 (blobber abstraction)

Test plan

  • cargo clippy --workspace --all-features --all-targets — clean
  • cargo clippy -p signet-node-config --no-default-features --all-targets — clean
  • cargo +nightly fmt — clean
  • cargo t -p signet-node-config — 2 passed
  • cargo t -p signet-rpc — 6 passed
  • cargo 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

  • Make ServeConfigEnvServeConfig conversion fallible (TryFrom) so malformed SIGNET_HTTP_ADDR/SIGNET_WS_ADDR returns an error instead of silently falling back to 0.0.0.0
  • Replace ignore doctest on HostRpcConfig with compilable no_run example
  • Add rustdoc examples to StorageRpcConfigEnv and ServeConfigEnv

Reviewed and updated by Claude Code.

🤖 Generated with Claude Code

@prestwich prestwich requested a review from a team as a code owner March 20, 2026 17:42
@prestwich prestwich marked this pull request as draft March 20, 2026 18:19
@prestwich prestwich force-pushed the prestwich/eng-2077-blobber-abstraction branch from 1cd7a2b to 8e7eca9 Compare March 20, 2026 18:23
@prestwich prestwich force-pushed the prestwich/eng-2078-config-restructure branch from f138e32 to c98993f Compare March 20, 2026 18:31
@prestwich prestwich force-pushed the prestwich/eng-2077-blobber-abstraction branch from 8e7eca9 to 84ba68b Compare March 20, 2026 18:50
@prestwich prestwich force-pushed the prestwich/eng-2078-config-restructure branch from c98993f to 42a76db Compare March 20, 2026 18:51
Comment on lines +341 to +343
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),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should these be non-optional in StorageRpcConfig now that we're setting defaults for the None cases?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will fix in a second

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[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 0None. 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.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

prestwich and others added 6 commits March 23, 2026 13:12
…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>
@prestwich prestwich force-pushed the prestwich/eng-2078-config-restructure branch from 42a76db to 842b1f0 Compare March 23, 2026 17:12
@prestwich prestwich changed the base branch from prestwich/eng-2077-blobber-abstraction to develop March 23, 2026 17:12
@prestwich prestwich marked this pull request as ready for review March 23, 2026 17:12
@prestwich prestwich requested a review from Fraser999 March 23, 2026 17:13
…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>
@prestwich prestwich merged commit 375fd56 into develop Mar 23, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants