skalenetwork / skale-consensus

Running the very core of SKL network, SKALE BFT consensus is universal, modern, modular, high-performance, asynchronous, provably-secure, agent-based Proof-of-Stake blockchain consensus engine in C++ 17. Includes provably secure embedded Oracle. Used by SKALE elastic blockchains. Easy and flexible enough to implement your own blockchain or smart contract platform. BLS signatures and Binary Asynchronous Consensus are main building blocks.
https://docs.skale.network/technology/consensus-spec
GNU Affero General Public License v3.0
78 stars 32 forks source link

"UnknownBlockNumberInRootDB" exception during requesting eth_getBalacnce to 0 block on arhival node #827

Open oleksandrSydorenkoJ opened 6 months ago

oleksandrSydorenkoJ commented 6 months ago

Versions skalenetwork/schain:3.18.0-beta.0-historic

Preconditions: Active schain with connected archival node and access to docker containers logs

Steps to reproduce:

  1. Send eth_getBalance("0x<address>", 0) call to archival node
    curl -X POST --data '{"id":48,"jsonrpc":"2.0","method":"eth_getBalance","params":["0xd2ba3e0000000000000000000000000000000000","0"]}' http://1.1.1.1:10195
  2. check skaled logs on the archival node

Expected behavior Skaled should return the actual balance for the address in the 0 block without any errors logs in a docker container.

Actual state: Skaled returns the actual balance for the 0-block, but prints the "UnknownBlockNumberInRootDB" error in skaled logs.

Logs

 2024-02-02 18:01:23.994928   http://localhost:32892 >>> {"id":48,"jsonrpc":"2.0","method":"eth_getBalance","params":["0xd2ba3e0000000000000000000000000000000000","0x5f5e100"]}
2024-02-02 18:01:23.998884   

    Import Failure     /home/s5/actions-runner-1/_work/skaled/skaled/libhistoric/HistoricState.cpp(280): Throw in function void dev::eth::HistoricState::setRootByBlockNumber(uint64_t)
Dynamic exception type: boost::exception_detail::clone_impl<dev::eth::UnknownBlockNumberInRootDB>
[skale::error::tag_block*] = [ type: std::vector<unsigned char, std::allocator<unsigned char> >, size: 24, dump: b0 38 01 bc 00 7f 00 00 8b 3a 01 bc 00 7f 00 00 ]

                       Bad Block #00091556.cf785208…                      

2024-02-02 18:01:23.999008   http://localhost:32892 <<< {"id":48,"jsonrpc":"2.0","result":"0x0"}