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

pull sashaphmn wants to merge 2 commits into bitcoin:master from sashaphmn:compact-blocks-bg-validation changing 2 files +136 −4
  1. sashaphmn commented at 1:17 PM on November 6, 2026: none

    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.

  2. p2p: ignore historical blocks when counting blocks in flight
    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.
    47ffe1630f
  3. test: request tip block as compact while historical blocks are in flight a695d65fda
  4. DrahtBot added the label P2P on Nov 6, 2026
  5. DrahtBot commented at 1:18 PM on November 6, 2026: contributor

    <!--e57a25ab6845829454e8d69fc972939a-->

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

    <!--006a51241073e994b41acfe9ec718e94-->

    External sites

    <!--021abf342d371248e50ceaed478a90ca-->

    Reviews

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

    <!--174a7506f384e20aa4161008e828411d-->

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #36787 <sub><img src="https://drahtbot.space/ack_count/bitcoin/bitcoin/36787.svg"></sub> (cmpctblock: Cache serialized cmpctblock msg for relay [part of prefill series] by davidgumberg)
    • #36598 <sub><img src="https://drahtbot.space/ack_count/bitcoin/bitcoin/36598.svg"></sub> ([Demo] validation: remove AssumeUTXO by l0rinc)
    • #35558 <sub><img src="https://drahtbot.space/ack_count/bitcoin/bitcoin/35558.svg"></sub> (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.

    <!--5faf32d7da4f0f540f40219e4f7537a3-->

Contributors
Labels

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-11-15 02:51 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me