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.6k
Final tweaks for PoC-2 runtime upgrade #348
Merged
Merged
Changes from 6 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
8a7604d
Final tweaks for PoC-2 runtime upgrade
gavofyork efae055
Address grumble
gavofyork 459ddce
Avoid slow wasm
gavofyork c780209
New poc-2-era bootnodes
gavofyork 140a7b5
Fix warning
gavofyork cf3b78a
Typo
gavofyork f3a6896
Fix for allocation in wasm
gavofyork 48abe9b
Fix & runtimes.
gavofyork 31b3d7e
PoC-1 should be default.
gavofyork d54c322
Name testnet Krumme Lanke, update README
gavofyork d63772d
YML update
gavofyork 6cc0643
Use the right port
gavofyork File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Binary file modified
BIN
+693 Bytes
(100%)
demo/runtime/wasm/target/wasm32-unknown-unknown/release/demo_runtime.compact.wasm
Binary file not shown.
Binary file modified
BIN
+693 Bytes
(100%)
demo/runtime/wasm/target/wasm32-unknown-unknown/release/demo_runtime.wasm
Binary file not shown.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Binary file modified
BIN
+4.68 KB
(100%)
polkadot/runtime/wasm/target/wasm32-unknown-unknown/release/polkadot_runtime.compact.wasm
Binary file not shown.
Binary file modified
BIN
+4.68 KB
(100%)
polkadot/runtime/wasm/target/wasm32-unknown-unknown/release/polkadot_runtime.wasm
Binary file not shown.
Large diffs are not rendered by default.
Oops, something went wrong.
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
Binary file modified
BIN
-26 Bytes
(100%)
substrate/executor/wasm/target/wasm32-unknown-unknown/release/runtime_test.compact.wasm
Binary file not shown.
Binary file modified
BIN
-26 Bytes
(100%)
substrate/executor/wasm/target/wasm32-unknown-unknown/release/runtime_test.wasm
Binary file not shown.
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -39,6 +39,22 @@ impl<'a> Input for IncrementalInput<'a> { | |
| } | ||
| } | ||
|
|
||
| // TODO: only introduce this wrapper for types where it makes sense, ideally have it within the module declaration. | ||
|
|
||
| struct AppendZeroes<'a, I: Input + 'a> { | ||
| input: &'a mut I, | ||
| } | ||
|
|
||
| impl<'a, I: Input + 'a> Input for AppendZeroes<'a, I> { | ||
| fn read(&mut self, into: &mut [u8]) -> usize { | ||
| let r = self.input.read(into); | ||
| for z in &mut into[r..] { | ||
| *z = 0; | ||
| }; | ||
| into.len() | ||
| } | ||
| } | ||
|
|
||
| /// Return the value of the item in storage under `key`, or `None` if there is no explicit entry. | ||
| pub fn get<T: Codec + Sized>(key: &[u8]) -> Option<T> { | ||
| let key = twox_128(key); | ||
|
|
@@ -47,7 +63,7 @@ pub fn get<T: Codec + Sized>(key: &[u8]) -> Option<T> { | |
| key: &key[..], | ||
| pos: 0, | ||
| }; | ||
| Decode::decode(&mut input).expect("storage is not null, therefore must be a valid type") | ||
| Decode::decode(&mut AppendZeroes { input: &mut input } ).expect("storage is not null, therefore must be a valid type") | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Virtual dispatch here is really unnecessary and it might have a significant cost if it occurs on every call to |
||
| }) | ||
| } | ||
|
|
||
|
|
@@ -103,8 +119,7 @@ pub fn take_or_else<T: Codec + Sized, F: FnOnce() -> T>(key: &[u8], default_valu | |
|
|
||
| /// Check to see if `key` has an explicit entry in storage. | ||
| pub fn exists(key: &[u8]) -> bool { | ||
| let mut x = [0u8; 0]; | ||
| runtime_io::read_storage(&twox_128(key)[..], &mut x[..], 0).is_some() | ||
| runtime_io::exists_storage(&twox_128(key)[..]) | ||
| } | ||
|
|
||
| /// Ensure `key` has no explicit entry in storage. | ||
|
|
||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Binary file modified
BIN
+234 Bytes
(100%)
...st-runtime/wasm/target/wasm32-unknown-unknown/release/substrate_test_runtime.compact.wasm
Binary file not shown.
Binary file modified
BIN
+234 Bytes
(100%)
...trate/test-runtime/wasm/target/wasm32-unknown-unknown/release/substrate_test_runtime.wasm
Binary file not shown.
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.
Uh oh!
There was an error while loading. Please reload this page.
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.
will panic if the slice was completely filled, won't it?
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.
should just return an empty slice
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.
interesting artifact of the slicing syntax... that
&[][0]would panic but&[][0..]wouldn't.