paritytech / paritytech/json-rpc-interface-spec

Add storage subscriptions on the peer-to-peer layer

Open
#10 2 comments 1 reaction 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

I'm opening this issue here because this should lead to a new JSON-RPC function, but some changes to Substrate's networking would also be needed.

The idea is: instead of downloading storage items at each block, a light client can ask a full node to report when a certain list of storage items has been modified.
This can maybe be done in the block announce, or maybe this can be done in a request-response way. Care should be taken to avoid race conditions between block announces and storage changes announces.

Note that when a full node says that a storage item has been modified, we should only treat this as a hint. The storage item still needs to be downloaded and verified with a Merkle proof, to make sure that it has actually changed.

In the same way, if a full node says that a storage item has not been modified, it's not an actual guarantee that it hasn't been modified.
However if we're connected to multiple randomly-chosen peers, we can assume that at least one will properly report changes.
Additionally we could consider periodically downloading the storage item anyway, in case all our peers are actually malicious.

All in all, however, this should always be used only as a hint, for example if it is acceptable to show an information that is outdated.
If a user wants to be sure that a certain storage item has a certain value (e.g. the balance on their account), there is no other choice but to download the storage value and check the Merkle proof.

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

Start by scoping the new JSON-RPC function and the required Substrate networking changes, then resolve whether updates use block announcements or request-response. Define how race conditions, Merkle-proof verification, hints, and malicious peers are handled; done means an agreed protocol design and implementation scope.

Written by the indexing model from the issue text.

Assessment

Tech stack
json
Domain
api, distributed-systems, networking
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.