Skip to content

PRIV-601: anonymous transaction lane only by default from v0.9.0, and a first-spy test in process - #180

Merged
dendisuhubdy merged 2 commits into
mainfrom
feat/i27-anonymous-lane-default
Nov 18, 2026
Merged

dendisuhubdy merged 2 commits into
mainfrom
feat/i27-anonymous-lane-default

Conversation

@dendisuhubdy

Copy link
Copy Markdown
Member

Tracks randprotocol/monorepo#27

Kind: network (gossip topics), no consensus change, no flag day. Nothing changes on a v0.8.x build; the default flips with the version bump to v0.9.0, and a v0.9.0 node interoperates with every node since v0.8.3.

What main already does

  • A node publishes its own transactions on the anonymous lane only; the signed legacy copy is opt-in (--legacy-tx-publish, v0.8.5).
  • It still subscribes to and relays the legacy topic unless --anonymous-tx-only, which no unit sets.
  • The first-spy measurement was never repeated, in process or on the fleet.

What this adds

  • network::anonymous_tx_only(flag, keep_legacy, version): before v0.9.0 the legacy topic is kept unless --anonymous-tx-only; from v0.9.0 it is left unless --legacy-tx-relay (new flag) or --legacy-tx-publish. The node reads its own version, as RPC-201: refuse rand_getScanLeaves by default from v0.9.0, by the node's own version #179 does for rand_getScanLeaves, so no unit needs a flag and nothing needs editing at the bump. An unreadable version takes the private default.
  • tests/dandelion.rs::a_first_spy_names_the_submitter_without_dandelion_and_rarely_with_it: five real nodes on loopback plus an observer connected to all of them that records the first forwarder of each transaction and the lane of each copy. Control (Dandelion off): the observer must name the submitter for at least 8 of 10. Dandelion on at the defaults, nodes 1 and 3 anonymous-only (the v0.9.0 default) and the rest on both lanes (v0.8.x): at most 10 of 20, every mempool gets every transaction, and no copy reaches the observer on the signed topic in either run.
  • docs/deploy.md, docs/cli.md, docs/architecture.md: the v0.9.0 step, the new flag, what the in-process test shows and does not, and what the fleet run must record.

Rolling upgrade

A v0.9.0 node drops only the legacy rand/<chain>/tx subscription. v0.8.3–v0.8.6 peers publish and relay every transaction on tx/2 as well, so nothing is lost in either direction (the mixed-lane fleet in the new test). A node from before v0.8.3 would stop hearing v0.9.0 nodes' relays over gossip (it still gets transactions in blocks); --legacy-tx-relay is for a chain that has one.

Tests

Local (macOS, debug):

cargo test -p randprotocol-node --test dandelion -- --nocapture --test-threads=1
first spy, dandelion off: the spy named the submitter for 10/10; the submitter itself published 10/10; unheard by the spy 0; copies on the signed legacy topic 0
first spy, dandelion on (q = 0.1, b = 3 s): the spy named the submitter for 1/20; the submitter itself published 1/20; unheard by the spy 0; copies on the signed legacy topic 0
test result: ok. 5 passed; 0 failed

The two new unit tests (network::tests::the_legacy_transaction_topic_is_left_by_default_from_v0_9_0, the extended the_legacy_signed_copy_is_opt_in) were type-checked locally (cargo check -p randprotocol-node --tests) and run in CI's library suites.

What remains

  • The fleet first-spy run (owner; needs hosts). docs/deploy.md now lists what to record. Until then origin hiding on chain 21 stays design intent.
  • Five loopback nodes are not the fleet: no link delay, and a stem among five nodes ends back at its submitter about one time in five.
  • Before v0.9.0, --anonymous-tx-only stays a per-host choice; nothing here sets it on a unit.

Changelog line

  • From v0.9.0 a node gossips transactions on the anonymous lane only by default (PRIV-601; network only, no consensus change): the default follows the node's own version — a v0.8.x node still subscribes and relays on the legacy signed topic unless --anonymous-tx-only, a v0.9.0 node leaves it unless the new --legacy-tx-relay (or --legacy-tx-publish). Interoperates with every node since v0.8.3. tests/dandelion.rs now runs a first-spy measurement in process; the fleet run is still to be recorded, so origin hiding on chain 21 remains design intent.

🤖 Generated with Claude Code

https://claude.ai/code/session_01YGaYNQ4cvFtg2UmokVgrAN

dendisuhubdy and others added 2 commits November 18, 2026 13:28
…0.9.0, and a first-spy test in process

A node reads its own version for the default: a v0.8.x node still subscribes
and relays on the legacy signed topic, a node of v0.9.0 or later gossips
transactions on the anonymous lane only. --legacy-tx-relay (new) or
--legacy-tx-publish keeps the topic on such a release; --anonymous-tx-only
leaves it on any release. Every node since v0.8.3 speaks the anonymous lane,
so the two defaults interoperate and the release rolls host by host.

tests/dandelion.rs gains the first-spy measurement in process: an observer
connected to all five nodes guesses each transaction's origin as the peer that
first forwarded it. Without Dandelion it must name the submitter for at least
8 of 10; with it, over a fleet mixing anonymous-only and both-lane nodes, for
at most 10 of 20; no copy may reach it on the signed topic.

docs/deploy.md says what the in-process test shows and what it does not, and
what the fleet run has to record.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YGaYNQ4cvFtg2UmokVgrAN
Other tests start a node on the default lanes with it.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YGaYNQ4cvFtg2UmokVgrAN
@codecov

codecov Bot commented Nov 18, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@dendisuhubdy
dendisuhubdy merged commit 12aa2e4 into main Nov 18, 2026
18 of 23 checks passed
@dendisuhubdy
dendisuhubdy deleted the feat/i27-anonymous-lane-default branch November 18, 2026 09:01
dendisuhubdy added a commit that referenced this pull request Nov 18, 2026
… Unreleased (#192)

Each entry is the PR's own "Changelog line" section, which the PRs kept out of CHANGELOG.md so they would not conflict with each other: #173, #174, #176–#180, #183, #185–#188 (#175 is test-only and has none).


Claude-Session: https://claude.ai/code/session_01YGaYNQ4cvFtg2UmokVgrAN

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant