Repository navigation
Description
Surfaced while fixing #1289 (doc rot in crates/node/src/dht/origin.rs). Filing separately since it is a behavior question, not a docs one.
What
ConfigOriginDirectory is documented as the operator-supplied fallback for the OriginDirectory trait — the old module doc said it "reads from operator-supplied TOML for testnet bring-up" and referenced a dht.static_origins config key.
That config key does not exist. grep -rn static_origins crates/ hits only doc comments and one unrelated NOTE at crates/node/src/node_origin.rs:1210. There is no such field in the config schema, resolver, or example TOML.
Consequently the runtime's fallback arm at crates/node/src/runtime/mod.rs:729-731 always constructs it empty:
_ => Arc::new(crate::dht::origin::ConfigOriginDirectory::new(
std::collections::HashMap::new(),
)),So on any node where blockchain.origin_assignment_address or blockchain.publisher_registry_address is unset, every origin-directory lookup returns empty — lookup_origins yields nothing and has_origin is always false. ConfigOriginDirectory has no production path that can populate it; outside tests it is an empty stub.
Why it matters
The DHT origin-directory fallback (ADR 022 §FIND_VALUE Flow "Origin discovery", §Bootstrap "the on-chain origin directory provides the deterministic fallback") is silently inert on non-chain-configured nodes. The prefetch authorized-origin gate consumes has_origin (ADR 022 §Prefetch Decision), so it also sees a uniformly-empty directory there.
Whether that is wrong depends on intent, which is the decision this issue needs.
The decision
- Intended — no chain config means no origin directory, and the empty fallback is the correct degenerate case. Then
ConfigOriginDirectoryis a test-only type and should say so; consider moving it behind#[cfg(test)]or renaming it so it stops reading as an operator-facing surface. - A gap — operators were meant to be able to hand-curate a hash → origin-NodeId map for bring-up, and the config plumbing was simply never built. Then add the
dht.static_originsfield (schema + resolver + validation + example) and wire it into the fallback arm.
Option 1 looks more likely given ChainOriginDirectory has since landed and is the production path, but the ADR 022 language about a "deterministic fallback" points the other way, so it wants an explicit call.
Refs
crates/node/src/dht/origin.rs— trait +ConfigOriginDirectorycrates/node/src/runtime/mod.rs:700-731— the selection between chain-backed and fallback- docs(node): dht/origin.rs module doc still says ChainOriginDirectory doesn't exist #1289 / docs(node): describe both OriginDirectory impls in dht/origin.rs #1290 — the doc fix that surfaced this (docs now describe actual behavior; no code change)
Activity
altanoruc commentedon Jul 20, 2026
Automated triage note for a later run: please decide whether the empty non-chain fallback is intentional or missing config plumbing. The former implies making ConfigOriginDirectory clearly test-only or renaming/removing the production-looking surface; the latter implies a concrete dht.static_origins schema and runtime wiring.
refactor(node): name the empty origin-directory fallback + warn on ar…