Add routine to upgrade the block tree db to index block size
Summary:
This allows us to track the block size in the block index starting next version.
Pruning node will need to reindex.
The index upgrade is done in one batch as we don't expect the size of the batch to be absurdly big.
Test Plan:
Bump version to 0.22.8 by editing src/CMakeFiles.txt. Run the node on an already synced testnet folder. Check that it upgrades the bloc index on first launch, and do not do it again after that.
Run this on a prunned directory, and ensure it fails with an error message telling me to reindex.
Revert back to 0.22.7 and check that the node will not start due to an invalid version of the DB.
Reviewers: #bitcoin_abc, Fabien
Reviewed By: #bitcoin_abc, Fabien
Subscribers: Fabien
Differential Revision: https://reviews.bitcoinabc.org/D8319