paritytech / paritytech/json-rpc-interface-spec

Add chainHead_unstable_wasmQuery

Open
#4 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
No language data
Stars
37
Forks
6
PR merge metrics
No merged PRs in 30d

Description

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:

  • Add the networking protocol between the light and full node.
  • Figure out how to let frontend JS developers easily create these Wasm programs. We probably don't want to ask them to setup a complicated Rust toolchain and let them figure out how to optimize the size of the Wasm program and all.

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.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue names the chainHead_unstable_wasmQuery JSON-RPC entry point but no files or tests. Start by locating the JSON-RPC definitions and existing light/full-node interfaces, then trace how Wasm programs access chain storage. Done means the function’s execution and return behavior are specified and implemented; networking and frontend tooling are listed as follow-up work.

Written by the indexing model from the issue text.

Assessment

Tech stack
wasm
Domain
api, blockchain, distributed-systems, networking
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.