feat: make transaction execution asynchronous#1636
feat: make transaction execution asynchronous#1636PhilippGackstatter wants to merge 29 commits intonextfrom
Conversation
|
I've updated the code to incorporate 0xMiden/miden-vm#2026, thanks @plafer! Some transactions are executing fine now, but there are two things that I noticed:
or a slightly different message: Since these tests were executing fine on the slow processor, my current guess is that this is a bug in the fast processor, but that could be wrong. |
This is somewhat discussed in 0xMiden/miden-vm#2021. Although note that in 1-2 releases
Hmmm, this is due to whatever code you're running doing a lot of "superfluous" However you're hitting underflow - which as mentioned above suggests that you Would you be able to identify spots which drop values that aren't there? Or anything equivalent, such as running |
I would probably bump up the "undeflow space" in the |
|
@PhilippGackstatter with 0xMiden/miden-vm#2035 hopefully this resolves this issue - although it would be good for someone to look into why you were hitting the underflow in the first place |
Thank you! It resolved all stack underflow issues for now. Thanks for explaining the issue. I think we're not following our call convention in many tests. So often we are not padding the stack before a CI is green now and so @drahnr if you want, you can continue with this one. Let me know if I can help in any way! |
I think the next steps here are:
Right? |
|
Conditional compilation is now in Once this is done: |
|
I rebased my changes on Friday (or Thursday) onto |
|
@igamigo I think this PR is in a state where you can try it in the client. I don't know of a good way to test whether the current state works for Wasm or not, other than creating an entire Wasm project for this (but maybe we should do this at least for this PR). |
|
works ( |
I think one of the goals was to get rid of spinning up a separate |
It's here |
Seems to work fine on the client as well! Draft here: 0xMiden/miden-client#1104. Left some notes with a few things I encountered, but nothing major.
My idea was to get rid of the workarounds around the web SDK authentication methods (aka, try to get data from indexedDB directly on the |
Yeah, if we can make async calls to indexdDB from within the authenticator, that should be sufficient PoC. Another potential thing to check is whether we can make requests to a service worker (i believe). I think this is how @evanmarshall and @dagarcia7 were planning to implement signature request handling. |
Yes, that's exactly what we need. |
Not entirely sure what this flow should look like, is the idea that we can request signatures to the worker which in turn should read from IndexedDB? In this case wouldn't this have been doable before as well? |
My understanding is that the service worker would keep the private keys in its internal memory and so they may not be in the indexdDB. But either way, communication with the service worker is also asynchronous (similar to indexdDB) and so we couldn't do it before. @evanmarshall can probably correct me if I'm wrong on any of the above points. |
This still doesn't work due to |
This is correct. For support, we'll need to expose signatures in the client so the vault can use them directly: 0xMiden/miden-client#1107 and we'll be working on an issue that enables passing the callback through the web client to the transaction authenticator. We'll also need to support both use cases where someone is using IndexedDB to store the keys because this makes sense to have in the default web client, but in the case of the wallet, we do not want the secret keys stored in IndexedDB. |
|
Just to note these down. Once we merge this PR, I think there are some follow-ups:
|
|
Let's update this PR to use v0.17.0 VM crates directly and also bring it up to date with |
|
Closing this in favor of #1705. |
Experiment built on top of miden-vm's
async-experimentalbranch.required for #1162