Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add missing logic to handle stopped signal in one-weso proofs.
For one-weso proofs, vdf_client launches two threads to do its work. One
repeatedly squares until a given number of iterations, the second waits
until the first is done squaring and then computes a proof.
The squaring-thread properly handles the "stopped" signal and aborts
early, if signaled. That way, it never reaches the targeted iterations.
The 1weso-thread waits until the target iterations are reached, but does
not handle the "stopped" signal. Thus, for stopped iters, it waits
infinitely.
This situation regularly occurs, vdf_client is running for a bluebox
timelord. Whenever the timelord (Python) process restarts, network
communication errors out, killing the squaring thread. But instead of
the while vdf_client exiting (which would lead to the timelord launcher
cleanly restarting a fresh one), the 1weso thread keeps the vdf_client
alive infinitely.
The fix itself is just as it's done for 2weso proofs and elsewhere. The
1weso caller already handles stopped correctly, so 1weso can just
return a default-constructed proof.