Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
9ccf26e
In progress, runtime io must switch to future proof root +
cheme Nov 18, 2019
a0f3818
Switch interface, sr-io seems ok, rpc could use similar interface to
cheme Nov 19, 2019
41c5020
test from previous implementation.
cheme Nov 20, 2019
6eb0414
fix proving test.
cheme Nov 20, 2019
e8e72fc
Restore Keyspacedb from other branch, only apply to child trie.
cheme Nov 20, 2019
88ffbc4
Removing unneeded child_info from child root (child info are stored
cheme Nov 20, 2019
435fcb2
Switch rpc to use same format as ext: more future proof.
cheme Nov 20, 2019
b8c7e37
use root from child info for trie backend essence.
cheme Nov 20, 2019
ee43955
Breaking long lines.
cheme Nov 20, 2019
fe285ae
Merge branch 'master' into child_uuid_step1
cheme Nov 21, 2019
a8818d9
Update doc and clean pr a bit.
cheme Nov 21, 2019
9873dcb
Merge branch 'master' into child_uuid_step1
cheme Nov 23, 2019
609a847
Merge branch 'master' into child_uuid_step1
cheme Nov 25, 2019
7254f6c
Merge branch 'master' into child_uuid_step1
cheme Nov 27, 2019
cac9330
fix error type
cheme Nov 27, 2019
c3b943c
Merge branch 'master' into child_uuid_step1
cheme Nov 28, 2019
c05bc80
Restore removed doc on merge and update sr-io doc.
cheme Nov 28, 2019
cd1e343
Merge branch 'master' into child_uuid_step1
cheme Nov 29, 2019
bdff843
Switch child storage api to use directly unique id, if managed id
cheme Nov 29, 2019
9ce77bb
Clean deprecated host interface from child.
cheme Nov 29, 2019
92c7864
Removing assertion on child info (can fail depending on root
cheme Nov 29, 2019
fc91068
merging child info in the overlay when possible.
cheme Nov 29, 2019
cdabca3
child iteration by prefix using child_info.
cheme Nov 29, 2019
783f389
Merge branch 'master' into child_uuid_step1
cheme Dec 2, 2019
d4c7334
Using ChainInfo in frame support. ChainInfo gets redesign to avoid
cheme Dec 2, 2019
64f4084
Add length of root to the data of child info.
cheme Dec 2, 2019
a87bd48
comments
cheme Dec 2, 2019
68712f9
Encode compact.
cheme Dec 2, 2019
3db467e
Remove child info with root.
cheme Dec 3, 2019
a7425cc
Merge branch 'master' into child_uuid_step1
cheme Dec 3, 2019
8e2b8b9
Fix try_update condition.
cheme Dec 3, 2019
5d74151
Comment Ext child root caching.
cheme Dec 3, 2019
0ba3da5
Replace tuples by struct with field
cheme Dec 5, 2019
d924187
remove StorageTuple alias.
cheme Dec 5, 2019
43da346
Merge branch 'master' into child_uuid_step1
cheme Dec 5, 2019
ead5856
Fix doc tests, and remove StorageOverlay and ChildStorageOverlay
cheme Dec 6, 2019
9e05542
Merge branch 'master' into child_uuid_step1
cheme Dec 8, 2019
6f107d0
Merge branch 'master' into child_uuid_step1
cheme Dec 10, 2019
17dd44d
Merge branch 'master' into child_uuid_step1
cheme Dec 11, 2019
0aaeefa
Merge branch 'master' into child_uuid_step1
cheme Dec 11, 2019
489c9f9
Merge branch 'master' into child_uuid_step1
cheme Dec 11, 2019
c58b539
Merge branch 'master' into child_uuid_step1
cheme Dec 13, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Removing unneeded child_info from child root (child info are stored
if things changed, otherwhise the root does not change).
  • Loading branch information
cheme committed Nov 20, 2019
commit 88ffbc49ca7738640c356ca41953fd0276e57e31
2 changes: 0 additions & 2 deletions client/executor/src/deprecated_host_interface.rs
Original file line number Diff line number Diff line change
Expand Up @@ -451,8 +451,6 @@ impl_wasm_host_interface! {
// This can only work with archive mode.
let value = runtime_io::storage::child_root(
&storage_key,
&[],
ChildType::CryptoUniqueId as u32,
);

let offset = context.allocate_memory(value.len() as u32)?;
Expand Down
1 change: 0 additions & 1 deletion paint/contracts/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -827,7 +827,6 @@ impl<T: Trait> Module<T> {
// is not this block as it has been checked earlier.
&child::child_root(
&origin_contract.trie_id,
origin_contract.child_trie_unique_id(),
)[..],
code_hash,
);
Expand Down
1 change: 0 additions & 1 deletion paint/contracts/src/rent.rs
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,6 @@ fn try_evict_or_and_pay_rent<T: Trait>(
// Note: this operation is heavy.
let child_storage_root = child::child_root(
&contract.trie_id,
contract.child_trie_unique_id(),
);

let tombstone = <TombstoneContractInfo<T>>::new(
Expand Down
3 changes: 0 additions & 3 deletions paint/support/src/storage/child.rs
Original file line number Diff line number Diff line change
Expand Up @@ -220,11 +220,8 @@ pub fn put_raw(
/// Calculate current child root value.
pub fn child_root(
storage_key: &[u8],
unique_id: Option<&[u8]>,
) -> Vec<u8> {
runtime_io::storage::child_root(
storage_key,
unique_id.expect(SOME),
primitives::storage::ChildType::CryptoUniqueId as u32,
)
}
1 change: 0 additions & 1 deletion primitives/externalities/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,6 @@ pub trait Externalities: ExtensionStore {
fn child_storage_root(
&mut self,
storage_key: ChildStorageKey,
child_info: ChildInfo,
) -> Vec<u8>;

/// Get the change trie root of the current storage overlay at a block with given parent.
Expand Down
6 changes: 1 addition & 5 deletions primitives/sr-io/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -245,13 +245,9 @@ pub trait Storage {
fn child_root(
&mut self,
child_storage_key: &[u8],
child_definition: &[u8],
child_type: u32,
) -> Vec<u8> {
let storage_key = child_storage_key_or_panic(child_storage_key);
let child_info = ChildInfo::resolve_child_info(child_type, child_definition)
.expect("Invalid child definition");
self.child_storage_root(storage_key, child_info)
self.child_storage_root(storage_key)
}

/// "Commit" all existing operations and get the resulting storage change root.
Expand Down
4 changes: 0 additions & 4 deletions primitives/state-machine/src/basic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -232,12 +232,9 @@ impl Externalities for BasicExternalities {
// type of child trie support.
let empty_hash = default_child_trie_root::<Layout<Blake2Hasher>>(&[]);
for storage_key in keys {
let child_info = self.children.get(storage_key.as_slice()).as_ref()
.expect("key fetch above").1.to_owned();
let child_root = self.child_storage_root(
ChildStorageKey::from_slice(storage_key.as_slice())
.expect("Map only feed by valid keys; qed"),
child_info.as_ref(),
);
if &empty_hash[..] == &child_root[..] {
top.remove(storage_key.as_slice());
Expand All @@ -252,7 +249,6 @@ impl Externalities for BasicExternalities {
fn child_storage_root(
&mut self,
storage_key: ChildStorageKey,
_child_info: ChildInfo,
) -> Vec<u8> {
if let Some(child) = self.children.get(storage_key.as_ref()) {
let delta = child.0.clone().into_iter().map(|(k, v)| (k, Some(v)));
Expand Down
2 changes: 0 additions & 2 deletions primitives/state-machine/src/ext.rs
Original file line number Diff line number Diff line change
Expand Up @@ -491,11 +491,9 @@ where
root
}

// TODO EMCH seems like child_info parameter is useless here!!!
fn child_storage_root(
&mut self,
storage_key: ChildStorageKey,
_child_info: ChildInfo,
) -> Vec<u8> {
let _guard = panic_handler::AbortGuard::force_abort();
if self.storage_transaction.is_some() {
Expand Down