HomePhabricator

validation: fix CheckBlockIndex for multiple chainstates

Description

validation: fix CheckBlockIndex for multiple chainstates

Summary:
Adjust CheckBlockIndex to account for

  • assumed-valid block indexes lacking transaction data, and
  • setBlockIndexCandidates for the background chainstate not containing certain entries which rely on assumed-valid ancestors.

Add unittest for UpdateTip behavior

This is a backport of core#21526 [8 & 12/12]
https://github.com/bitcoin/bitcoin/pull/21526/commits/8f5710fd0ac5173b577e5d00708485170b321bcc
https://github.com/bitcoin/bitcoin/pull/21526/commits/673a5bd3377929a0a6a62eda8b560e47bc2cca0c

Depends on D12279

Test Plan: ninja all check-all

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Subscribers: Fabien

Differential Revision: https://reviews.bitcoinabc.org/D12281

Details

Provenance
James O'Beirne <james.obeirne@pm.me>Authored on Apr 8 2021, 14:04
PiRKCommitted on Oct 19 2022, 11:34
PiRKPushed on Oct 19 2022, 11:34
Reviewer
Restricted Project
Differential Revision
D12281: validation: fix CheckBlockIndex for multiple chainstates
Parents
rABC84b17a35a312: chain: add and set ASSUMED_VALID_FLAG for assumeutxo
Branches
Unknown
Tags
Unknown