AntelopeIO / leap

C++ implementation of the Antelope protocol
Other
116 stars 70 forks source link

IF: replay from before instant-finality transition #2141

Closed heifner closed 6 months ago

heifner commented 8 months ago

When replaying: nodeos option --replay-blockchain we clear state database and replay all blocks including reversible blocks in the fork database. The fork database is opened and consumed before replay. This causes an issue as the fork database needed during replay (until instant-finality transition) requires the legacy fork database. After instant-finality transition, it requires the new fork database.

On replay, need to delay consuming the fork database until after all blocks are replayed so the fork database can be opened and consumed in the correct mode with the expected data (block_state_legacy vs block_state).

The following tests current fail and are commented waiting on completion of this task. They should be uncommented in tests/CMakeLists.txt and verify they work as part of this effort.

heifner commented 7 months ago

Immediate fix for hotstuff_integration branch. Update replay logic to not use fork_database::chain_head and instead pass current and previous to replay_push_block. replay_push_block can return the new pushed block state. Likely better to create a replay_push_irreversible_block (returns newly created block state) and replay_push_reveserable_block (just updates chain_head).

heifner commented 7 months ago

Long term fix: https://github.com/AntelopeIO/spring/issues/7

greg7mdp commented 7 months ago

Uncomment test terminate-scenarios-if-test-hard_replay in tests/CMakeLists.txt when it works.

heifner commented 6 months ago

Resolved by AntelopeIO/leap#2287