-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add chainHead_unstable_wasmQuery #4
Comments
Some questions/notes from an offline conversation about this issue:
Is WebAssembly the right solution?Some reasons that it might be:
How do users form the wasm blobs?
Does this problem require a tiny query language?
|
Some notes:
|
That's precisely the use case why this function is desired! |
Cool stuff! Pushing this idea a little further, the wasm blob could be long lived. It could then be notified of storage updates and send back some chunk of data (only meaningful when using long lived connection like WebSockets). How technically realistic would that be? |
In order to add this to the API, it could be as simple as adding an additional optional However I don't like the fact that you have to send the whole Wasm bytecode every single time and that the server would have to maintain an LRU cache of the |
As far as I can tell, there are only two tricky points to solve:
Having limits on the server is pointless if the client doesn't know what these limits are, because the client needs to make sure to be below these limits. Meaning that we have to precisely specify these limits. For the maximum allowed gas, this is tricky. |
Add a JSON-RPC function that allows you to pass a user-chosen Wasm program that has access to the chain storage and builds a return value.
The advantage is that this program could be sent over the network to a full node, which executes it, returns a proof, and sends the proof back to a light client, which then runs the program again to verify the proof.
Things that should be done:
Neither of these two things strictly needs to be done before we add the JSON-RPC function.
A light client can emulate this function by executing the Wasm program locally and doing a storage query whenever a key is read by the program. This is not great but it works.
The text was updated successfully, but these errors were encountered: