Fork main computation in VDF daemon in separate process
Context
Currently, starting this computation blocks the daemon until its completion (which can take 12-14h). This MR changes this by forking a new process in which the computation is executed, allowing the daemon to still consume new blocks. The main benefit is that the VDF computation can be aborted if the end of the cycle is reached (which could happen if the VDF daemon is launched late in a cycle) or if another daemon managed to inject first.
It is also a major refactoring of the VDF daemon which improves the way the internal state of the daemon is managed, separate a critical helper function into a different module in order to facilitate its specification and testing, and improves documentation.
Fixes #3781 (closed)
Manually testing the MR
The Tezt test includes a scenario where the daemon is launched late in the cycle and the computation needs to be cancelled.
Checklist
-
Document the interface of any function added or modified (see the coding guidelines) -
Document any change to the user interface, including configuration parameters (see node configuration) -
Provide automatic testing (see the testing guide). -
For new features and bug fixes, add an item in the appropriate changelog ( docs/protocols/alpha.rstfor the protocol and the environment,CHANGES.rstat the root of the repository for everything else). -
Select suitable reviewers using the Reviewersfield below. -
Select as Assigneethe next person who should take action on that MR