Page MenuHomePhabricator

validation: don't modify genesis during snapshot load
ClosedPublic

Authored by PiRK on Oct 19 2022, 09:09.

Details

Reviewers
Fabien
Group Reviewers
Restricted Project
Commits
rABCbe0f1881ef12: validation: don't modify genesis during snapshot load
Summary

Avoid modifying the genesis block index entry during snapshot load. This
is because, in a future change that fixes LoadBlockIndex for UTXO
snapshots, we detect block index entries that are reliant on
assumed-valid ancestors and treat them specially.

Since the genesis block doesn't have BLOCK_VALID_SCRIPTS, it would be
erroneously marked BLOCK_ASSUMED_VALID during snapshot load if we didn't
skip it here. This would cause a "setBlockIndexCandidates() empty"
assertion to be tripped since all block index entries would be marked
assume-valid due to genesis, which is never re-validated.

There's probably no good reason to modify the genesis block index entry
during snapshot load anyway...

This is a partial backport of core#23174
https://github.com/bitcoin/bitcoin/pull/23174/commits/d0c6e61f5dd3b6af818459d9d03b7ba316c5a3f7

Depends on D12301

Test Plan

ninja all check-all

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable