feat: allow interrupts on proof generation #324
Closed
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.
This change adds support to interrupting and stopping the proof generation via a new RPC call that simply sets the
AtomicBool
on the service totrue
, resulting in the proof generation to be cancelled the same as in a shutdown.It might be useful to add a thread join on the handle the same way that the shutdown is doing, wdyt @poszu?
This doesn't help with cancelling the proof generation via FFI (which I think can still be used by the
post
go tool). I tried to also add that but got lost in the go->c->rust rabbit-hole (tried to inject a callback that would provide abool
from the go-code in order to stop the execution, the same way that is done currently with theAtomicBool
).Closes #81
Depends on https://github.com/spacemeshos/api/pull/366/files