VeriBlock / alt-integration-cpp

Libraries for leveraging VeriBlock Proof-Of-Proof blockchain technology.
https://veriblock.github.io/alt-integration-cpp/
Other
6 stars 6 forks source link

Assert failed inside loadBlockInner #908

Closed Warchant closed 2 years ago

Warchant commented 2 years ago
2021-12-15T08:59:15Z [alt-cpp] [warn] loadTree: Loading 2016 BTC blocks with tip 0000000000000000000c57d98837a8c297accb8cee7f5c3c3cb751a8ec74aba8
2021-12-15T08:59:15Z [alt-cpp] [critical] loadBlockInner: Assertion failed at /home/runner/work/vbk-ri-btc/vbk-ri-btc/depends/work/build/x86_64-w64-mingw32/veriblock-pop-cpp/0ad18f53e7778c30ef56696ea507c7cc2a0f9cf3-f28c264663d/include/veriblock/pop/blockchain/base_block_tree.hpp:636 inside loadBlockInner:
index.height >= root.getHeight()
Blocks can be forward connected after root only. index.height: 708156, root.height: 711392
Mr-Leshiy commented 2 years ago

Have investigated this issue and for this moment it most likely it was a storage corruption. root.height == 711392 it is a valid BTC root height.

const int mainnetBTCstartHeight=711392;

https://github.com/VeriBlock/vbk-ri-btc/blob/47363b076956d0f7f8a3692ecd3ca4b889182901/src/vbk/bootstraps-mainnet.cpp#L9

index.height == 708156 it is definitely invalid height of the block.

Mr-Leshiy commented 2 years ago

At this point I have updated logging this situation and do not make assert failing, just return a failure of the loadBlockInner function, so as the result daemon should ask for reindex.

Warchant commented 2 years ago

@Leonardiae