Page MenuHomePhabricator

index: verify blocks data existence only once
Needs ReviewPublic

Authored by PiRK on Tue, Mar 4, 10:22.

Details

Reviewers
None
Group Reviewers
Restricted Project
Summary

At present, during init, we traverse the chain (once per index)
to confirm that all necessary blocks to sync each index up to
the current tip are present.

To make the process more efficient, we can fetch the oldest block
from the indexers and perform the chain data existence check from
that point only once.

This also moves the pruning violation check to the end of the
'loadinit' thread, which is where the reindex, block loading and
chain activation processes happen.

Making the node's startup process faster, allowing us to remove
the global g_indexes_ready_to_sync flag, and enabling the
execution of the pruning violation verification even when the
reindex or reindex-chainstate flags are enabled (which has being
skipped so far).

This concludes backport of core#27607
https://github.com/bitcoin/bitcoin/pull/27607/commits/225e213110602b4fd1d345167f5f92d26557f6c1

Depends on D17749

Test Plan

ninja all check check-functional-extended