Skip to content

fix(tests): correct BSV magic bytes and add splitter propagation guards#8

Merged
martyncharler merged 1 commit into
mainfrom
fix/test-harness-remediations
May 29, 2026
Merged

fix(tests): correct BSV magic bytes and add splitter propagation guards#8
martyncharler merged 1 commit into
mainfrom
fix/test-harness-remediations

Conversation

@martyncharler

Copy link
Copy Markdown
Collaborator

Summary

Remediations for the 2026-05-28 NO_GO acceptance run (see issue #7). All changes are in the test harness — no production code is touched.

  • PC-3 (FAIL): parseStandardBlock was matching standard Bitcoin wire magic bytes instead of BSV-specific LE wire bytes, so the P2P frame preamble was never detected and block parsing failed.
  • INTER-2 (SKIPPED 0/33) / PERF-1 (ERROR): Splitter tx submitted to Teranode was not propagating to svnode-1 (teranode#942). The mined block was empty, the splitter was evicted, and all test txs spending its outputs were rejected. Now skips early with a clear teranode#942 reference instead of a cryptic submission failure.
  • INTER-1 (reorg phase): B2 propagation timeout raised 30s→60s; reorg convergence timeout raised 60s→120s. Teranode has been observed slow to finalise reorgs under regtest; the old budgets were too tight.

Changes

File Change
tests/pc3.go Fix magic bytes in parseStandardBlock to use BSV LE wire values from p2p_probe.go
tests/inter2.go Add 15s splitter propagation guard on svnode-1 before mining
tests/perf1.go Same guard at each rate step
tests/helper.go Extend B2 propagation and reorg convergence timeouts in induceReorg

What still requires upstream fixes in Teranode

Test Upstream issue
CLIENT-1, CLIENT-3 Centrifuge transport Unidirectional=true in services/asset/centrifuge_impl/websocket.go
INTER-1 (root cause), INTER-2, PERF-1 teranode#942 — outbound legacy P2P not broadcasting txs/blocks to SV peers

Test plan

  • Run acceptance suite in SHORT mode after merging; PC-3 should now PASS
  • INTER-2 and PERF-1 should SKIP with a clean teranode#942 message (not ERROR/cryptic fail) until teranode#942 is fixed upstream
  • INTER-1 reorg phase should have more headroom; confirm it does not timeout on a healthy network

Closes part of #7.

🤖 Generated with Claude Code

PC-3: parseStandardBlock was checking standard Bitcoin wire magic (mainnet
0xf9beb4d9, testnet 0x0b110907) and had BSV regtest in big-endian order.
Magic constants in p2p_probe.go are written with binary.Write LE, so the
correct on-wire bytes are the uint32 value in little-endian order:
  mainnet     0xe8f3e1e3 → e3 e1 f3 e8
  regtest     0xfabfb5da → da b5 bf fa
  testnet     0xf4f3e5f4 → f4 e5 f3 f4
  teratestnet 0x0c09010d → 0d 01 09 0c

INTER-2 / PERF-1: splitter tx submitted to Teranode was not propagating to
svnode-1 (teranode#942 — outbound legacy P2P broken). svnode-1 then mined
an empty block, the splitter was evicted from Teranode's mempool, and all
subsequent txs spending the splitter's outputs were rejected by both nodes
(INTER-2: 0/33 each side; PERF-1: ERROR). Added a 15s waitForMempoolEntries
check on svnode-1 before mining; failure now skips with a clear reference
to teranode#942 instead of opaque submission failures.

INTER-1 (induceReorg): extended B2 propagation wait from 30s→60s and reorg
convergence from 60s→120s. Teranode has been observed slow to finalise
reorgs in regtest; the old budgets were too tight for the 3-block competing
chain scenario. Error messages now name the specific propagation path.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Test harness fixes for the 2026-05-28 NO_GO acceptance run: corrects the PC-3 BSV wire magic byte detection, adds early SKIP guards in INTER-2/PERF-1 when the splitter tx fails to propagate to svnode-1 (teranode#942), and widens reorg-related timeouts in induceReorg. No production code is touched.

Changes:

  • Replace BTC mainnet/testnet magic bytes in parseStandardBlock with the BSV-specific little-endian wire values (mainnet/regtest/testnet/teratestnet) that match internal/teranode/p2p_probe.go.
  • Add a 15s waitForMempoolEntries guard on svnode-1 in both RunINTER2 and each rate step of RunPERF1, converting a cryptic downstream failure into a clean SKIP referencing teranode#942.
  • Raise B2 propagation timeout 30s→60s and reorg convergence 60s→120s in induceReorg, with clearer error messages.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
tests/pc3.go Switch wire-frame detection to BSV LE magic bytes (mainnet e3 e1 f3 e8, regtest da b5 bf fa, testnet f4 e5 f3 f4, teratestnet 0d 01 09 0c).
tests/inter2.go Pre-mine SKIP if splitter tx not seen in svnode-1 mempool within 15s.
tests/perf1.go Same splitter propagation guard applied at every rate step.
tests/helper.go Extend induceReorg timeouts (B2 propagation 60s, reorg convergence 120s) with descriptive error messages.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@martyncharler martyncharler merged commit 2081a6d into main May 29, 2026
3 checks passed
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.

Acceptance Test Run 2026-05-28: NO_GO — PC-3 fail, Centrifuge misconfiguration, INTER-1 fail

3 participants