Skip to content

p2p: ignore historical blocks when counting blocks in flight - #36790

Open
sashaphmn wants to merge 2 commits into
bitcoin:masterfrom
sashaphmn:compact-blocks-bg-validation
Open

sashaphmn wants to merge 2 commits into
bitcoin:masterfrom
sashaphmn:compact-blocks-bg-validation

Conversation

@sashaphmn

Copy link
Copy Markdown

While background validation runs after loading an assumeutxo
snapshot, blocks needed only by the background (historical) chainstate
are also tracked in mapBlocksInFlight. The condition that decides
whether a new block is requested as a compact block counted those
blocks as well, so with historical blocks in flight the new block at
the tip was requested as a full block instead.

Do not count blocks that are only needed by the historical chainstate.
Compact block relay then works normally during background validation.

Behavior is unchanged when no snapshot is loaded, because in that case
there are no historical blocks to exclude.

While background validation runs after loading an assumeutxo
snapshot, blocks needed only by the background (historical) chainstate
are also tracked in mapBlocksInFlight. The condition that decides
whether a compact block can be processed counted those blocks as well,
so it did not behave as it does on a node without a snapshot.

Do not count blocks that are only needed by the historical chainstate.
Compact block relay then works normally during background validation.

Behavior is unchanged when no snapshot is loaded, because in that case
there are no historical blocks to exclude.
@DrahtBot DrahtBot added the P2P label Nov 6, 2026
@DrahtBot

DrahtBot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

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:

  • #36787 (cmpctblock: Cache serialized cmpctblock msg for relay [part of prefill series] by davidgumberg)
  • #35558 (p2p: Prefill compact blocks by davidgumberg)

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants