Skip to content

mirror/advertise.rs still carries its own is_globally_routable — the on-chain gate accepts 192.88.99.0/24 that dig-stun's reconciled table refuses #572

Description

@MichaelTaylor3d

mirror/advertise.rs still carries is_globally_routable — the exact rival dig-stun was built to replace

Found by the dig-node#566 lane while adopting dig_stun::establish. Reported rather than fixed, correctly: the PR was already a security-gated change to the on-chain establishment path, and folding a predicate swap into it would have widened a diff that needed narrow scrutiny.

dig-stun's own SPEC.md names this exact pair as one of the two tables it was created to unify. So this is not a newly-noticed duplication — it is the last unclosed half of the consolidation.

Current state

dig-node mirror/advertise.rs is_globally_routable / _v4 / _v6still local
dig-stun scope is_globally_routable — the reconciled union, published 0.2.0
dig-relay adopted (0.20.1) — its codec deleted, byte-identity proven
dig-nat still local — blocked, see below

Why this one matters more than an ordinary duplicate

This predicate is the gate on what gets written to a mirror coin. The two tables already disagree, and the disagreement runs the dangerous direction:

  • 192.88.99.0/24 (deprecated 6to4 anycast) — refused by dig-nat's dial guard, ACCEPTED by dig-node's on-chain advertisement gate. The stricter tier had the hole.
  • 192.0.0.0/24, 2001:2::/48, 100::/64 — accepted by dig-nat's dial guard, NeverDialable in the reconciled table.

So a node can currently advertise a 192.88.99.x address on chain, with collateral behind it, that the rest of the stack would refuse to dial. Adopting dig_stun::scope closes that, and it is the only behaviour change in the swap — everything else is mechanical.

What "done" looks like

Replace the local predicate with dig_stun::scope::is_globally_routable and delete the local copies. Name the 192.88.99.0/24 change explicitly in the PR — it is a real behaviour change on the money path and must not ride in as a refactor.

Add a regression test that 192.88.99.1 is refused for advertisement. Without it, nothing prevents the local table being reintroduced later by someone who wants "one fewer dependency".

Sequencing

dig-node #571 (0.254.85) is in flight and touches mirror/advertise.rs directly. Single-writer — this waits for that merge.

dig-nat's adoption (the other half of #3204) is likewise blocked behind it, since dig-node consumes dig_nat::stun. Both can then proceed, and dig-nat's re-export means dig-node needs no further change for the codec half — only this predicate swap.

Related

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind:maintenancereal work that changes nothing a user can perceive

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions