Skip to content

NC-12: the sole-owner sweep walks dig-wallet ONLY — dig-node-core is unguarded #366

Description

@MichaelTaylor3d

Task

Extend the NC-12 sole-owner sweep to cover dig-node-core. It currently walks dig-wallet/src only —
its own doc says so at sources.rs:580: "It walks dig-wallet/src ONLY."

Why

https://github.com/DIG-Network/dig_ecosystem/issues/2790's clause 2 requires that no path constructs its
own peer fabric outside the registry
. Measured against origin/main 4efa57fc, that holds in
production within dig-wallet
— the only non-test ChiaQuery::new is in sources.rs; fallback.rs:636
and service.rs:561 are both #[cfg(test)] (gate at service.rs:550).

Nothing covers dig-node-core. No live violation there today — its chia-peer light client was
removed (seams/chia_peer/mod.rs:13-23) — but it does hold an unregistered chain source, and
chain.rs:111 with_sources is dead, pub, and constructs peer_reads: None, i.e. an oracle-first
peak_height (#360).

A guard whose scope is narrower than the property it claims is the false-satisfaction class #2790 was
opened to end.
Right now the clause reads as enforced ecosystem-wide and is enforced in one crate.

What "extend" must mean here

The sweep is a line classifier over Rust source, and it took five gate rounds to make honest
within one crate (dig-node PR#354). Widening its haystack widens its blind spots. So:

  • Do not widen the heuristic. The durable artifact from those five rounds is the fail-closed flag
    (Swept { sites, ended_inside_a_test_item } — a return type that can say "I could not tell") plus an
    explicitly open enumeration of mis-read shapes. Preserve both when the scope grows.
  • Re-run the known-silent shapes against the new haystack: a column-0 #[cfg(test)] as string
    content, and a trailing comment on a column-0 terminator (} // done). rustfmt preserves both
    byte-for-byte, so cargo fmt --check suppresses neither. Confirm whether either occurs in
    dig-node-core — if one does, the guard is silent there on day one.
  • The doc must state the new scope truthfully. sources.rs:580 currently names its bound correctly;
    after this change it must name the new one just as precisely.

Also in scope

Decide chain.rs:111 with_sources alongside this — a dead but pub constructor that yields a
single-source transport is exactly what the sweep should refuse, and deleting it may be cheaper than
teaching the sweep to allow it. Coordinate with dig-node#360 rather than duplicating it.

Done condition

The sweep covers dig-node-core as well as dig-wallet, its doc states the new scope exactly, the
fail-closed flag still refuses on an unreadable file, and a deliberately-introduced second fabric in
dig-node-core makes it fail — demonstrated, not asserted.

Context

Effort

Medium — the widening is small; keeping the guard honest across a second crate is the work.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions