Repository navigation
Description
Problem
The node/CLI config schema is currently written out in full in at least five independent, partially-divergent places. There's no single source of truth, so every schema change (new key, renamed section) has to be mirrored by hand across all copies — and some copies have already drifted stale.
Enumeration of the divergent copies:
crates/cli/src/commands/config.rs—const DEFAULT_CONFIG: &str(~L415-564). The canonical, fully-commented template written bydecdn config init. Covers every section.examples/configs/arbitrum-sepolia.toml+examples/configs/arbitrum-sepolia-client.toml— concrete Arbitrum Sepolia testnet values (real genesis addresses, MUST-EDIT markers). Separate hand-maintained copies of the node + client schema subsets.crates/e2e/src/node.rs—fn render_config()(~L554-604) builds a fullnode.tomlviaformat!. Another full copy used by the e2e harness.crates/cli/tests/config_validate.rs—VALID_CONFIG/MISSING_RPC/MULTI_ERRORfixture strings +sample_resolved()struct literal.adr/012-client.md(~L172-199) — a client "Default configuration" block that is stale: it uses[network] rpc_url,[bootstrap],[keys] iroh_key_path/eth_keystore_path,[cache] probe_cache_*— key/section names that no longer match the real schema (e.g.rpc_urllives under[blockchain]). This one actively contradictsDEFAULT_CONFIG.
Additional smaller config snippets exist in CHANGELOG.md (origin migration + S3/R2/MinIO examples), adr/011-content-takedown.md ([content] denylist), and various node reload/sighup tests — those are illustrative and lower priority.
Why this matters
Per the workspace SoT rule, divergence like adr/012-client.md is exactly the failure mode we try to avoid: a doc that contradicts the implementation. Each new config knob today is a "touch 5 sites" chore, and it's easy to miss one.
Proposed direction (to be brainstormed)
Establish DEFAULT_CONFIG (or a shared example asset it's derived from) as the single source, and have the other copies either derive from it or be verified against it:
- Examples (
examples/configs/*.toml): add a test that parses each example file through the real config resolver, so a schema change that breaks an example fails CI instead of silently drifting. - e2e
render_config(): consider generating fromDEFAULT_CONFIG(parse → override the fields the harness needs → re-serialize) rather than maintaining a parallelformat!template. adr/012-client.md: fix the stale block now (or replace it with a link to the canonical example), independent of the larger refactor.- Optionally: a round-trip test asserting
DEFAULT_CONFIGitself parses + validates (guards the canonical copy).
Exact mechanism is open — the goal is that there is one place to edit and everything else is checked against it.
Acceptance criteria
- A single canonical source for the example/default config is identified/established.
- Example config files under
examples/configs/are validated against the real schema in CI. - The stale
adr/012-client.mdconfig block is corrected or replaced with a pointer to the canonical example. - Adding a new config knob no longer requires hand-editing multiple full-config copies (or, where copies must remain, CI catches drift).
Metadata
Metadata
Assignees
Labels
Type
Fields
Priority
Activity
fix: config single-source-of-truth doc + CI-aware anvil-e2e deploy ti…