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

RPC08 - starknet_getStorageProof #2180

Open
kirugan opened this issue Sep 25, 2024 · 3 comments · May be fixed by #2194
Open

RPC08 - starknet_getStorageProof #2180

kirugan opened this issue Sep 25, 2024 · 3 comments · May be fixed by #2194
Assignees
Labels

Comments

@kirugan
Copy link
Contributor

kirugan commented Sep 25, 2024

Specification - https://github.com/starkware-libs/starknet-specs/blob/v0.8.0-rc0/api/starknet_api_openrpc.json#L910

Changes in PR starkware-libs/starknet-specs#232

@kirugan kirugan mentioned this issue Sep 25, 2024
15 tasks
@estherbreath
Copy link

@kirugan
I am a smart contract and a full stack developer.
I would like to handle this issue, please

@kirugan
Copy link
Contributor Author

kirugan commented Oct 2, 2024

@estherbreath please consider other issues to implement. This one will be covered by someone from our team.

@pnowosie pnowosie linked a pull request Oct 3, 2024 that will close this issue
@pnowosie
Copy link
Contributor

pnowosie commented Oct 3, 2024

In my opinion this method should be defined better or the result maybe be meaningless
What is a problem?

TL;DR

Inclusion proofs are linked with a particular state and info about the state is missing in the response

Problem description

  • It requests inclusion proofs to some of the leaves of [class / contract /...] trie but don't specify the state anyhow which assumes current head's state
  • it receives the merkle paths (the inclusion proof) which is strictly linked to some state hence the block, global storage commitment, but there is no information about them.

Imagine you request some class inclusion proof and the result is merkle paths that calculates to the class trie root.
Class trie root mean nothing without other informations such as: contracts trie root & global storage commitment and block id which allows to verify the proof.

Therefore I propose that juno will return these (additional to the spec) informations.
The specification method's result is here.

Juno should respond with the following:

  "result": {
    "name": "result",
    "description": "The contract's nonce at the requested state",
    "schema": {
      "type": "object",
      "properties": {
        "classes_proof": {
          "$ref": "#/components/schemas/NODE_HASH_TO_NODE_MAPPING"
        },
        "contracts_proof": {
          "$ref": "#/components/schemas/NODE_HASH_TO_NODE_MAPPING"
        },
        "contracts_storage_proofs": {
          "type": "array",
          "items": {
            "$ref": "#/components/schemas/NODE_HASH_TO_NODE_MAPPING"
         },

  <!-- ADDITIONAL INFORMATIONS STARTS HERE 👇 
        "block_hash": {
          "$ref": "#/components/schemas/FELT"
        },
        "global_state_root": {
          "$ref": "#/components/schemas/FELT"
        },
        "contract_trie_root": {
          "$ref": "#/components/schemas/FELT"
        },
        "class_trie_root": {
          "$ref": "#/components/schemas/FELT"
        },
      }
    }
  }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants