Dashmate local networks were failing after running for a longer period of time and/or with very short block times (e.g. 10sec on a 4th gen. i7, or 20sec in CI). #430 is also possibly related, and restarting the host without stopping dashmate first may also trigger the bug according to some reports. Core logs generally showed something similar to this:
2021-09-29T14:04:08.498538400Z 2021-09-29T14:04:08Z : The block database contains a block which appears to be from the future. This may be due to your computer's date and time being set incorrectly. Only rebuild the block database if you are sure that your computer's date and time are correct.
2021-09-29T14:04:08.498542600Z Please restart with -reindex or -reindex-chainstate to recover.
2021-09-29T14:04:08.498615500Z 2021-09-29T14:04:08Z Aborted block database rebuild. Exiting.
What was done?
The mocktime feature would simulate 2.5 minute blocks to ensure quorum requests still worked normally. When stopping and then restarting the network, the mocktime would not be set when scanning the block database, causing an error. This PR stores the blocktime to config on shutdown for local networks, and applies the mocktime (if present) to the config file on startup.
How Has This Been Tested?
Tested with local network
Tested to ensure testnet config stop/start still works
Needs testing in CI still
Breaking Changes
None
Checklist:
[x] I have performed a self-review of my own code
[x] I have commented my code, particularly in hard-to-understand areas
[x] I have added or updated relevant unit/integration/functional/e2e tests
[x] I have made corresponding changes to the documentation
For repository code-owners and collaborators only
[x] I have assigned this pull request to a milestone
Issue being fixed or feature implemented
Dashmate local networks were failing after running for a longer period of time and/or with very short block times (e.g. 10sec on a 4th gen. i7, or 20sec in CI). #430 is also possibly related, and restarting the host without stopping dashmate first may also trigger the bug according to some reports. Core logs generally showed something similar to this:
What was done?
The mocktime feature would simulate 2.5 minute blocks to ensure quorum requests still worked normally. When stopping and then restarting the network, the mocktime would not be set when scanning the block database, causing an error. This PR stores the blocktime to config on shutdown for local networks, and applies the mocktime (if present) to the config file on startup.
How Has This Been Tested?
Breaking Changes
None
Checklist:
For repository code-owners and collaborators only