Page MenuHomePhabricator

index: don't commit state in BaseIndex::Rewind
ClosedPublic

Authored by PiRK on Sep 10 2025, 16:02.

Details

Reviewers
Fabien
Group Reviewers
Restricted Project
Commits
rABCf4bf299b8c03: index: don't commit state in BaseIndex::Rewind
Summary

The committed state of an index should never
be ahead of the flushed chainstate. Otherwise, in the case
of an unclean shutdown, the blocks necessary to revert
from the prematurely committed state would not be
available, which would corrupt the coinstatsindex in particular.
Instead, the index state will be committed with the next
ChainStateFlushed notification.

Test index with an unclean restart after a reorg

This is a backport of core#33212
and partial backport of core#32069 (for TestNode.kill_process)
and partial backport of https://github.com/bitcoin/bitcoin/pull/26606/commits/0b753156ce60c29efb2386954ba7555ad8f642f5 (for passing a expected_ret_code argument to TestNode.wait_until_stopped)

Depends on D18598

Test Plan

ninja all check-all

Diff Detail

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