-
Notifications
You must be signed in to change notification settings - Fork 660
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
Contract state should provide proofs from state root #2076
Comments
Here is how Ethereum does proofs for storage: |
Since we decided to use events differently (see Near-One/rainbow-bridge#12) this is no longer a blocker for EthDenver. |
One important point that people need is also proof of state non existence of some data. |
@ilblackdragon could you provide a use case? |
This issue has been automatically marked as stale because it has not had recent activity in the last 2 months. |
Use case is connecting to IBC.
Pretty much IBC is using proof of non existance for expiration of the
message communication - for example if message wasn't delivered and it
expired, the non existnance proof can provide evidence for the other chain
that message wasn't delivered and for example tokens can be released back.
…On Tue, Aug 31, 2021 at 4:55 PM stale[bot] ***@***.***> wrote:
This issue has been automatically marked as stale because it has not had
recent activity in the last 2 months.
It will be closed in 7 days if no further activity occurs.
Thank you for your contributions.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#2076 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABK27TPFSG2MY5ZE3EW5FDT7VTYJANCNFSM4KPNXYEA>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
--
Best regards,
Illia Polosukhin
|
This issue has been automatically marked as stale because it has not had recent activity in the last 2 months. |
This issue has been automatically marked as stale because it has not had recent activity in the last 2 months. |
how can i verify a contract's state provided by rpc? if it is specified to a single key-value pair, that would be helpful, thanks. |
Hi! As per (2) in https://gov.near.org/t/near-polkadot-using-ibc-trustless-bridging-requests/22807 we are in need of having this. I'd like to get some mentoring/tutoring and take the issue in my hands |
@bhc8521 you can get specific values on the state by calling an RPC method. Check it in the documentation: https://docs.near.org/docs/api/rpc/contracts#view-contract-state |
Replace TrieIterator::seek method with TrieIterator::seek_prefix which, as name suggests, limits the traversal to keys which match given prefix. That is, where seek used to return all keys no less than the query, seek_prefix will now further limit that set to keys which start with the query. Issue: #2076
Add include_proof to QueryRequest::ViewState requests and view_state runtime function. If set to true the proof of the response will be populated with nodes which can be used to verify the values. Otherwise, the proof won’t be included. For JSON RPC, the default is for the parameter to be set to false. Furthermore, deprecate empty proof fields in the query response. Those were historically always sent and it’s possible that clients exist which expects them to exist even though they were always empty in the past. Plan for the future is to include the `proof` field only when proof was requested. Issue: #2076
Replace TrieIterator::seek method with TrieIterator::seek_prefix which, as name suggests, limits the traversal to keys which match given prefix. That is, where seek used to return all keys no less than the query, seek_prefix will now further limit that set to keys which start with the query. Issue: #2076
Introduce visited_nodes to TrieIterator which records raw bytes of all the nodes the iterator visits. Those are then returned as proof in response to ViewState request. Since the exact nodes the iterator visited are included in the proof, it is therefore possible to verify all the values returned in the state. At the moment the proof is always included. Fixes: #2076
Add include_proof to QueryRequest::ViewState requests and view_state runtime function. If set to true the proof of the response will be populated with nodes which can be used to verify the values. Otherwise, the proof won’t be included. For JSON RPC, the default is for the parameter to be set to false. Furthermore, deprecate empty proof fields in the query response. Those were historically always sent and it’s possible that clients exist which expects them to exist even though they were always empty in the past. Plan for the future is to include the `proof` field only when proof was requested. Issue: #2076
@mfornet view_state does not return proofs, it returns empty vec instead. Or am I missing something? for example, some random contract on testnet:
UPD: If I pass
|
Another question is: how to work around error
You see, i've used But it seems that Thanks! |
Given contract state queried from the node, we need also to provide a proof from this state (or part of the state) to the root of the state root that's in the block header.
The text was updated successfully, but these errors were encountered: