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

avoid key collision on child trie and proof on child trie #2209

Closed
wants to merge 142 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
142 commits
Select commit Hold shift + click to select a range
f6c4bb2
Straight forward move of trie related only change from child-trie-soft
cheme Mar 26, 2019
878a7ae
merge backend stuff from old branch, add insertion of child trie root in
cheme Mar 26, 2019
a464936
commit before wasm_executor change (we will keep old interface for now:
cheme Mar 26, 2019
4de73d7
tabify
cheme Mar 26, 2019
be0e340
Things compile (account change is unoptimized), not for wasm.
cheme Mar 26, 2019
7f3a282
Make SutrieField non public
cheme Mar 27, 2019
4d208db
Compile no std child trie with subtrie query (super costy: do we trust
cheme Mar 27, 2019
6d7f355
Make the single child trie test pass.
cheme Mar 27, 2019
25bcb4c
Proving synch child trie content (TODO it requires deletion tests).
cheme Mar 28, 2019
9eaef35
restore test
cheme Apr 1, 2019
37d9536
Merge branch 'master' into child-trie-soft-min
cheme Apr 1, 2019
67c03a2
Fix test error (wrong vec alloc).
cheme Apr 2, 2019
99dbb5a
tests for no key collision
cheme Apr 3, 2019
3be1802
Merge branch 'master' into child-trie-soft-min
cheme Apr 3, 2019
fec73d0
Revert `storage_root` using child, create a variant for it: see
cheme Apr 4, 2019
20d168d
indentation and remove comment
cheme Apr 4, 2019
d797bd0
Remove some TODOs, fix compile error
cheme Apr 4, 2019
27096aa
plaindb does not need to be keyspaceddb
cheme Apr 4, 2019
3560acc
Merge branch 'master' into child-trie-soft-min
cheme Apr 5, 2019
c3fc432
bump impl_version
cheme Apr 8, 2019
3e417eb
Merge branch 'master' into child-trie-soft-min
cheme Apr 16, 2019
5af490f
fix and 2299
cheme Apr 16, 2019
5a8dddd
Merge branch 'master' into child-trie-soft-min
cheme Apr 16, 2019
8f04f00
Merge branch 'master' into child-trie-soft-min
cheme Apr 26, 2019
8051179
fix keyspace insert and start proof (missing in higher level test case a
cheme Apr 29, 2019
8eac118
remove todo of test
cheme Apr 30, 2019
a65f9f2
Merge branch 'master' into child-trie-soft-min
cheme Apr 30, 2019
d495ef5
Merge branch 'master' into child-trie-soft-min &
cheme May 14, 2019
197d77a
- refactor api, use noderef of read only query (require and additional
cheme May 15, 2019
2ea3c89
Remove SubTrieNode struct
cheme May 16, 2019
99c45ea
put extension in encoding/decoding properly
cheme May 16, 2019
3553ab2
SubTrie struct renaming (and single encode point)
cheme May 16, 2019
47984fe
remove contract prefix, and make use of a child trie prefix.
cheme May 16, 2019
2bf2d7b
fix for overlay before reverting
cheme May 16, 2019
bc7165c
fix2 for prefix in overlay
cheme May 16, 2019
21c3acf
revert (will probably need two variant, but for rpc pr)
cheme May 16, 2019
98b2fc3
break some lines
cheme May 16, 2019
432cb10
Merge branch 'master' into child-trie-soft-min
cheme May 16, 2019
e266dfe
Add module specific seed to generator (accountid is undefined)
cheme May 16, 2019
7f64652
Update core/primitives/src/subtrie.rs
cheme May 17, 2019
999a26e
Merge branch 'master' into child-trie-soft-min and adapt rpc test
cheme May 21, 2019
7bbd681
Merge branch 'child-trie-soft-min' of github.com:cheme/substrate into…
cheme May 21, 2019
87f03b7
child trie additional prefix is bad design for primitive, removing it.
cheme May 21, 2019
f18e002
safer encoding of version.
cheme May 24, 2019
0eaeca0
Merge branch 'master' into child-trie-soft-min (untested)
cheme May 24, 2019
b57319d
missing import
cheme May 24, 2019
1f848d2
bump impl version
cheme May 24, 2019
403df51
Merge branch 'master' into child-trie-soft-min
cheme May 24, 2019
305b60a
Merge branch 'master' into child-trie-soft-min
cheme May 28, 2019
423cfb1
correct version
cheme May 28, 2019
a0ffa31
fix typing
cheme May 28, 2019
6e3bed7
Merge branch 'master' into child-trie-soft-min
cheme May 29, 2019
7411146
misnamed storage key variables.
cheme May 29, 2019
331be51
fix error messages.
cheme May 29, 2019
bc2935c
remove convenience constructor, remove unneeded pub on field.
cheme May 29, 2019
5a87b6a
Merge branch 'master' into child-trie-soft-min
cheme May 29, 2019
f40400b
minor tweaks before reworking docs
cheme May 30, 2019
9bc1ab7
First pass of documentation improvement.
cheme May 30, 2019
c073b21
do not refer to parent_key when it is ParentTrie:
cheme May 30, 2019
d15ca49
child trie renaming did exceed 100 character line.
cheme May 30, 2019
0736b96
Link github issue for TODOs
cheme May 31, 2019
9e0485d
Merge branch 'master' into child-trie-soft-min
cheme May 31, 2019
586b50e
comment incorrect variable
cheme May 31, 2019
65d7485
Merge branch 'master' into child-trie-soft-min
cheme Jun 6, 2019
95a69b2
Makes child trie instantiation a bisschen more explicit.
cheme Jun 6, 2019
d089693
Merge branch 'master' into child-trie-soft-min
cheme Jun 12, 2019
ec69ae0
rename fetch and init trie function.
cheme Jun 12, 2019
76ea14d
moved_child is a bad idea, just delete in top, if it is reinserted this
cheme Jun 14, 2019
b2050c8
moved map is correct (fix usage of child trie to return option<option<)
cheme Jun 14, 2019
5a0cbe1
Add missing wasm boilerplate.
cheme Jun 14, 2019
6e84810
remove moved_ct from overlay in favor to optional in pending.
cheme Jun 14, 2019
7f5694f
Merge branch 'master' into child-trie-soft-min
cheme Jun 14, 2019
5006d73
Use keyspace for storage_cache.
cheme Jun 17, 2019
b85508e
Comment of unsafety of `set_child` if directly exposed.
cheme Jun 17, 2019
0c14777
Merge branch 'master' into child-trie-soft-min
cheme Jun 17, 2019
10c4f58
use named fields.
cheme Jun 17, 2019
453927b
Merge branch 'master' into child-trie-soft-min
cheme Jun 21, 2019
349f9a5
Merge branch 'master' into child-trie-soft-min
cheme Jun 25, 2019
fc034fb
Refacto of keyspace to use static creation unique info.
cheme Jun 27, 2019
45cfbd6
put child trie content under their own prefix (with common root with
cheme Jun 28, 2019
4f9717e
Revert to storing keyspace in state approach.
cheme Jun 28, 2019
7cb2d84
invalid asumption for `child_delta_trie_root`.
cheme Jun 28, 2019
c821a08
clean unused child storage key relative methods.
cheme Jun 28, 2019
c3ba830
Merge branch 'master' into child-trie-soft-min and
cheme Jun 28, 2019
acf9641
invalid comment
cheme Jun 28, 2019
0050457
indent and remove deprecated comments/struct
cheme Jun 28, 2019
c36b91b
Make top trie write through keyspace db, this is not going fine because
cheme Jul 2, 2019
9d3d9e2
Fix issue: prefixed_key already got the keyspace in prefix.
cheme Jul 2, 2019
3db4da8
Merge branch 'master' into child-trie-soft-min
cheme Jul 2, 2019
4348d70
Address review comment:
cheme Jul 4, 2019
134a4bf
Merge branch 'master' into child-trie-soft-min
cheme Jul 4, 2019
5325621
Restore auth version.
cheme Jul 4, 2019
97118e8
Avoid confusing Option<Option< in result return of overlay.
cheme Jul 4, 2019
0ed7f80
Missing fix from review on testing ext for set child trie (code from
cheme Jul 4, 2019
8a6986a
Use fields for change trie storage.
cheme Jul 4, 2019
7652de9
switch MapTransaction to a struct.
cheme Jul 4, 2019
94c629e
Merge branch 'master' into child-trie-soft-min
cheme Jul 4, 2019
7675740
Apply same encoding for parent root (compatible with implementation of a
cheme Jul 1, 2019
90fba8a
Fix previous cherry pick
cheme Jul 4, 2019
d8c58c6
Addressing nits.
cheme Jul 4, 2019
661ba2e
Avoid unused creation of child trie.
cheme Jul 4, 2019
833e9ff
Create child trie id from additional storage state.
cheme Jul 5, 2019
71bda12
update default encoding.
cheme Jul 5, 2019
08b3062
Handle possible switch to multiple trie layer.
cheme Jul 5, 2019
89f3cd5
Remove a redundancy on keyspaceddb instantiation.
cheme Jul 5, 2019
834f52a
actually remove redundancy correctly
cheme Jul 5, 2019
0445228
comment
cheme Jul 5, 2019
75add99
Merge branch 'child-trie-soft-min-old' into child-trie-soft-min
cheme Jul 5, 2019
e70edab
Merge branch 'master' into child-trie-soft-min and apply review
cheme Jul 9, 2019
b8a0cd4
Merge branch 'master' into child-trie-soft-min
cheme Jul 10, 2019
1514171
Merge branch 'master' into child-trie-soft-min
cheme Jul 10, 2019
a7da811
Fix new test cases.
cheme Jul 10, 2019
b96c523
Merge branch 'master' into child-trie-soft-min
cheme Jul 11, 2019
865672d
Merge branch 'master' into child-trie-soft-min
cheme Jul 12, 2019
b6d7705
bump runtime version
cheme Jul 12, 2019
b45344c
Merge branch 'master' into child-trie-soft-min
cheme Jul 18, 2019
517f95c
Merge branch 'master' into child-trie-soft-min
cheme Jul 31, 2019
79a07de
Merge branch 'master' into child-trie-soft-min
cheme Aug 2, 2019
a027fb0
Some doc enhancement.
cheme Aug 2, 2019
b92655c
ChildRead correctly defined (previous definition was wrong).
cheme Aug 2, 2019
8a875f4
child_trie 'is_updatable_with' to avoid already broken redundancy.
cheme Aug 2, 2019
fcd8bdb
fix system bench error.
cheme Aug 2, 2019
3241fc4
Fix client doc rust code.
cheme Aug 2, 2019
ecac03b
Merge branch 'master' into child-trie-soft-min
cheme Aug 2, 2019
10369b9
Merge branch 'master' into child-trie-soft-min
cheme Aug 7, 2019
15a2967
Merge branch 'master' into child-trie-soft-min
cheme Aug 8, 2019
acc94e4
Merge branch 'master' into child-trie-soft-min
cheme Aug 8, 2019
7d96338
Remove unused method (in favor of assimilate).
cheme Aug 8, 2019
ba7bdcb
Merge branch 'child-trie-soft-min' of github.com:cheme/polkadot into …
cheme Aug 14, 2019
aacea85
Merge branch 'master' into child-trie-soft-min
cheme Aug 14, 2019
6789641
merge fix.
cheme Aug 14, 2019
2b37160
Rename MapTransaction to StorageContent.
cheme Aug 14, 2019
b1183bd
Get subscription stuff from child-deletion branch:
cheme Aug 14, 2019
bc5653c
Merge branch 'master' into child-trie-soft-min
cheme Aug 22, 2019
5ecfd19
update to master.
cheme Aug 22, 2019
baf89c8
Cast explicitelly for readability.
cheme Aug 26, 2019
0f8bff9
bump spec version.
cheme Aug 26, 2019
5a8576b
Merge branch 'master' into child-trie-soft-min
cheme Aug 29, 2019
045ee32
Merge branch 'master' into child-trie-soft-min
cheme Aug 29, 2019
58e6e41
Fix compilation.
cheme Aug 29, 2019
70555c5
Merge branch 'master' into child-trie-soft-min with conflicts.
cheme Sep 5, 2019
130e5e4
build passing, regression on extrinsics for a set_child (see new TODO).
cheme Sep 6, 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
Merge branch 'master' into child-trie-soft-min
  • Loading branch information
cheme committed Apr 30, 2019
commit a65f9f2cbb658726830e4dd4a8cdc38423f652ff
12 changes: 7 additions & 5 deletions core/state-machine/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,10 @@ use log::warn;
use hash_db::Hasher;
use heapsize::HeapSizeOf;
use parity_codec::{Decode, Encode};
use primitives::{storage::well_known_keys, NativeOrEncoded, NeverNativeValue, OffchainExt};
use primitives::subtrie::SubTrie;
use primitives::{
storage::well_known_keys, NativeOrEncoded, NeverNativeValue, OffchainExt,
subtrie::SubTrie,
};

pub mod backend;
mod changes_trie;
Expand All @@ -38,7 +40,7 @@ mod trie_backend;
mod trie_backend_essence;

use overlayed_changes::OverlayedChangeSet;
pub use trie::{TrieMut, TrieDBMut, DBValue, MemoryDB};
pub use trie::{TrieMut, TrieDBMut, DBValue, MemoryDB, Recorder as ProofRecorder};
pub use testing::TestExternalities;
pub use basic::BasicExternalities;
pub use ext::Ext;
Expand All @@ -55,7 +57,7 @@ pub use changes_trie::{
pub use overlayed_changes::OverlayedChanges;
pub use proving_backend::{
create_proof_check_backend, create_proof_check_backend_storage,
Recorder as ProofRecorder, ProvingBackend,
ProvingBackend,
};
pub use trie_backend_essence::{TrieBackendStorage, Storage};
pub use trie_backend::TrieBackend;
Expand Down Expand Up @@ -994,7 +996,7 @@ mod tests {
// Note that proof of get_subtrie should use standard child proof
let subtrie1 = remote_backend.child_trie(b"sub1").unwrap().unwrap();
let _remote_root = remote_backend.storage_root(::std::iter::empty()).0;
let (v, remote_proof) = prove_child_read(remote_backend, &subtrie1, b"value3").unwrap();
let (_v, remote_proof) = prove_child_read(remote_backend, &subtrie1, b"value3").unwrap();
let local_result1 = read_child_proof_check::<Blake2Hasher>(remote_proof.clone(), &subtrie1, b"value3").unwrap();
let local_result2 = read_child_proof_check::<Blake2Hasher>(remote_proof.clone(), &subtrie1, b"value2").unwrap();
assert_eq!(local_result1, Some(vec![142]));
Expand Down
5 changes: 4 additions & 1 deletion core/state-machine/src/proving_backend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@ use log::debug;
use hash_db::Hasher;
use heapsize::HeapSizeOf;
use hash_db::HashDB;
use trie::{Recorder, MemoryDB, PrefixedMemoryDB, TrieError, read_trie_value_with, read_child_trie_value_with, record_all_keys};
use trie::{
MemoryDB, PrefixedMemoryDB, TrieError, Recorder,
read_trie_value_with, read_child_trie_value_with, record_all_keys
};
use crate::trie_backend::TrieBackend;
use crate::trie_backend_essence::{Ephemeral, TrieBackendEssence, TrieBackendStorage};
use crate::{Error, ExecutionError, Backend};
Expand Down
2 changes: 1 addition & 1 deletion core/state-machine/src/testing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ impl<H: Hasher> Externalities<H> for TestExternalities<H> where H::Out: Ord + He
}

fn child_storage_root(&mut self, _subtrie: &SubTrie) -> Vec<u8> {
unimplemented!()
vec![]
}

fn storage_changes_root(&mut self, parent: H::Out, parent_num: u64) -> Option<H::Out> {
Expand Down
6 changes: 1 addition & 5 deletions core/trie/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -158,11 +158,7 @@ pub fn is_child_trie_key_valid<H: Hasher>(storage_key: &[u8]) -> bool {

/// Determine the default child trie root.
pub fn default_child_trie_root<H: Hasher>() -> Vec<u8> {
let mut db = MemoryDB::default();
let mut root = H::Out::default();
let mut empty = TrieDBMut::<H>::new(&mut db, &mut root);
empty.commit();
empty.root().as_ref().to_vec()
trie_root::<H, _, Vec<u8>, Vec<u8>>(core::iter::empty()).as_ref().iter().cloned().collect()
}

/// Determine a child trie root given its ordered contents, closed form. H is the default hasher, but a generic
Expand Down
2 changes: 1 addition & 1 deletion node/runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: create_runtime_str!("node"),
impl_name: create_runtime_str!("substrate-node"),
authoring_version: 10,
spec_version: 66,
spec_version: 69,
impl_version: 68,
apis: RUNTIME_API_VERSIONS,
};
Expand Down
21 changes: 11 additions & 10 deletions srml/contract/src/account_db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,10 @@ use rstd::collections::btree_map::{BTreeMap, Entry};
use rstd::prelude::*;
use runtime_io::blake2_256;
use runtime_primitives::traits::Zero;
use srml_support::{StorageMap, traits::{UpdateBalanceOutcome,
SignedImbalance, Currency, Imbalance}, storage::child};
use substrate_primitives::subtrie::SubTrie;
use srml_support::traits::{Currency, Imbalance, SignedImbalance, UpdateBalanceOutcome};
use srml_support::{storage::child, StorageMap};
use system;

// Note: we don't provide Option<Contract> because we can't create
// the trie_id in the overlay, thus we provide an overlay on the fields
Expand Down Expand Up @@ -79,7 +80,7 @@ impl<T: Trait> AccountDb<T> for DirectAccountDb {
// TODO pass optional SubTrie or change def to use subtrie (put the subtrie in cache (rc one of
Copy link
Contributor Author

@cheme cheme Apr 4, 2019

Choose a reason for hiding this comment

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

I did use account_db trie_id (see other comments) as keyspace (and as subtrie parent location).
So there is a need for caching SubTrie struct. TODO issue for that ?
There is a possible optimization by putting SubTrie directly at Account_id location, this would only be possible by:

  • storing account infos at the same location as subtrie (in subtrie prefix)
  • changing this pr to allow storing subtrie at any location
    For both point it requires implementing a way to store subtrie with different encoder (and with additional info).

@thiolliere maybe this pr (not sure it will get merged there might be better way of fixing the collision), could be of interest regarding #1882 or #1883 .

Copy link
Contributor

@gui1117 gui1117 Apr 5, 2019

Choose a reason for hiding this comment

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

So there is a need for caching SubTrie struct. TODO issue for that ?

hmm I can also think of another anwser. The trie_id: Option<&TrieId> is already an optimisation that says: if there is a trie_id in direct_storage then you have to give me that I won't do the lookup from AccountId, so you can cache it for me.
This thoses changes you introduce we can just say: if there is a subtrie associated to the account already then give it I won't do the lookup.

Having subtrie in AccoundInfo seems cool though but not mandatory here.

@thiolliere maybe this pr (not sure it will get merged there might be better way of fixing the collision), could be of interest regarding 1882 or 1883 .

I don't know in which context this collision can happen I design things without taking this into consideration though. But interesting thanks

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes I see your optim, it is better design (that is the reason why I pinged you :)

I don't in which context this collision can happen I design things without taking this into consideration though. But interesting thanks

without this pr it happens whenever two subtries are similar and content got pruned (for contract it should happen a lot). It only requires that both subtries got same branch path (also content (same proof would be more correct)) to the deleted value.

Having subtrie in AccoundInfo seems cool though but not mandatory here.

As long as we use a trie_id as subtrie key from account_id (merging account info and trie info) there is no need to take this into consideration.

// the overlays)) EMCH TODO create an issue for a following pr
trie_id.and_then(|id|child::get_child_trie(&id).and_then(|subtrie|
child::get_raw(&subtrie, location)
child::get_raw(&subtrie, &blake2_256(location))
))
}
fn get_code_hash(&self, account: &T::AccountId) -> Option<CodeHash<T>> {
Expand Down Expand Up @@ -144,21 +145,21 @@ impl<T: Trait> AccountDb<T> for DirectAccountDb {
// TODO put in cache (there is also a scheme change to do to avoid indirection)
// TODO also switch to using address instead of trie_id that way no need to store
// trie_id (subtrie field at address).
let subtrie = child::get_child_trie(&info.trie_id[..]).unwrap_or_else(||{
let new_subtrie = SubTrie::new(info.trie_id.clone(), &info.trie_id[..]);
let subtrie = child::get_child_trie(&new_info.trie_id[..]).unwrap_or_else(||{
let new_subtrie = SubTrie::new(new_info.trie_id.clone(), &new_info.trie_id[..]);
child::set_child_trie(&new_subtrie);
new_subtrie
});

for (k, v) in changed.storage.into_iter() {
if let Some(value) = child::get_raw(&subtrie, &k) {
new_storage_size -= value.len() as u64;
if let Some(value) = child::get_raw(&subtrie, &blake2_256(&k)) {
new_info.storage_size -= value.len() as u64;
}
if let Some(value) = v {
new_storage_size += value.len() as u64;
child::put_raw(&subtrie, &k, &value[..]);
new_info.storage_size += value.len() as u64;
child::put_raw(&subtrie, &blake2_256(&k), &value[..]);
} else {
child::kill(&subtrie, &k);
child::kill(&subtrie, &blake2_256(&k));
}
}

Expand Down
9 changes: 5 additions & 4 deletions srml/contract/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -594,10 +594,11 @@ decl_storage! {

impl<T: Trait> OnFreeBalanceZero<T::AccountId> for Module<T> {
fn on_free_balance_zero(who: &T::AccountId) {
<CodeHashOf<T>>::remove(who);
<AccountInfoOf<T>>::get(who)
.and_then(|info|child::get_child_trie(&info.trie_id[..]))
.map(|subtrie|child::kill_storage(&subtrie));
if let Some(ContractInfo::Alive(info)) = <ContractInfoOf<T>>::get(who) {
child::get_child_trie(&info.trie_id[..])
.map(|subtrie|child::kill_storage(&subtrie));
}
<ContractInfoOf<T>>::remove(who);
}
}

Expand Down
11 changes: 9 additions & 2 deletions srml/contract/src/rent.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ use crate::{BalanceOf, ContractInfo, ContractInfoOf, Module, TombstoneContractIn
use runtime_primitives::traits::{As, Bounded, CheckedDiv, CheckedMul, Saturating, Zero};
use srml_support::traits::{Currency, ExistenceRequirement, Imbalance, WithdrawReason};
use srml_support::StorageMap;
use substrate_primitives::subtrie::SubTrie;

#[derive(PartialEq, Eq, Copy, Clone)]
#[must_use]
Expand Down Expand Up @@ -154,17 +155,23 @@ fn try_evict_or_and_pay_rent<T: Trait>(
if !is_below_subsistence {
// The contract has funds above subsistence deposit and that means it can afford to
// leave tombstone.
let subtrie = runtime_io::get_child_trie(&contract.trie_id[..]).unwrap_or_else(||{
let new_subtrie = SubTrie::new(contract.trie_id.clone(), &contract.trie_id[..]);
runtime_io::set_child_trie(&new_subtrie);
new_subtrie
});


// Note: this operation is heavy.
let child_storage_root = runtime_io::child_storage_root(&contract.trie_id);
let child_storage_root = runtime_io::child_storage_root(&subtrie);

let tombstone = TombstoneContractInfo::new(
child_storage_root,
contract.storage_size,
contract.code_hash,
);
<ContractInfoOf<T>>::insert(account, ContractInfo::Tombstone(tombstone));
runtime_io::kill_child_storage(&contract.trie_id);
runtime_io::kill_child_storage(&subtrie);
}

RentOutcome::Evicted
Expand Down
6 changes: 4 additions & 2 deletions srml/contract/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,11 @@ use srml_support::{
traits::Currency, StorageMap,
};
use std::sync::atomic::{AtomicUsize, Ordering};
#[cfg(test)]
use substrate_primitives::subtrie::SubTrie;
use crate::account_db::{DirectAccountDb, OverlayAccountDb, AccountDb};
use substrate_primitives::storage::well_known_keys;
use substrate_primitives::Blake2Hasher;
use system::{self, EventRecord, Phase};
use {balances, consensus, wabt};

mod contract {
// Re-export contents of the root. This basically
Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.