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

Perform impact analysis of juno_getContractStorageProof method #1946

Closed
wojciechos opened this issue Jul 12, 2024 · 2 comments
Closed

Perform impact analysis of juno_getContractStorageProof method #1946

wojciechos opened this issue Jul 12, 2024 · 2 comments
Assignees
Milestone

Comments

@wojciechos
Copy link
Contributor

Add method similar to pathfinder one to get proof:

"name": "pathfinder_getProof",
"summary": "Returns merkle proofs of a contract's storage state",
"description": "This method returns merkle proofs for a contract's storage. This allows you to verify a contract's state for a specific Starknet block."
@stranger80 stranger80 added this to the v0.12.0 milestone Jul 15, 2024
@stranger80 stranger80 changed the title Add juno_getProof method Implement juno_getContractStorageProof method Jul 15, 2024
@stranger80 stranger80 changed the title Implement juno_getContractStorageProof method Perform impact analysis of juno_getContractStorageProof method Jul 15, 2024
@rianhughes
Copy link
Contributor

Context
Pathfinder has implemented a pathfinder_getProof endpoint, that lets anyone retrieve a merkle proof for the contract storage trie given (contract address, key, block id). Pathfinder can serve this data for any historical state. Kakarot have asked the Juno team if they plan to support such a method as well, as they want to implement a modified version of eth_getProof.

Impact on Juno
To support this method Juno would need to be able to generate merkle-proofs for the contract storage trie at any point in history. Juno can retrieve historical values of the trie at any point, but not the entire historical trie. Also, given a trie, Juno does have logic to generate the merkle-proofs. So the main task would be to implement some logic to generate the entire historical contract storage trie at any point. Once we have this, we can generate proofs for the trie, and expose it over rpc.

Other factors to consider
There is no agreed upon spec for this endpoint, which might cause issues if users expect consistent behaviour between the different clients.
Juno would presumably use pathfinders endpoint as a reference, but pathfinder are planning to make significant modifications to their pathfinder_getProof endpoint. An agreed upon spec would also be useful here.
This will overlap with the Snapsync feature, since it will need to serve historical contract storage tries.

@stranger80
Copy link

Equivelant method being added to RPC v0.8.0. Closing this issue.

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

No branches or pull requests

3 participants