Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.

Conversation

@bkchr
Copy link
Member

@bkchr bkchr commented Mar 7, 2020

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

gnunicorn and others added 4 commits March 6, 2020 14:09
* 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]>
@bkchr bkchr added A0-please_review Pull request needs code review. B0-silent Changes should not be mentioned in any release notes labels Mar 7, 2020
@bkchr bkchr requested a review from arkpar March 7, 2020 00:59
Cow::Borrowed(code)
}
};
let code = runtime_code.fetch_runtime_code().ok_or(WasmError::CodeNotFound)?;
Copy link
Member

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?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@arkpar arkpar added B1-apinoteworthy and removed B0-silent Changes should not be mentioned in any release notes labels Mar 7, 2020
@bkchr bkchr added A8-looksgood and removed A0-please_review Pull request needs code review. labels Mar 10, 2020
@bkchr bkchr added this to the 2.0 milestone Mar 10, 2020
@gavofyork gavofyork merged commit f1419b1 into master Mar 10, 2020
@gavofyork gavofyork deleted the bkchr-runtime-code-2 branch March 10, 2020 10:13
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.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CODE is part of the proof

5 participants