You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In RPC v0.8, it is not possible to request a contract's storage state root without also requesting storage values. This is a regression from previous functionality used by SNOS (pathfinder_getStorageProof) and breaks certain use cases where only the root hash is needed.
Previous Behavior (pathfinder_getStorageProof)
The ContractData struct previously provided both pieces of information:
Importantly, the endpoint accepted an empty array of keys, making it possible to retrieve just the root for contracts without storage keys (e.g., newly deployed but unused contracts).
Current Implementation (v0.8)
The new modular approach separates proofs into distinct components:
Issue Details
In the current implementation there's no way to retrieve the root when there are no storage keys to request.
This limitation breaks functionality for cases where:
Only the contract state root is needed
Working with newly deployed contracts without storage
Verifying contract existence without needing storage values
Proposed Solution
We need to modify the RPC to allow:
Requesting contract state root independently of storage values
Maintaining backward compatibility with existing storage proof requests
Preserving the modular approach of v0.8
On the pathfinder, there's an open PR with a temporary solution to this issue: eqlabs/pathfinder#2463
It checks if there are storage keys on the request, and if not, sends back a single node with the node hash (the root). This works, but requires some ugly checks to confirm what kind of data is being received and there's no good explanation for this without the proper context, making the code hard to maintain.
The text was updated successfully, but these errors were encountered:
GMKrieger
changed the title
Unable to Request Contract Storage State Root Without Storage Values in RPC v0.8
Unable to request contract storage state root without storage values in RPC v0.8
Dec 30, 2024
Problem Statement
In RPC v0.8, it is not possible to request a contract's storage state root without also requesting storage values. This is a regression from previous functionality used by SNOS (pathfinder_getStorageProof) and breaks certain use cases where only the root hash is needed.
Previous Behavior (pathfinder_getStorageProof)
The ContractData struct previously provided both pieces of information:
Importantly, the endpoint accepted an empty array of keys, making it possible to retrieve just the root for contracts without storage keys (e.g., newly deployed but unused contracts).
Current Implementation (v0.8)
The new modular approach separates proofs into distinct components:
Issue Details
In the current implementation there's no way to retrieve the root when there are no storage keys to request.
This limitation breaks functionality for cases where:
Proposed Solution
We need to modify the RPC to allow:
On the pathfinder, there's an open PR with a temporary solution to this issue: eqlabs/pathfinder#2463
It checks if there are storage keys on the request, and if not, sends back a single node with the node hash (the root). This works, but requires some ugly checks to confirm what kind of data is being received and there's no good explanation for this without the proper context, making the code hard to maintain.
The text was updated successfully, but these errors were encountered: