Open calintat opened 1 year ago
This would be great. It's very frustrating to have to wait a lot of time just because I accidentally clicked something.
At the technical level, I was thinking that one possible approach to do this without killing the entire prover would be to store a mutable global bail_expensive_computations_asap
flag, and then define some kind of yield function with signature
fn yield() -> Result<(), ModelError>
, which just checks the flag,
Then everywhere in the codebase we could just do yield()?;
and propagate the failure upwards. This is inspired by what actually co-routine runtimes do for expensive computations.
Discussed this with @calintat with outcome that we would need to integrate seriously with the tokio runtime, and add a bunch of calls to yield_now in core, plus support for aborts.
I think tokio is pretty hard to integrate with WASM, at least last time I checked... good luck
As seen in #927, it is possible to get into a situation where an action is running for too long and there is no way to abort that without losing the proof state. I can think of two solutions:
This will hopefully be less relevant once we make collapse faster, but it would still be good to have.
Any thoughts?