Update to latest trie version. (#10972)

* Switch to 'trie' crates, there is an unpublished deps to staging
parity-common triehash still.

* Use crates.io dependency.

* indentation

* Update util/journaldb/src/traits.rs

indentation

Co-Authored-By: cheme <emericchevalier.pro@gmail.com>

* Rem import braces

* switch deps to simple-codec branch (code broken)

* painfull update of trie and memdb, plus rework codec to be compatible
with simple_codec changes

* Removed useless implementation from trait.

* Remove some malloc size until update and patch triehash, seems ok
otherwhise.

* Update parity-util-mem.

* Switch to published triehash 0.8.

* Avoid redundancy in encode_partial functions.
Use better namings.

* Update util/patricia-trie-ethereum/src/rlp_node_codec.rs

Co-Authored-By: Andronik Ordian <write@reusable.software>

* Update util/patricia-trie-ethereum/src/rlp_node_codec.rs

Co-Authored-By: Andronik Ordian <write@reusable.software>

* Restore previous child rlp header length check.
Better comments and formatting.

* Update util/patricia-trie-ethereum/src/rlp_node_codec.rs

Co-Authored-By: David <dvdplm@gmail.com>

* Update util/patricia-trie-ethereum/src/rlp_node_codec.rs

Co-Authored-By: David <dvdplm@gmail.com>
This commit is contained in:
cheme
2019-08-15 15:36:48 +02:00
committed by David
parent e50eafe6e1
commit 5807402a0b
31 changed files with 229 additions and 158 deletions

View File

@@ -91,7 +91,7 @@ use verification::queue::kind::blocks::Unverified;
use verification::{Verifier, BlockQueue};
use verification;
use ansi_term::Colour;
use ethtrie::Layout;
// re-export
pub use blockchain::CacheSize as BlockChainCacheSize;
use db::{Writable, Readable, keys::BlockDetails};
@@ -726,7 +726,7 @@ impl Client {
false => TrieSpec::Secure,
};
let trie_factory = TrieFactory::new(trie_spec);
let trie_factory = TrieFactory::new(trie_spec, Layout);
let factories = Factories {
vm: VmFactory::new(config.vm_type.clone(), config.jump_table_size),
trie: trie_factory,

View File

@@ -158,7 +158,7 @@ impl<'a> EvmTestClient<'a> {
fn factories(trie_spec: trie::TrieSpec) -> Factories {
Factories {
vm: trie_vm_factories::VmFactory::new(VMType::Interpreter, 5 * 1024),
trie: trie::TrieFactory::new(trie_spec),
trie: trie::TrieFactory::new(trie_spec, ethtrie::Layout),
accountdb: Default::default(),
}
}

View File

@@ -1658,13 +1658,14 @@ mod tests {
#[test]
fn should_get_full_pod_storage_values() {
use trie::{TrieFactory, TrieSpec};
use ethtrie;
let a = Address::from_low_u64_be(10);
let db = get_temp_state_db();
let factories = Factories {
vm: Default::default(),
trie: TrieFactory::new(TrieSpec::Fat),
trie: TrieFactory::new(TrieSpec::Fat, ethtrie::Layout),
accountdb: Default::default(),
};

View File

@@ -16,7 +16,6 @@
use ethjson;
use trie::{TrieFactory, TrieSpec};
use ethtrie::RlpCodec;
use ethereum_types::H256;
use super::HookType;
@@ -28,7 +27,7 @@ pub use self::secure::run_test_file as run_secure_test_file;
fn test_trie<H: FnMut(&str, HookType)>(json: &[u8], trie: TrieSpec, start_stop_hook: &mut H) -> Vec<String> {
let tests = ethjson::trie::Test::load(json).unwrap();
let factory = TrieFactory::<_, RlpCodec>::new(trie);
let factory = TrieFactory::new(trie, ethtrie::Layout);
let mut result = vec![];
for (name, test) in tests.into_iter() {