validation: do not add the snapshot to candidates set of the background chainstate #34786

pull mzumsande wants to merge 1 commits into bitcoin:master from mzumsande:202603_assumeutxo_sbi changing 2 files +6 −13
  1. mzumsande commented at 11:53 am on March 10, 2026: contributor

    The snapshot block needs to be added to the candidates set of the assumed-valid chain because it will be the tip of that chainstate right after snapshot activation.

    However, adding it also to the background chainstate is not necessary for anything. Before, the index would be in the set without being connectable. It will be eventually added to the set as part of the normal block download - no extra logic is necessary here.

    This simplifies a unit test which had a comment that having the block in the set is “not intended”. This was suggested here and here in #34521

    Note that adding the snapshot block was harmless, since FindMostWorkChain() lazily removes blocks without data from the set, so this does not fix a bug but just simplifies some code.

  2. validation: do not add the snapshot block to candidates of bg chainstate
    The snapshot block needs to be added to the candidates set of the
    assumed-valid chain because it will be the tip of that chainstate
    right after snapshot activation.
    However, adding it also to the background chainstate is not necessary
    for anything. Before, the index would linger in the set without being
    connectable. It will be eventually added to the set as part of the
    normal block download - no extra logic is necessary here.
    69baddc910
  3. DrahtBot added the label Validation on Mar 10, 2026
  4. DrahtBot commented at 11:54 am on March 10, 2026: contributor

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

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    Concept ACK sedited

    If your review is incorrectly listed, please copy-paste <!–meta-tag:bot-skip–> into the comment that the bot should ignore.

  5. sedited commented at 4:55 pm on March 10, 2026: contributor
    Concept ACK, thanks for the follow up.

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-03-11 06:13 UTC

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