This repository was archived by the owner on Nov 15, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Don't include :code by default in storage proofs
#5179
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* Adds test to verify that the runtime currently is always contained in the proof * Start passing the runtime wasm code from the outside * Fix compilation * More build fixes * Make the test work as expected now :) * Last fixes * Fixes benchmarks * Review feedback * Apply suggestions from code review Co-Authored-By: Sergei Pepyakin <[email protected]> * Review feedback * Fix compilation Co-authored-by: Sergei Pepyakin <[email protected]>
arkpar
reviewed
Mar 7, 2020
| Cow::Borrowed(code) | ||
| } | ||
| }; | ||
| let code = runtime_code.fetch_runtime_code().ok_or(WasmError::CodeNotFound)?; |
Member
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe fetch_runtime_code could return Cow so we don't have to clone here?
Member
Author
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
arkpar
approved these changes
Mar 9, 2020
General-Beck
pushed a commit
to General-Beck/substrate
that referenced
this pull request
Mar 12, 2020
* Don't include `:code` by default in storage proofs (paritytech#5060) * Adds test to verify that the runtime currently is always contained in the proof * Start passing the runtime wasm code from the outside * Fix compilation * More build fixes * Make the test work as expected now :) * Last fixes * Fixes benchmarks * Review feedback * Apply suggestions from code review Co-Authored-By: Sergei Pepyakin <[email protected]> * Review feedback * Fix compilation Co-authored-by: Sergei Pepyakin <[email protected]> * Fix compilation and change the way `RuntimeCode` works * Fix tests * Switch to `Cow` Co-authored-by: Benjamin Kampmann <[email protected]> Co-authored-by: Sergei Pepyakin <[email protected]>
General-Beck
pushed a commit
to General-Beck/substrate
that referenced
this pull request
Mar 17, 2020
* Don't include `:code` by default in storage proofs (paritytech#5060) * Adds test to verify that the runtime currently is always contained in the proof * Start passing the runtime wasm code from the outside * Fix compilation * More build fixes * Make the test work as expected now :) * Last fixes * Fixes benchmarks * Review feedback * Apply suggestions from code review Co-Authored-By: Sergei Pepyakin <[email protected]> * Review feedback * Fix compilation Co-authored-by: Sergei Pepyakin <[email protected]> * Fix compilation and change the way `RuntimeCode` works * Fix tests * Switch to `Cow` Co-authored-by: Benjamin Kampmann <[email protected]> Co-authored-by: Sergei Pepyakin <[email protected]>
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pr changes the behavior of automatically including :code in storage proofs. Before this pr, the :code was extracted by the wasm-executor before executing a function in the runtime. Now, the runtime code is passed as a parameter from the outside. This makes it possible to extract the :code from the backend, before the storage recorder tracks all accesses to the backend (which resulted in inclusion of :code in the proof).
However, the execution_proof function of Client still adds the :code to the proof, this is required by the light client, until #5047 is implemented.
Closes: paritytech/cumulus#8
New version of: #5060