AntelopeIO / spring

C++ implementation of the Antelope protocol with Savanna consensus
Other
5 stars 2 forks source link

`assert(!action_mroot.empty())` in `valid_t block_state::new_valid()` should not be needed #168

Closed linh2931 closed 4 months ago

linh2931 commented 4 months ago

When running eosio_system_part1_tests/stake_unstake under Savanna,

I got unit_test: .../libraries/chain/block_state.cpp:283: eosio::chain::valid_t eosio::chain::block_state::new_valid(const eosio::chain::block_header_state&, const digest_type&, const digest_type&) const: Assertion!action_mroot.empty()' failed``

https://github.com/AntelopeIO/spring/blob/a7816091b06fac4702e0c131cfe269f08df9cdd7/libraries/chain/block_state.cpp#L283 should not be needed, as it is possible a block is empty.

arhag commented 4 months ago

We should not assume that we always have some action receipt in the block. The onblock can fail as part of the protocol in which case an empty block would have no action receipts.

We should create a new test with a test contract that only causes onblock to fail to reproduce this problem without all the other stuff that the system contract tests bring in.