koinos / koinos-chain

The chain microservice is responsible for the application of blocks, running of smart contracts, and applying transactions.
Other
15 stars 3 forks source link

[BUG]: `reset` does not reset chain after unclean shut down #644

Closed mvandeberg closed 2 years ago

mvandeberg commented 2 years ago

Is there an existing issue for this?

Current behavior

If chain does not shut down cleanly, it cannot start (as expected). But when you attempt to reset chain, it does not reset correctly.

Expected behavior

--reset=true should reset chain regardless of state.

Steps to reproduce

  1. Run chain
  2. SIGKILL chain
  3. Restart chain with --reset=true

Environment

- OS: Mac OS

Anything else?

./programs/koinos_chain/koinos_chain -a amqp://guest:guest@localhost:5672/ --reset=true

  _  __     _
 | |/ /___ (_)_ __   ___  ___
 | ' // _ \| | '_ \ / _ \/ __|
 | . \ (_) | | | | | (_) \__ \
 |_|\_\___/|_|_| |_|\___/|___/
          ...launching network
2022-04-05 10:18:01.004208 (chain.Koinos) [main.cpp:180] <info>: Chain ID: 0x1220f25adf01783093bc6dffd902c959b0c93a71ea21c5784acaa9ebd69926ca8fa6
2022-04-05 10:18:01.004856 (chain.Koinos) [main.cpp:181] <info>: Number of jobs: 8
2022-04-05 10:18:01.004998 (chain.Koinos) [controller.cpp:126] <info>: Initialized fizzy VM backend
2022-04-05 10:18:01.014690 (chain.Koinos) [main.cpp:257] <fatal>: An unexpected error has occurred: encountered unexpected object in initial state
2022-04-05 10:18:01.014714 (chain.Koinos) [main.cpp:209] <info>: Caught signal, shutting down...
mvandeberg commented 2 years ago

Unclean shutdown no longer corrupts the database.