Skip to content

test: one hub for the blocks-only and orphan-tx journey - #787

Merged
reardencode merged 2 commits into
masterfrom
net/peer-blocksonly-orphan
Sep 27, 2026
Merged

reardencode merged 2 commits into
masterfrom
net/peer-blocksonly-orphan

Conversation

@rearden-grok

@rearden-grok rearden-grok Bot commented Sep 27, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Fold fifteen peer_tests.rs units (item 4 of the journey-fold index) into peer_blocksonly_and_orphan_tx. That is one regtest hub, one peer book, and one 130-block pad, where before there were fifteen store opens, most with their own 100-block pad.
  • The story runs with relay off first. A tx or wtx inv from an ordinary peer disconnects. A sendraw INVs once it is unbroadcast, never to block-relay, and then serves. A relay@ whitelisted peer's tx is kept and INV'd to the other inbound. A type-0 getdata is ignored while the tip block still serves.
  • A block then confirms those txs. Relay-on (tip-mode entry) purges them.
  • With relay on: forced INVs skip block-relay, already-seen, feefilter, and isolated local-origin peers. Inbound waits 30s even for unbroadcast, never gets a tx older than its connection, and idle ticks neither clone nor rescan. GetData serves only an announced or reorged-back tx, and a sendraw after a +300s jump neither INVs nor serves. An orphan parks on a tokio worker, and the missing-parent GETDATA waits NONPREF+TXID.
  • Pushed up from the old units: the reorg beat disconnects a real block (invalidate_block) instead of calling reorg_reaccept. The relay-off "remove is a no-op" check is now a real block plus the relay-on purge. Peers disconnect through unregister, which also erases their orphans.
  • Second commit: drop MempoolHub::evict_live_txids. testmempoolaccept stopped calling it in b6d8b09, and the folded test was its last caller.
  • TESTING.md gains the catalog row. The compact journey row now points at this journey for the worker park and park-not-reject logs. The ephemeral-broadcast plan's Red/Verify commands name the journey.

Three throwaway mutations in peer.rs each turn the journey red: no inv_gen_floor check, serve every mempool getdata, force-announce ignores feefilter.

Test plan

  • cargo test -p rbitcoin-net --lib peer_blocksonly_and_orphan_tx (repeated runs; ~2s)
  • cargo fmt --all -- --check, cargo clippy --workspace --all-targets -- -D warnings, cargo deny check, ./scripts/ast-grep.sh, cargo test --workspace --quiet, ./scripts/ci-os-smoke.sh
  • Required CI: qc, test, windows, macos, coverage

🤖 Generated with Claude Code

rearden-grok Bot and others added 2 commits September 27, 2026 09:10
Blocks-only relay, forced INVs, the inbound age gate, GetData privacy,
and orphan parent fetch were fifteen store opens, most with their own
100-block pad. One node walks them on one chain, relay off and then on.
The reorg beat now disconnects a real block instead of calling
reorg_reaccept, and relay-on purges what a block confirmed while relay
was off.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
testmempoolaccept went dry-run in b6d8b09 and stopped calling it. The
blocks-only test that still did is folded into a journey, so nothing
calls it. Its removal also puts the remove_for_block rustdoc back on
remove_for_block.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@reardencode
reardencode merged commit 792985d into master Sep 27, 2026
18 checks passed
@bobberb

bobberb commented Sep 27, 2026

Copy link
Copy Markdown

@reardencode I got much better sustained performance on catch up (I'm at 400K now)

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.

2 participants