Snapshot format changes (#2234)

Closes #2213
Omit transaction and receipt roots from abridged block.
No longer use RLP compression.

Make ordered_trie_root generic over an iterator to save an allocation.

Breaks snapshot format backwards compatibility (with other 1.4 snapshots -- it's already been broken with 1.3).

Documentation will need updating
This commit is contained in:
Robert Habermeier
2016-09-22 19:47:03 +02:00
committed by Gav Wood
parent 862feb7172
commit 723d837d05
6 changed files with 50 additions and 35 deletions

View File

@@ -40,7 +40,9 @@ use vector::SharedPrefix;
/// assert_eq!(ordered_trie_root(v), H256::from_str(root).unwrap());
/// }
/// ```
pub fn ordered_trie_root(input: Vec<Vec<u8>>) -> H256 {
pub fn ordered_trie_root<I>(input: I) -> H256
where I: IntoIterator<Item=Vec<u8>>
{
let gen_input = input
// first put elements into btree to sort them by nibbles
// optimize it later