Skip to content

node: ConfigOriginDirectory has no way to be populated — the non-chain fallback is always empty #1292

Closed

Description

@yigitdot

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

  1. Intended — no chain config means no origin directory, and the empty fallback is the correct degenerate case. Then ConfigOriginDirectory is 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.
  2. 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_origins field (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

Activity

  1. added
    rust
    on Jul 18, 2026
  2. altanoruc commented on Jul 20, 2026

    @altanoruc
    Contributor

    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.

  3. self-assigned this
    on Jul 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

rust

Type

No type

Fields

Priority

None yet

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions