zkevm-chain
zkevm-chain copied to clipboard
prover/rpc: Add the ability to abort a running prover task
Context: I haven't yet looked for a way to interrupt a busy thread - especially one inside the tokyo worker pool without breaking some stuff. Because the prover code will eventually run long inside a synchronous context and I don't know yet if interrupting threads like this will lead to memory leaks or similar.
Now that the prover is no longer in this repo after https://github.com/privacy-scaling-explorations/zkevm-circuits/pull/714 maybe this issue should be transferred to the zkevm-chain
repository?
@AronisAt79 I just tested this and aborting a long running sync task isn't possible to do cleanly . Another solution is that we spawn a new process instead and piping the result back However, that will break sharing the precomputed/cached proving keys, unless we use shared memory but that involves unsafe rust as far as I know. I will look into this too,
If we really need this someday we can spawn dedicated prover processes from within the prover daemon. Given this has some real drawbacks mentioned above, I put it in the icebox for now