WIP: Reimplement private broadcast as node state-less jobs + package relay support #36608

Closed
instagibbs wants to merge 35 commits from privbcast-4-package into master AGit
instagibbs commented 2026-10-22 14:47:27 +00:00 (Migrated from github.com)

Goals

Goal 1: Remove reliance on, and probes about, internal node state from private broadcast

Goal 2: Specify observable behavior to aid reimplementation and reduce profile fingerprints across versions

Layout

Four parts, each starting with an empty marker commit:

  1. support: moves shared code into the common library; no behavior change
  2. bitcoin-privbcast: the specification and the standalone tool
  3. bitcoind -privatebroadcast as jobs: the node runs the tool's job; the old relay and connections are removed
  4. package mode: one parent and its child. Its validation commits (saturating fee sum, test-accept as submission, self-paying parent) serve only this part.

For the v33 release, I think 1 through 3 should be the goal, but the roadmap could be trimmed down to remove tool-only code if the conceptual support for the standalone tool is not there.

The tool itself introduces about 600 loc of logic, and also necessitates some of the prep move-only commits putting things in common. The vast majority is the shared Job machinery.

Node-less state

The primary failure mode of the in-master private broadcast is that it relies on node state for operation, and this has led to a number of "careful coding" fixes:

  1. The v2->v1 retry connected directly, without the proxy: #35319 (merged in #35410)
  2. Discouraging a misbehaving peer gave a clearnet oracle: #36312
  3. Eager job completion via mempool inspection: #36277
  4. Private broadcast connections wrote to addrman: #35032

There are many other sources of fingerprints as well, some harder than others to exploit, and to fix. The solution: remove reliance on node state entirely to drive attempts. The spec states the goals as:

  • A job reveals neither the sender's IP address, onion address nor node identity to any party.
  • A hostile recipient, DNS seed or Tor exit learns no more than an honest one. It can only affect delivery.

Jobs, slots and opportunities

  • Job: one broadcast of one transaction, from submission to its report. A job spends its first 12 s finding candidates (IPv4/IPv6 addresses from the DNS seeds, resolved through Tor exits), then delivers. It runs for at most 10 min.
  • Slot: one of a job's 6 independent delivery targets. Each slot tries to announce the transaction to one peer and serve it when asked. Slots 0–2 open when delivery starts; slot 3 opens 35–180 s later; slots 4–5 open 185–240 s later, at least 5 s apart. Each of these times is drawn at random within its range.
  • Opportunity: one of a slot's 4 scheduled connection times: a first attempt and up to 3 fallbacks, each 50–60 s after the previous. A fallback runs only if the slot's previous attempt failed before announcing; once a slot announces, its remaining opportunities are dropped.

The times are drawn at job start, and each opportunity's candidate is fixed when discovery ends, before any peer is contacted. Nothing a peer does moves them (C1–C4). A job makes at most 24 connections, at most 6 of them at once.

Differences at a glance

master this PR
Where it runs Inside bitcoind only bitcoind -privatebroadcast, or the standalone bitcoin-privbcast with no node; the same job either way (U3), with a JSON report of every connection
Recipients addrman.Select() over onion, I2P, and IPv4/IPv6 through the proxy; networks follow -onlynet DNS seed names resolved through Tor exits (RESOLVE), IPv4/IPv6 only; no node state used (R1, R6)
Connections CConnman peers of type PRIVATE_BROADCAST, visible in getpeerinfo The job's own proxy streams, each with fresh SOCKS credentials, so each gets its own circuit; not peers of the node
Plan 3 connections, then more whenever the tx is stale (5 min, then 1 min) until it comes back from the network 6 slots of 4 opportunities, all scheduled at job start; no retries; at most 10 min
Transport v2 when addrman advertises it, otherwise v1, with a v2→v1 retry BIP324 v2 only, with one constant VERSION per release (B4, E1)
Node settings Shape which networks and peers are used Peer-selection settings don't apply to jobs (U2)
Packages — submitpackage with one parent and one child: announce the child, serve the parent on request

No addrman

Under master, the node's private broadcast destinations are drawn from the node's addrman. Other parties write to that table through addr gossip, which makes it a unique fingerprint vector, and inherently attacker influenced. This rules out drawing recipients from anything the node or its peers can write to.

Its replacement is querying DNS seeds in a predetermined way under a static profile. This is inherently less robust than the p2p network in terms of liveness, but leaves no fingerprint within a release. The marginal fingerprint is the set of DNS seeds per release, which affects who is queried and exactly how. Each RESOLVE returns one address and exits cache answers, so each seed is asked through several exits: 4 Tor circuits, each querying all 7 seeds, for up to 28 results, which are assigned to the 6x4 opportunities before any dialing happens. A circuit per query, 28 in all, kept Tor busy enough that overlapping discoveries lost answers.

If the list shrinks, grows, or is modified, the release is revealed to the Tor exits carrying the queries, which see every seed name queried. A DNS seed learns only that it is on the list, and only when the exit has no cached answer.

The fingerprint potential also precludes fixed seeds, which change greatly each release, and which degrade in connectivity over time regardless.

Minimal release fingerprint

Once a release is cut, behavior profiles are intended to be identical per user. This precludes user knobs and per-instance parameters, and requires a constant user agent and VERSION.

Across releases, the reimplemented p2p message state machine allows better control of unnecessary profile breaks going forward.

Specification

doc/design/private-broadcast-tool.md comes before any code in part 2. It has goals, a threat model per party (recipient, exit, seed, network observer, guard), 54 numbered invariants (A–U, N), parameters, interface, assumptions, non-goals and a rationale. Code comments and tests cite the invariant IDs, so review can check code against a stated property. Concept review of the goals, threat model and non-goals is most useful first, then review of the implementation against the invariants.

This implementation is actually the second implementation, initially implemented solely via the spec and black box tests, which were handed to an otherwise blind agent.

Tradeoffs

  • Needs Tor, including Tor's RESOLVE extension. I2P is gone, and so are onion recipients. To re-add these, we need a connect->GETADDR step, and then have to filter out most of the addresses that do not answer when dialed.
  • DNS seeds and Tor exits learn that a job ran, in addition to end recipients.
  • No retries beyond the scheduled fallbacks. Retrying would act on whether the transaction comes back, which the adversary controls; the user resubmits instead.
  • getprivatebroadcastinfo now reports jobs, and the connections no longer show in getpeerinfo.
## Goals Goal 1: Remove reliance on, and probes about, internal node state from private broadcast Goal 2: Specify observable behavior to aid reimplementation and reduce profile fingerprints across versions ### Layout Four parts, each starting with an empty marker commit: 1. support: moves shared code into the common library; no behavior change 2. bitcoin-privbcast: the specification and the standalone tool 3. bitcoind -privatebroadcast as jobs: the node runs the tool's job; the old relay and connections are removed 4. package mode: one parent and its child. Its validation commits (saturating fee sum, test-accept as submission, self-paying parent) serve only this part. For the v33 release, I think 1 through 3 should be the goal, but the roadmap could be trimmed down to remove tool-only code if the conceptual support for the standalone tool is not there. The tool itself introduces about 600 loc of logic, and also necessitates some of the prep move-only commits putting things in common. The vast majority is the shared Job machinery. ## Node-less state The primary failure mode of the in-master private broadcast is that it relies on node state for operation, and this has led to a number of "careful coding" fixes: 1. The v2->v1 retry connected directly, without the proxy: #35319 (merged in #35410) 2. Discouraging a misbehaving peer gave a clearnet oracle: #36312 3. Eager job completion via mempool inspection: #36277 4. Private broadcast connections wrote to addrman: #35032 There are many other sources of fingerprints as well, some harder than others to exploit, and to fix. The solution: remove reliance on node state entirely to drive attempts. The spec states the goals as: - A job reveals neither the sender's IP address, onion address nor node identity to any party. - A hostile recipient, DNS seed or Tor exit learns no more than an honest one. It can only affect delivery. ### Jobs, slots and opportunities - **Job**: one broadcast of one transaction, from submission to its report. A job spends its first 12 s finding candidates (IPv4/IPv6 addresses from the DNS seeds, resolved through Tor exits), then delivers. It runs for at most 10 min. - **Slot**: one of a job's 6 independent delivery targets. Each slot tries to announce the transaction to one peer and serve it when asked. Slots 0–2 open when delivery starts; slot 3 opens 35–180 s later; slots 4–5 open 185–240 s later, at least 5 s apart. Each of these times is drawn at random within its range. - **Opportunity**: one of a slot's 4 scheduled connection times: a first attempt and up to 3 fallbacks, each 50–60 s after the previous. A fallback runs only if the slot's previous attempt failed before announcing; once a slot announces, its remaining opportunities are dropped. The times are drawn at job start, and each opportunity's candidate is fixed when discovery ends, before any peer is contacted. Nothing a peer does moves them (C1–C4). A job makes at most 24 connections, at most 6 of them at once. ### Differences at a glance | | master | this PR | |---|---|---| | Where it runs | Inside `bitcoind` only | `bitcoind -privatebroadcast`, or the standalone `bitcoin-privbcast` with no node; the same job either way (U3), with a JSON report of every connection | | Recipients | `addrman.Select()` over onion, I2P, and IPv4/IPv6 through the proxy; networks follow `-onlynet` | DNS seed names resolved through Tor exits (RESOLVE), IPv4/IPv6 only; no node state used (R1, R6) | | Connections | `CConnman` peers of type `PRIVATE_BROADCAST`, visible in `getpeerinfo` | The job's own proxy streams, each with fresh SOCKS credentials, so each gets its own circuit; not peers of the node | | Plan | 3 connections, then more whenever the tx is stale (5 min, then 1 min) until it comes back from the network | 6 slots of 4 opportunities, all scheduled at job start; no retries; at most 10 min | | Transport | v2 when addrman advertises it, otherwise v1, with a v2→v1 retry | BIP324 v2 only, with one constant VERSION per release (B4, E1) | | Node settings | Shape which networks and peers are used | Peer-selection settings don't apply to jobs (U2) | | Packages | — | `submitpackage` with one parent and one child: announce the child, serve the parent on request | ### No addrman Under master, the node's private broadcast destinations are drawn from the node's addrman. Other parties write to that table through addr gossip, which makes it a unique fingerprint vector, and inherently attacker influenced. This rules out drawing recipients from anything the node or its peers can write to. Its replacement is querying DNS seeds in a predetermined way under a static profile. This is inherently less robust than the p2p network in terms of liveness, but leaves no fingerprint within a release. The marginal fingerprint is the set of DNS seeds per release, which affects who is queried and exactly how. Each RESOLVE returns one address and exits cache answers, so each seed is asked through several exits: 4 Tor circuits, each querying all 7 seeds, for up to 28 results, which are assigned to the 6x4 opportunities before any dialing happens. A circuit per query, 28 in all, kept Tor busy enough that overlapping discoveries lost answers. If the list shrinks, grows, or is modified, the release is revealed to the Tor exits carrying the queries, which see every seed name queried. A DNS seed learns only that it is on the list, and only when the exit has no cached answer. The fingerprint potential also precludes fixed seeds, which change greatly each release, and which degrade in connectivity over time regardless. ### Minimal release fingerprint Once a release is cut, behavior profiles are intended to be identical per user. This precludes user knobs and per-instance parameters, and requires a constant user agent and VERSION. Across releases, the reimplemented p2p message state machine allows better control of unnecessary profile breaks going forward. ### Specification `doc/design/private-broadcast-tool.md` comes before any code in part 2. It has goals, a threat model per party (recipient, exit, seed, network observer, guard), 54 numbered invariants (A–U, N), parameters, interface, assumptions, non-goals and a rationale. Code comments and tests cite the invariant IDs, so review can check code against a stated property. Concept review of the goals, threat model and non-goals is most useful first, then review of the implementation against the invariants. This implementation is actually the second implementation, initially implemented solely via the spec and black box tests, which were handed to an otherwise blind agent. ### Tradeoffs - Needs Tor, including Tor's RESOLVE extension. I2P is gone, and so are onion recipients. To re-add these, we need a connect->GETADDR step, and then have to filter out most of the addresses that do not answer when dialed. - DNS seeds and Tor exits learn that a job ran, in addition to end recipients. - No retries beyond the scheduled fallbacks. Retrying would act on whether the transaction comes back, which the adversary controls; the user resubmits instead. - `getprivatebroadcastinfo` now reports jobs, and the connections no longer show in `getpeerinfo`.
DrahtBot commented 2026-10-22 14:47:41 +00:00 (Migrated from github.com)

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

External sites

Reviews

See the guideline and AI policy for information on the review process.
A summary of reviews will appear here.

Conflicts

Reviewers, this pull request conflicts with the following ones:

  • #36628 (net: reimplement private broadcast as jobs isolated from the node by instagibbs)
  • #36607 (private broadcast: Extra guard against unintended non-private broadcast of private transactions by optout21)
  • #36597 (wallet: return broadcast errors from CommitTransaction by pseudoramdom)
  • #36566 (private broadcast: wait synchronously for mempool acceptance by andrewtoth)
  • #36521 (Keep witness stacks in serialized form in CScriptWitness by sipa)
  • #36477 (private broadcast: show finished transactions in getprivatebroadcastinfo by vasild)
  • #36429 ([RFC] Delayed transaction broadcast, minimal by optout21)
  • #36170 (net: require a dedicated bind for automatic Tor by l0rinc)
  • #36098 (fuzz: add corpus reachability checks by HowHsu)
  • #36074 (scripted-diff: [test] Add util/check.h includes for assertions by maflcko)
  • #36002 (txindex: allow running in pruned mode by andrewtoth)
  • #35888 (net: reject oversized outbound messages by l0rinc)
  • #35858 (doc: Add privacy.md consolidating network privacy recommendations by pablomartin4btc)
  • #35713 (Remove boost as a unit test runner by rustaceanrob)
  • #35558 (p2p: Prefill compact blocks by davidgumberg)
  • #35511 (RFC: consensus: Make CAmount a class by hodlinator)
  • #35286 (rpc: add testsubmitpackage for 1p1c test submissions by instagibbs)
  • #35027 (net: add -outboundbind option for outgoing source address by 8144225309)
  • #33922 (mining: add getMemoryLoad() and track template non-mempool memory footprint by Sjors)
  • #30951 (net: option to disallow v1 connection on ipv4 and ipv6 peers by stratospher)
  • #30437 (ipc: add bitcoin-mine test program by ryanofsky)
  • #29418 (rpc: provide per message stats for global traffic via new field in 'getnettotals' by vasild)

If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

LLM Linter (✨ experimental)

Possible places where named args for integral literals may be used (e.g. func(x, /*named_arg=*/0) in C++, and func(x, named_arg=0) in Python):

  • src/test/privbcast_queue_tests.cpp: CreateValidMempoolTransaction(m_coinbase_txns[0], 0, 0, coinbaseKey, script, 49 * COIN, false)
  • src/test/privbcast_queue_tests.cpp: CreateValidMempoolTransaction(m_coinbase_txns[1], 0, 0, coinbaseKey, script, 49 * COIN, false)
  • src/test/privbcast_queue_tests.cpp: CreateValidMempoolTransaction(m_coinbase_txns[1], 0, 0, coinbaseKey, script, 48 * COIN, false)
  • src/test/privbcast_queue_tests.cpp: CreateValidMempoolTransaction(m_coinbase_txns[2], 0, 0, coinbaseKey, script, 49 * COIN, false)
  • src/test/privbcast_queue_tests.cpp: CreateValidMempoolTransaction(parent, 0, 0, coinbaseKey, script, 48 * COIN, false)
  • src/test/txpackage_tests.cpp: CreateValidMempoolTransaction(m_coinbase_txns[0], 0, 0, coinbaseKey, parent_spk, coinbase_value - 10'000)
  • src/test/txpackage_tests.cpp: CreateValidMempoolTransaction(m_coinbase_txns[0], 0, 0, coinbaseKey, parent_spk, coinbase_value - 100'000, false)
  • src/test/txpackage_tests.cpp: CreateValidMempoolTransaction(m_coinbase_txns[1], 0, 0, coinbaseKey, parent_spk, coinbase_value - 10'000)
  • src/test/txpackage_tests.cpp: CreateValidMempoolTransaction(m_coinbase_txns[2], 0, 0, coinbaseKey, parent_spk, coinbase_value - 10'000, false)
  • src/test/txpackage_tests.cpp: CreateValidMempoolTransaction(m_coinbase_txns[3], 0, 0, coinbaseKey, parent_spk, coinbase_value - 10'000)
  • src/test/txpackage_tests.cpp: CreateValidMempoolTransaction(m_coinbase_txns[3], 0, 0, coinbaseKey, parent_spk, coinbase_value - 100'000, false)
  • src/test/txpackage_tests.cpp: CreateValidMempoolTransaction(tx, 0, 101, parent_key, child_spk, value, false)

Possible places where comparison-specific test macros should replace generic comparisons:

  • test/functional/tool_privbcast_package.py: assert a["parent_hold_expired_ms"] is not None and a["parent_getdata_ms"] is None → Prefer assert_equal(a["parent_getdata_ms"], None) for the is None comparison.
  • test/functional/tool_privbcast_package.py: assert a["parent_getdata_ms"] is None and a["parent_hold_expired_ms"] is not None → Prefer assert_equal(a["parent_getdata_ms"], None) for the is None comparison.
  • test/functional/tool_privbcast_package.py: assert a["getdata_ms"] is None and a["tx_written_ms"] is None → Prefer assert_equal(..., None) for each comparison.

2026-10-22 17:41:53

<!--e57a25ab6845829454e8d69fc972939a--> The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. <!--006a51241073e994b41acfe9ec718e94--> ### External sites * Code coverage & benchmarks: https://corecheck.dev/bitcoin/bitcoin/pulls/36608 * Ralph review <img src=https://review.fish.foo/assets/bitcoin/bitcoin/36608.png alt="Ralph review status"> https://git.fish.foo/bitcoin/bitcoin/pulls/36608#author-ralph <!--021abf342d371248e50ceaed478a90ca--> ### Reviews See [the guideline](https://github.com/bitcoin/bitcoin/blob/master/CONTRIBUTING.md#code-review) and [AI policy](https://github.com/bitcoin/bitcoin/blob/master/doc/AI_POLICY.md) for information on the review process. A summary of reviews will appear here. <!--174a7506f384e20aa4161008e828411d--> ### Conflicts Reviewers, this pull request conflicts with the following ones: * [#36628](https://github.com/bitcoin/bitcoin/pull/36628) <sub><img src="https://drahtbot.space/ack_count/bitcoin/bitcoin/36628.svg"></sub> (net: reimplement private broadcast as jobs isolated from the node by instagibbs) * [#36607](https://github.com/bitcoin/bitcoin/pull/36607) <sub><img src="https://drahtbot.space/ack_count/bitcoin/bitcoin/36607.svg"></sub> (private broadcast: Extra guard against unintended non-private broadcast of private transactions by optout21) * [#36597](https://github.com/bitcoin/bitcoin/pull/36597) <sub><img src="https://drahtbot.space/ack_count/bitcoin/bitcoin/36597.svg"></sub> (wallet: return broadcast errors from CommitTransaction by pseudoramdom) * [#36566](https://github.com/bitcoin/bitcoin/pull/36566) <sub><img src="https://drahtbot.space/ack_count/bitcoin/bitcoin/36566.svg"></sub> (private broadcast: wait synchronously for mempool acceptance by andrewtoth) * [#36521](https://github.com/bitcoin/bitcoin/pull/36521) <sub><img src="https://drahtbot.space/ack_count/bitcoin/bitcoin/36521.svg"></sub> (Keep witness stacks in serialized form in CScriptWitness by sipa) * [#36477](https://github.com/bitcoin/bitcoin/pull/36477) <sub><img src="https://drahtbot.space/ack_count/bitcoin/bitcoin/36477.svg"></sub> (private broadcast: show finished transactions in getprivatebroadcastinfo by vasild) * [#36429](https://github.com/bitcoin/bitcoin/pull/36429) <sub><img src="https://drahtbot.space/ack_count/bitcoin/bitcoin/36429.svg"></sub> ([RFC] Delayed transaction broadcast, minimal by optout21) * [#36170](https://github.com/bitcoin/bitcoin/pull/36170) <sub><img src="https://drahtbot.space/ack_count/bitcoin/bitcoin/36170.svg"></sub> (net: require a dedicated bind for automatic Tor by l0rinc) * [#36098](https://github.com/bitcoin/bitcoin/pull/36098) <sub><img src="https://drahtbot.space/ack_count/bitcoin/bitcoin/36098.svg"></sub> (fuzz: add corpus reachability checks by HowHsu) * [#36074](https://github.com/bitcoin/bitcoin/pull/36074) <sub><img src="https://drahtbot.space/ack_count/bitcoin/bitcoin/36074.svg"></sub> (scripted-diff: [test] Add util/check.h includes for assertions by maflcko) * [#36002](https://github.com/bitcoin/bitcoin/pull/36002) <sub><img src="https://drahtbot.space/ack_count/bitcoin/bitcoin/36002.svg"></sub> (txindex: allow running in pruned mode by andrewtoth) * [#35888](https://github.com/bitcoin/bitcoin/pull/35888) <sub><img src="https://drahtbot.space/ack_count/bitcoin/bitcoin/35888.svg"></sub> (net: reject oversized outbound messages by l0rinc) * [#35858](https://github.com/bitcoin/bitcoin/pull/35858) <sub><img src="https://drahtbot.space/ack_count/bitcoin/bitcoin/35858.svg"></sub> (doc: Add privacy.md consolidating network privacy recommendations by pablomartin4btc) * [#35713](https://github.com/bitcoin/bitcoin/pull/35713) <sub><img src="https://drahtbot.space/ack_count/bitcoin/bitcoin/35713.svg"></sub> (Remove boost as a unit test runner by rustaceanrob) * [#35558](https://github.com/bitcoin/bitcoin/pull/35558) <sub><img src="https://drahtbot.space/ack_count/bitcoin/bitcoin/35558.svg"></sub> (p2p: Prefill compact blocks by davidgumberg) * [#35511](https://github.com/bitcoin/bitcoin/pull/35511) <sub><img src="https://drahtbot.space/ack_count/bitcoin/bitcoin/35511.svg"></sub> (RFC: consensus: Make `CAmount` a class by hodlinator) * [#35286](https://github.com/bitcoin/bitcoin/pull/35286) <sub><img src="https://drahtbot.space/ack_count/bitcoin/bitcoin/35286.svg"></sub> (rpc: add testsubmitpackage for 1p1c test submissions by instagibbs) * [#35027](https://github.com/bitcoin/bitcoin/pull/35027) <sub><img src="https://drahtbot.space/ack_count/bitcoin/bitcoin/35027.svg"></sub> (net: add -outboundbind option for outgoing source address by 8144225309) * [#33922](https://github.com/bitcoin/bitcoin/pull/33922) <sub><img src="https://drahtbot.space/ack_count/bitcoin/bitcoin/33922.svg"></sub> (mining: add getMemoryLoad() and track template non-mempool memory footprint by Sjors) * [#30951](https://github.com/bitcoin/bitcoin/pull/30951) <sub><img src="https://drahtbot.space/ack_count/bitcoin/bitcoin/30951.svg"></sub> (net: option to disallow v1 connection on ipv4 and ipv6 peers by stratospher) * [#30437](https://github.com/bitcoin/bitcoin/pull/30437) <sub><img src="https://drahtbot.space/ack_count/bitcoin/bitcoin/30437.svg"></sub> (ipc: add bitcoin-mine test program by ryanofsky) * [#29418](https://github.com/bitcoin/bitcoin/pull/29418) <sub><img src="https://drahtbot.space/ack_count/bitcoin/bitcoin/29418.svg"></sub> (rpc: provide per message stats for global traffic via new field in 'getnettotals' by vasild) If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first. <!--5faf32d7da4f0f540f40219e4f7537a3--> ### LLM Linter (✨ experimental) Possible places where named args for integral literals may be used (e.g. `func(x, /*named_arg=*/0)` in C++, and `func(x, named_arg=0)` in Python): - `src/test/privbcast_queue_tests.cpp`: `CreateValidMempoolTransaction(m_coinbase_txns[0], 0, 0, coinbaseKey, script, 49 * COIN, false)` - `src/test/privbcast_queue_tests.cpp`: `CreateValidMempoolTransaction(m_coinbase_txns[1], 0, 0, coinbaseKey, script, 49 * COIN, false)` - `src/test/privbcast_queue_tests.cpp`: `CreateValidMempoolTransaction(m_coinbase_txns[1], 0, 0, coinbaseKey, script, 48 * COIN, false)` - `src/test/privbcast_queue_tests.cpp`: `CreateValidMempoolTransaction(m_coinbase_txns[2], 0, 0, coinbaseKey, script, 49 * COIN, false)` - `src/test/privbcast_queue_tests.cpp`: `CreateValidMempoolTransaction(parent, 0, 0, coinbaseKey, script, 48 * COIN, false)` - `src/test/txpackage_tests.cpp`: `CreateValidMempoolTransaction(m_coinbase_txns[0], 0, 0, coinbaseKey, parent_spk, coinbase_value - 10'000)` - `src/test/txpackage_tests.cpp`: `CreateValidMempoolTransaction(m_coinbase_txns[0], 0, 0, coinbaseKey, parent_spk, coinbase_value - 100'000, false)` - `src/test/txpackage_tests.cpp`: `CreateValidMempoolTransaction(m_coinbase_txns[1], 0, 0, coinbaseKey, parent_spk, coinbase_value - 10'000)` - `src/test/txpackage_tests.cpp`: `CreateValidMempoolTransaction(m_coinbase_txns[2], 0, 0, coinbaseKey, parent_spk, coinbase_value - 10'000, false)` - `src/test/txpackage_tests.cpp`: `CreateValidMempoolTransaction(m_coinbase_txns[3], 0, 0, coinbaseKey, parent_spk, coinbase_value - 10'000)` - `src/test/txpackage_tests.cpp`: `CreateValidMempoolTransaction(m_coinbase_txns[3], 0, 0, coinbaseKey, parent_spk, coinbase_value - 100'000, false)` - `src/test/txpackage_tests.cpp`: `CreateValidMempoolTransaction(tx, 0, 101, parent_key, child_spk, value, false)` Possible places where comparison-specific test macros should replace generic comparisons: - `test/functional/tool_privbcast_package.py`: `assert a["parent_hold_expired_ms"] is not None and a["parent_getdata_ms"] is None` → Prefer `assert_equal(a["parent_getdata_ms"], None)` for the `is None` comparison. - `test/functional/tool_privbcast_package.py`: `assert a["parent_getdata_ms"] is None and a["parent_hold_expired_ms"] is not None` → Prefer `assert_equal(a["parent_getdata_ms"], None)` for the `is None` comparison. - `test/functional/tool_privbcast_package.py`: `assert a["getdata_ms"] is None and a["tx_written_ms"] is None` → Prefer `assert_equal(..., None)` for each comparison. <sup>2026-10-22 17:41:53</sup>
DrahtBot commented 2026-10-22 15:18:05 +00:00 (Migrated from github.com)

🚧 At least one of the CI tasks failed.
Task MSan: https://github.com/bitcoin/bitcoin/actions/runs/39798797867/job/119893347731
LLM reason (✨ experimental): The build failed because Clang’s thread-safety analysis found calls to AcceptSubPackage without exclusive locks on cs_main and m_pool.cs in validation.cpp.

Hints

Try to run the tests locally, according to the documentation. However, a CI failure may still
happen due to a number of reasons, for example:

  • Possibly due to a silent merge conflict (the changes in this pull request being
    incompatible with the current code in the target branch). If so, make sure to rebase on the latest
    commit of the target branch.

  • A sanitizer issue, which can only be found by compiling with the sanitizer and running the
    affected test.

  • An intermittent issue.

Leave a comment here, if you need help tracking down a confusing failure.

<!--85328a0da195eb286784d51f73fa0af9--> 🚧 At least one of the CI tasks failed. <sub>Task `MSan`: https://github.com/bitcoin/bitcoin/actions/runs/39798797867/job/119893347731</sub> <sub>LLM reason (✨ experimental): The build failed because Clang’s thread-safety analysis found calls to `AcceptSubPackage` without exclusive locks on `cs_main` and `m_pool.cs` in `validation.cpp`.</sub> <details><summary>Hints</summary> Try to run the tests locally, according to the documentation. However, a CI failure may still happen due to a number of reasons, for example: * Possibly due to a silent merge conflict (the changes in this pull request being incompatible with the current code in the target branch). If so, make sure to rebase on the latest commit of the target branch. * A sanitizer issue, which can only be found by compiling with the sanitizer and running the affected test. * An intermittent issue. Leave a comment here, if you need help tracking down a confusing failure. </details>
First-time contributor

1 minor finding · 1 suggestion · 2 previous findings

🟠 Minor

Test acceptance pools replacement checks for a parent and child

Location: src/validation.cpp:1761 (head).

Under -privatebroadcast, submitpackage can queue a pair that recipients reject, or refuse a pair that sequential submission accepts, under specific replacement or fee settings.

Details and suggested fix

When the parent passes alone, AcceptPackage retests the parent and child with PackageTestEach. If either conflicts with the mempool, PackageRBFChecks evaluates both together: it aggregates their conflicting clusters and compares their summed modified fees and virtual size against all conflicts. Real submission and a recipient's 1p1c evaluation instead accept the parent alone first, then run ReplacementChecks on the child using only the child's fee and virtual size.

These checks can diverge in both directions. A parent that overpays for its own conflict can cover a child that underpays for a different conflict. submitpackage then returns success and queues a job, but recipients holding that conflict take only the parent and reject the child with “insufficient fee.” The pair can also be refused if the combined conflicts exceed MAX_REPLACEMENT_CANDIDATES, even though neither transaction does alone. Finally, when -minrelaytxfee is explicitly below -incrementalrelayfee and the child has no conflicts, the pooled check can refuse a pair that submission accepts. For example, with incremental relay fee 1 sat/vB, minimum relay fee 0.1 sat/vB, an unelevated mempool minimum fee, and two 200-vbyte transactions, a parent paying 1,200 sat replaces a transaction paying 1,000 sat, while the child pays 20 sat. Submission accepts both, but the pooled check requires a 400-sat increment and sees only 220 sat. Check the parent's conflicts using its own fee and virtual size, stage those removals, and then check the child's conflicts using its own fee and virtual size, as sequential submission does. Add txpackage tests for each direction.

🔵 Suggestion

Private broadcast transport IDs overlap node peer IDs in debug logs

Location: src/privbcast/job.cpp:270 (head).

With -debug=net, transport lines for private broadcast attempts can be mistaken for lines from an unrelated peer with the same ID.

Details and suggested fix

Each Job numbers its attempt transports from 0, and every job reuses IDs 0 through 23. V2Transport logs these IDs as peer IDs under BCLog::NET, including handshake and transport-error messages. Node peers also receive IDs starting from 0, so these lines share the same debug log and can be attributed to an unrelated ordinary peer. The default log is unaffected. Use transport IDs that CConnman never assigns, such as negative IDs, or log failures under BCLog::PRIVBROADCAST with the slot, as Reap already does.


Previous findings (2)
[Minor · still present] Private submitpackage uses BIP141 size for the single-transaction maxfeerate check

A sigop-heavy transaction can exceed the maxfeerate limit in private submitpackage even though sendrawtransaction accepts it with the same limit.

This occurs when exactly one submitted transaction needs test acceptance, either because it was submitted alone or because its parent is already in the mempool. The check applies maxfeerate to the transaction's BIP141 virtual size, while sendrawtransaction applies it to validation's sigop-adjusted virtual size. A valid transaction whose sigop-adjusted size exceeds its BIP141 size and whose fee falls between the resulting limits is therefore rejected by private submitpackage with “max feerate exceeded,” but accepted by sendrawtransaction. This conflicts with the helper comment, RPC help, and spec, and the two-transaction path already uses the sigop-adjusted size. Check the fee against validation's sigop-adjusted size and test against sendrawtransaction with the same maxfeerate, including when the parent is already in the mempool. No current caller submitting such a sigop-heavy transaction was identified, so the production impact is unconfirmed.

Location: src/rpc/mempool.cpp:1488 (head).

Previous reports of the same concern:

  • src/rpc/mempool.cpp:1488. First reported at eec78ccf7d59f5b39d4525980e8e3a7fe6c60242. Last checked at eec78ccf7d59f5b39d4525980e8e3a7fe6c60242.
  • src/rpc/mempool.cpp:1488. First reported at eec78ccf7d59f5b39d4525980e8e3a7fe6c60242. Last checked at eec78ccf7d59f5b39d4525980e8e3a7fe6c60242.
[Suggestion · still present] Bound retained bytes in the private-broadcast queue

The queue limit counts records, but each JobRecord retains the full transaction and optional parent. The specification explicitly limits the number of jobs, not their size, and the submission path queues test-accepted caller-provided transactions. As a result, up to 10,000 queued records can retain memory proportional to their transaction data, with no aggregate byte budget. Add a documented retained-byte limit and refuse submissions that exceed it, or justify the worst-case memory budget. This matters because queued records can remain retained while jobs start at spaced intervals.

Location: src/node/privbcast.cpp:137 (head).

First reported at eec78ccf7d59f5b39d4525980e8e3a7fe6c60242. Last checked at eec78ccf7d59f5b39d4525980e8e3a7fe6c60242.

Review coverage was incomplete.

Review limitations
  • adversarial: The inspection limit left submitpackage's outer RPC dispatch at src/rpc/mempool.cpp:1680 onward and the changed integration in src/node/interfaces.cpp and src/rpc/blockchain.cpp unread; end-to-end RPC and node-interface behavior is not fully covered.
  • adversarial_claude: I did not check line by line that the ~880-line move of V1Transport/V2Transport, CNetMessage and CSerializedNetMsg from net.cpp/net.h into net_transport.{h,cpp} really is move-only. That code parses untrusted bytes from the node's ordinary peers, so a change hidden in the move would matter. Only the net.h/net.cpp side of the move and the V2 log lines were read.
  • adversarial_claude: Not read: the rest of src/node/privbcast.h (POLL_INTERVAL and the JobRecord::cancel type), report.cpp, doc/private-broadcast.md and the functional/unit test files. So the N6 claim that queued jobs are dropped within about a second, and the claimed atomicity of cancel, were taken from comments and Job::Cancelled()'s use of ->load(), not from the declarations.
  • state: The patch is too large to inspect in full. In particular, the changed package submission path in src/rpc/mempool.cpp and the new package-validation changes in src/validation.cpp were not traced through their complete functions and callers; these could materially affect acceptance and replacement behavior.
  • public_contract: The SOCKS5 parser, discovery, and candidate-assignment implementations in src/privbcast/{socks5,discovery,assign}.cpp remain unread. Their handling of adversarial proxy replies and seed answers could materially change the assessment of the documented privacy and delivery properties.
  • public_contract: The package-validation changes were inspected as a diff, but the complete AcceptPackage, AcceptSubPackage, and PackageRBFChecks functions and their regression tests were not traced. Whether test-as-submission preserves mempool state and accurately predicts package acceptance remains unresolved.
  • public_contract: The submitpackage handler, startup and shutdown wiring in src/init.cpp, and the remaining job I/O and report-generation paths were not fully inspected. Queue admission, proxy prerequisites, cancellation, and user-visible RPC results therefore remain incompletely verified.
  • public_contract: The transport extraction and removal of the old private-broadcast connection paths were not compared comprehensively against the base, and the build, packaging, and functional-test changes were not fully inspected.
  • tests: The full diff for package-validation and RPC changes was not available within the supplied excerpt; in particular, callers and result handling around ProcessNewPackage's new test_as_submission path and submitpackage queueing remain unverified.
  • design: The full MemPoolAccept::AcceptPackage implementation for the new test_as_submission path was not inspected. Whether its per-transaction results consistently reflect package-level rejection remains unverified and could affect review of package-mode submission.
  • verifier: I did not compare the transport move into net_transport.{h,cpp} line by line against base net.{h,cpp}. That code parses untrusted bytes from ordinary peers. I read only the V2Transport log lines and the receive paths that the job uses.
  • verifier: I did not read src/privbcast/{socks5,discovery,assign,stream,report}.cpp. Their handling of hostile proxy replies and seed answers was outside the supplied candidates and remains unchecked.
  • verifier: I did not trace init.cpp startup and shutdown wiring, getprivatebroadcastinfo and abortprivatebroadcast RPC rendering, the src/node/interfaces.cpp changes, or the functional tests.
  • verifier: I checked the pooled replacement-check divergence statically against PackageRBFChecks, ReplacementChecks and AcceptPackage. I did not inspect sibling-eviction differences between the pooled path and sequential submission.

Base: 0f27bed5b292 · Head: eec78ccf7d59 · Full review report

<!-- forgejo-review-bot:bitcoin/bitcoin --> <!-- ralph-engine:current:aadde06fc908436af97c3ae22ac03220a75b46811daf747af5f90dd2d5b368be:58df985c6f760decb26503b27f8441ea78138ad8e02f110fa19b993630f18590 --> <!-- ralph-base:0f27bed5b2924420d65caeca439e6b036d3c6cb2 --> <!-- ralph-head:eec78ccf7d59f5b39d4525980e8e3a7fe6c60242 --> <!-- ralph-case:fd583b63a14a919edf73138ad415c0169ae699f0c0009bd7d64a11c9b572442d --> 1 minor finding · 1 suggestion · 2 previous findings **🟠 Minor** **Test acceptance pools replacement checks for a parent and child** Location: [`src/validation.cpp:1761`](<https://git.fish.foo/bitcoin/bitcoin/src/commit/eec78ccf7d59f5b39d4525980e8e3a7fe6c60242/src/validation.cpp#L1761>) (head). Under -privatebroadcast, submitpackage can queue a pair that recipients reject, or refuse a pair that sequential submission accepts, under specific replacement or fee settings. <details> <summary>Details and suggested fix</summary> When the parent passes alone, AcceptPackage retests the parent and child with PackageTestEach. If either conflicts with the mempool, PackageRBFChecks evaluates both together: it aggregates their conflicting clusters and compares their summed modified fees and virtual size against all conflicts. Real submission and a recipient's 1p1c evaluation instead accept the parent alone first, then run ReplacementChecks on the child using only the child's fee and virtual size. These checks can diverge in both directions. A parent that overpays for its own conflict can cover a child that underpays for a different conflict. submitpackage then returns success and queues a job, but recipients holding that conflict take only the parent and reject the child with “insufficient fee.” The pair can also be refused if the combined conflicts exceed MAX_REPLACEMENT_CANDIDATES, even though neither transaction does alone. Finally, when -minrelaytxfee is explicitly below -incrementalrelayfee and the child has no conflicts, the pooled check can refuse a pair that submission accepts. For example, with incremental relay fee 1 sat/vB, minimum relay fee 0.1 sat/vB, an unelevated mempool minimum fee, and two 200-vbyte transactions, a parent paying 1,200 sat replaces a transaction paying 1,000 sat, while the child pays 20 sat. Submission accepts both, but the pooled check requires a 400-sat increment and sees only 220 sat. Check the parent's conflicts using its own fee and virtual size, stage those removals, and then check the child's conflicts using its own fee and virtual size, as sequential submission does. Add txpackage tests for each direction. </details> **🔵 Suggestion** **Private broadcast transport IDs overlap node peer IDs in debug logs** Location: [`src/privbcast/job.cpp:270`](<https://git.fish.foo/bitcoin/bitcoin/src/commit/eec78ccf7d59f5b39d4525980e8e3a7fe6c60242/src/privbcast/job.cpp#L270>) (head). With -debug=net, transport lines for private broadcast attempts can be mistaken for lines from an unrelated peer with the same ID. <details> <summary>Details and suggested fix</summary> Each Job numbers its attempt transports from 0, and every job reuses IDs 0 through 23. V2Transport logs these IDs as peer IDs under BCLog::NET, including handshake and transport-error messages. Node peers also receive IDs starting from 0, so these lines share the same debug log and can be attributed to an unrelated ordinary peer. The default log is unaffected. Use transport IDs that CConnman never assigns, such as negative IDs, or log failures under BCLog::PRIVBROADCAST with the slot, as Reap already does. </details> --- <details> <summary>Previous findings (2)</summary> <details> <summary>[Minor · still present] Private submitpackage uses BIP141 size for the single-transaction maxfeerate check</summary> A sigop-heavy transaction can exceed the maxfeerate limit in private submitpackage even though sendrawtransaction accepts it with the same limit. This occurs when exactly one submitted transaction needs test acceptance, either because it was submitted alone or because its parent is already in the mempool. The check applies maxfeerate to the transaction's BIP141 virtual size, while sendrawtransaction applies it to validation's sigop-adjusted virtual size. A valid transaction whose sigop-adjusted size exceeds its BIP141 size and whose fee falls between the resulting limits is therefore rejected by private submitpackage with “max feerate exceeded,” but accepted by sendrawtransaction. This conflicts with the helper comment, RPC help, and spec, and the two-transaction path already uses the sigop-adjusted size. Check the fee against validation's sigop-adjusted size and test against sendrawtransaction with the same maxfeerate, including when the parent is already in the mempool. No current caller submitting such a sigop-heavy transaction was identified, so the production impact is unconfirmed. Location: [`src/rpc/mempool.cpp:1488`](<https://git.fish.foo/bitcoin/bitcoin/src/commit/eec78ccf7d59f5b39d4525980e8e3a7fe6c60242/src/rpc/mempool.cpp#L1488>) (head). Previous reports of the same concern: - src/rpc/mempool.cpp:1488. First reported at `eec78ccf7d59f5b39d4525980e8e3a7fe6c60242`. Last checked at `eec78ccf7d59f5b39d4525980e8e3a7fe6c60242`. - src/rpc/mempool.cpp:1488. First reported at `eec78ccf7d59f5b39d4525980e8e3a7fe6c60242`. Last checked at `eec78ccf7d59f5b39d4525980e8e3a7fe6c60242`. </details> <details> <summary>[Suggestion · still present] Bound retained bytes in the private-broadcast queue</summary> The queue limit counts records, but each `JobRecord` retains the full transaction and optional parent. The specification explicitly limits the number of jobs, not their size, and the submission path queues test-accepted caller-provided transactions. As a result, up to 10,000 queued records can retain memory proportional to their transaction data, with no aggregate byte budget. Add a documented retained-byte limit and refuse submissions that exceed it, or justify the worst-case memory budget. This matters because queued records can remain retained while jobs start at spaced intervals. Location: [`src/node/privbcast.cpp:137`](<https://git.fish.foo/bitcoin/bitcoin/src/commit/eec78ccf7d59f5b39d4525980e8e3a7fe6c60242/src/node/privbcast.cpp#L137>) (head). First reported at `eec78ccf7d59f5b39d4525980e8e3a7fe6c60242`. Last checked at `eec78ccf7d59f5b39d4525980e8e3a7fe6c60242`. </details> </details> Review coverage was incomplete. ##### Review limitations - adversarial: The inspection limit left submitpackage's outer RPC dispatch at src/rpc/mempool.cpp:1680 onward and the changed integration in src/node/interfaces.cpp and src/rpc/blockchain.cpp unread; end-to-end RPC and node-interface behavior is not fully covered. - adversarial_claude: I did not check line by line that the ~880-line move of V1Transport/V2Transport, CNetMessage and CSerializedNetMsg from net.cpp/net.h into net_transport.{h,cpp} really is move-only. That code parses untrusted bytes from the node's ordinary peers, so a change hidden in the move would matter. Only the net.h/net.cpp side of the move and the V2 log lines were read. - adversarial_claude: Not read: the rest of src/node/privbcast.h (POLL_INTERVAL and the JobRecord::cancel type), report.cpp, doc/private-broadcast.md and the functional/unit test files. So the N6 claim that queued jobs are dropped within about a second, and the claimed atomicity of `cancel`, were taken from comments and Job::Cancelled()'s use of `->load()`, not from the declarations. - state: The patch is too large to inspect in full. In particular, the changed package submission path in `src/rpc/mempool.cpp` and the new package-validation changes in `src/validation.cpp` were not traced through their complete functions and callers; these could materially affect acceptance and replacement behavior. - public_contract: The SOCKS5 parser, discovery, and candidate-assignment implementations in src/privbcast/{socks5,discovery,assign}.cpp remain unread. Their handling of adversarial proxy replies and seed answers could materially change the assessment of the documented privacy and delivery properties. - public_contract: The package-validation changes were inspected as a diff, but the complete AcceptPackage, AcceptSubPackage, and PackageRBFChecks functions and their regression tests were not traced. Whether test-as-submission preserves mempool state and accurately predicts package acceptance remains unresolved. - public_contract: The submitpackage handler, startup and shutdown wiring in src/init.cpp, and the remaining job I/O and report-generation paths were not fully inspected. Queue admission, proxy prerequisites, cancellation, and user-visible RPC results therefore remain incompletely verified. - public_contract: The transport extraction and removal of the old private-broadcast connection paths were not compared comprehensively against the base, and the build, packaging, and functional-test changes were not fully inspected. - tests: The full diff for package-validation and RPC changes was not available within the supplied excerpt; in particular, callers and result handling around ProcessNewPackage's new test_as_submission path and submitpackage queueing remain unverified. - design: The full `MemPoolAccept::AcceptPackage` implementation for the new `test_as_submission` path was not inspected. Whether its per-transaction results consistently reflect package-level rejection remains unverified and could affect review of package-mode submission. - verifier: I did not compare the transport move into net_transport.{h,cpp} line by line against base net.{h,cpp}. That code parses untrusted bytes from ordinary peers. I read only the V2Transport log lines and the receive paths that the job uses. - verifier: I did not read src/privbcast/{socks5,discovery,assign,stream,report}.cpp. Their handling of hostile proxy replies and seed answers was outside the supplied candidates and remains unchecked. - verifier: I did not trace init.cpp startup and shutdown wiring, getprivatebroadcastinfo and abortprivatebroadcast RPC rendering, the src/node/interfaces.cpp changes, or the functional tests. - verifier: I checked the pooled replacement-check divergence statically against PackageRBFChecks, ReplacementChecks and AcceptPackage. I did not inspect sibling-eviction differences between the pooled path and sequential submission. <!-- Review tier: sensitive --> --- Base: [`0f27bed5b292`](<https://git.fish.foo/bitcoin/bitcoin/commit/0f27bed5b2924420d65caeca439e6b036d3c6cb2>) · Head: [`eec78ccf7d59`](<https://git.fish.foo/bitcoin/bitcoin/commit/eec78ccf7d59f5b39d4525980e8e3a7fe6c60242>) · [Full review report](<https://review.fish.foo/traces/36608-eec78ccf7d59f5b39d4525980e8e3a7fe6c60242-1601-5.html>)
instagibbs commented 2026-10-23 16:46:02 +00:00 (Migrated from github.com)
in draft, https://github.com/bitcoin/bitcoin/pull/36628 is the slimmed down branch to review
DrahtBot commented 2026-10-28 16:41:10 +00:00 (Migrated from github.com)

🐙 This pull request conflicts with the target branch and needs rebase.

<!--cf906140f33d8803c4a75a2196329ecb--> 🐙 This pull request conflicts with the target branch and [needs rebase](https://github.com/bitcoin/bitcoin/blob/master/CONTRIBUTING.md#rebasing-changes).
instagibbs commented 2026-11-23 18:06:50 +00:00 (Migrated from github.com)

not being considered at the moment, can be resurrected easily

not being considered at the moment, can be resurrected easily
optout21 commented 2026-11-25 09:10:11 +00:00 (Migrated from github.com)

Thanks for bringing in a fresh perspective, if not else, it's a good base for further discussions (despite that it's closed now).

I tried to expand on the comparison with the current implementation (master) from the description.

master 36608 node mode 36608 tool mode
Connections via a Tor exit Typically 1/3–1/2: each eligible network (onion, I2P, IPv4, IPv6) is equally likely All All
-onlynet=onion Keeps broadcasts on onion Ignored, jobs still use exits n/a
Pre-validation Full test-accept Full test-accept, except if the txid is already in the mempool: the caller's bytes are then sent unvalidated (N2) Only CheckTransaction, not-coinbase, weight and burn limit. No inputs, scripts, fees or standardness
Tx coming back Stops retries Recorded by txid, for the report only (N7) Not observed

For reference, the common fallback, mempool.space/tx/push over Tor, validates against its own node and depends on a single provider.

Also, mainnet has exactly 7 DNS seeds, and MIN_DNS_SEEDS is 7. Losing one breaks R3 and needs a parameter and spec change. That change is itself a release fingerprint visible to exits.

Design questions

I attempt to list the various dimensions in the design space:

Question Options master 36608
Target types onion/I2P only / clearnet via Tor only / all / all, preferring onion/I2P all clearnet via Tor
Target source node's addrman / DNS seeds / separate address-gathering component addrman DNS seeds
Connection code node's networking / separate node separate
Tx coming back acted on / recorded only / not observed acted on recorded (node) / none (tool)
Pre-validation full / checks needing no chain state / none full full (node) / partial (tool)
Retries automatic, re-validated / user resubmits automatic user resubmits

Several of these are independent of each other. For example, separate connection code doesn't require DNS-seed targets.

Most likely direction?

To me, 36608's main benefit is that targets don't come from the node's addrman, which closes the planted-address attack (an address gossiped only to the victim). DNS seeds alone is also the most contentious part, though: liveness, the 7-of-7 seed margin, and every connection through an exit. Changes to master that seem more likely:

  • harden selection within addrman against planted addresses (e.g. addresses seen from several sources or from the tried table, or mixing addrman and DNS-seed targets so no single source decides all of them);
  • isolate the connection and state logic as stateless jobs, which addresses the class of bugs listed in the description, while still drawing targets from addrman;
  • prefer onion/I2P targets, which reduces exit exposure;
  • add 1p1c package support, which is independent of the rest.
Thanks for bringing in a fresh perspective, if not else, it's a good base for further discussions (despite that it's closed now). I tried to expand on the comparison with the current implementation (master) from the description. | | master | 36608 node mode | 36608 tool mode | |---|---|---|---| | Connections via a Tor exit | Typically 1/3–1/2: each eligible network (onion, I2P, IPv4, IPv6) is equally likely | All | All | | `-onlynet=onion` | Keeps broadcasts on onion | Ignored, jobs still use exits | n/a | | Pre-validation | Full test-accept | Full test-accept, except if the txid is already in the mempool: the caller's bytes are then sent unvalidated (N2) | Only `CheckTransaction`, not-coinbase, weight and burn limit. No inputs, scripts, fees or standardness | | Tx coming back | Stops retries | Recorded by txid, for the report only (N7) | Not observed | For reference, the common fallback, `mempool.space/tx/push` over Tor, validates against its own node and depends on a single provider. Also, mainnet has exactly 7 DNS seeds, and `MIN_DNS_SEEDS` is 7. Losing one breaks R3 and needs a parameter and spec change. That change is itself a release fingerprint visible to exits. **Design questions** I attempt to list the various dimensions in the design space: | Question | Options | master | 36608 | |---|---|---|---| | Target types | onion/I2P only / clearnet via Tor only / all / all, preferring onion/I2P | all | clearnet via Tor | | Target source | node's addrman / DNS seeds / separate address-gathering component | addrman | DNS seeds | | Connection code | node's networking / separate | node | separate | | Tx coming back | acted on / recorded only / not observed | acted on | recorded (node) / none (tool) | | Pre-validation | full / checks needing no chain state / none | full | full (node) / partial (tool) | | Retries | automatic, re-validated / user resubmits | automatic | user resubmits | Several of these are independent of each other. For example, separate connection code doesn't require DNS-seed targets. **Most likely direction?** To me, 36608's main benefit is that targets don't come from the node's addrman, which closes the planted-address attack (an address gossiped only to the victim). DNS seeds alone is also the most contentious part, though: liveness, the 7-of-7 seed margin, and every connection through an exit. Changes to master that seem more likely: - harden selection within addrman against planted addresses (e.g. addresses seen from several sources or from the tried table, or mixing addrman and DNS-seed targets so no single source decides all of them); - isolate the connection and state logic as stateless jobs, which addresses the class of bugs listed in the description, while still drawing targets from addrman; - prefer onion/I2P targets, which reduces exit exposure; - add 1p1c package support, which is independent of the rest.
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
bitcoin/bitcoin!36608
No description provided.