Skip to content
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

State Proofs: Light client for lists #34

Open
ashcherbakov opened this issue Sep 10, 2020 · 0 comments
Open

State Proofs: Light client for lists #34

ashcherbakov opened this issue Sep 10, 2020 · 0 comments

Comments

@ashcherbakov
Copy link
Contributor

ashcherbakov commented Sep 10, 2020

Make sure that we can trust a result in cases where multiple results are returned (for example get-all-models).

Options
O1: Do not use Cosmos queriers to return multiple entries. Have an additional index in store <all-items-key>:<list of individual item keys>, so that get_all_xxx can be queried from store (and hence with common state proofs) and returns a list of individual item keys instead of the full item. Individual items cam be queried by get_xxx with the given item key as an input (with a common state proof again).
Note: need to think about pagination support.
O2: Support multi-proof on Cosmos-sdk level (consider contribution).

O2: Multi-Proof support at cosmos-sdk
The current Design: https://github.com/zigbee-alliance/distributed-compliance-ledger/blob/master/docs/design/multiproofs-design.md

Some notes (can be a bit outdated):

  1. https://github.com/cosmos/cosmos-sdk/blob/master/client/context/query.go#L102 - light client is used when QueryState is used for querying.
  2. if QueryWithData is called (as in all examples such as https://github.com/cosmos/sdk-tutorials/blob/master/nameservice/x/nameservice/client/rest/query.go#L19), then light client is not used and just gets the result from the corresponding business logic (keeper):
    https://github.com/cosmos/sdk-tutorials/blob/master/nameservice/x/nameservice/keeper/keeper.go#L35 or https://github.com/cosmos/sdk-tutorials/blob/master/nameservice/x/nameservice/keeper/keeper.go#L105
    https://github.com/cosmos/cosmos-sdk/blob/master/store/iavl/store.go#L193
    https://github.com/tendermint/iavl/blob/master/immutable_tree.go#L153
  3. There is a related issue: Subspace Query does not return Proof cosmos/cosmos-sdk#5241
  4. It can be fixed if
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants