HomePhabricator

Move CheckBlockIndex() from Chainstate to ChainstateManager

Description

Move CheckBlockIndex() from Chainstate to ChainstateManager

Summary:
Also rewrite CheckBlockIndex() to perform tests on all chainstates.

This increases sanity-check coverage, as any place in our code where we were
invoke CheckBlockIndex() on a single chainstate will now invoke the sanity
checks on all chainstates.

This change also tightens up the checks on setBlockIndexCandidates and
mapBlocksUnlinked, to more precisely match what we aim for even in the presence
of assumed-valid blocks.

This is a partial backport of core#27746
https://github.com/bitcoin/bitcoin/pull/27746/commits/3556b850221bc0e597d7dd749d4d47ab58dc8083

Depends on D17536

Test Plan: ninja all check-all

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

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

Details

Provenance
Suhas Daftuar <sdaftuar@chaincode.com>Authored on Jun 18 2023, 16:33
PiRKCommitted on Fri, Jan 17, 08:07
PiRKPushed on Fri, Jan 17, 08:07
Reviewer
Restricted Project
Differential Revision
D17537: Move CheckBlockIndex() from Chainstate to ChainstateManager
Parents
rABC781f67df62a8: Documentation improvements for assumeutxo
Branches
Unknown
Tags
Unknown