#36410 test: cover compact blocks far ahead of the tip

ReviewabilityReviewsAgreementSize
#36410 fametrano test: cover compact blocks far ahead of the tipReady0Crickets0 + 85 tests
  • Add test coverage for handling compact blocks received far ahead of the chain tip
  • Ensure regression protection for fallback header processing and full-block re-request behavior
  • Ready for review
  • No review verdicts recorded
  • No review comments or discussion yet
  • Awaiting initial feedback
  • 0 lines added or modified outside tests
  • 85 lines added or modified in tests
  • 0 lines removed in total
  • 2 files, 1 commits
P2P#62 of 71
P3 · test coverage
  • P3 because it adds missing functional test coverage without touching production code
  • Prevents regressions in compact block fallback handling and getdata re-requests
  • Ranking pass: New coverage only; ordered inside the test cluster.
Reviewability: ReadyStalePaused
Agreement: StrongPositivePositive w/ caveatsNeutralMildDisputedBlockedCrickets
Reviews: current code-review ACKs, then (+stale ACKs) and -NACKs; greener = more ACKs.
Size: lines added or modified outside tests, then in tests; greener = smaller.

Goal

Adds a functional test covering compact blocks received more than two blocks ahead of the chain tip. It verifies that when a node receives such a compact block for a block it previously requested, it re-requests the full block via getdata. It also tests that receiving an unrequested far-ahead compact block from an outbound high-bandwidth peer falls back to header processing and protects the peer from eviction.

Problem: Handling of compact blocks more than two blocks ahead of the tip was completely uncovered by tests. Either the full-block getdata re-request path or the fallback header processing branch (fRevertToHeaderProcessing) could be deleted without failing any test in the test suite.

Evidence of importance:

  • Commit de16833975 notes that 'No test checked what either branch does, so removing both made no test fail.'
  • Linked issue #34618 reported missing test coverage for fRevertToHeaderProcessing in compact block message handling.

Risk of a mistake: low (tests). Only adds a new functional test and touches no production node code.

Reviewability

Ready

Nothing known that would invalidate a review now.

Agreement

Crickets

no substantive comment either way

Objections, suggestions, and questions: none recorded.

Files

85 lines under test/bench/ci.

  • test/functional/p2p_compactblocks_far_ahead.py +84/-0
  • test/functional/test_runner.py +1/-0

Card

The short text the ranking pass compares across PRs.

Adds a functional test covering compact blocks received more than two blocks ahead of the active chain tip. Previously, neither the full-block getdata retry path for requested blocks nor the fallback header-processing branch (fRevertToHeaderProcessing) for unrequested blocks was tested, so either code path could be disabled without causing test failures. The new test verifies both that the node requests the full block again and that an outbound high-bandwidth peer is protected from eviction upon header processing. This resolves issue #34618.

Data

dossier JSON · extract JSON · model ledger, generated 2026-10-22T01:13, confidence high, input hash dc67062f9d10d791
labels: Tests

Categories

P2P

P3 · test coverage (ranking pass: New coverage only; ordered inside the test cluster.)

Adds missing test coverage for compact block processing when received far ahead of the chain tip. Issue #34618 and commit de16833975 noted that handling of these branches, including fallback header processing (`fRevertToHeaderProcessing`), had no test coverage.

Membership: Adds a functional test pinning P2P compact block handling and fallback behaviors (`test/functional/p2p_compactblocks_far_ahead.py`).

Factors: security/stability 0, bug 0, performance 0, user value 0, leverage 0