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

Update to latest mem-db, hash-db and trie-db. #10314

Merged
merged 7 commits into from
Feb 20, 2019

Conversation

cheme
Copy link
Contributor

@cheme cheme commented Feb 8, 2019

This PR updates parity-ethereum to use parity-trie crate, this is part of paritytech/trie#5 and follows paritytech/parity-common#106 .

A few point of attention in this PR:

  • HashDBRef new trait makes the triedb construction a bit awkward (ptr lifetime), there is certainly a way to make it look better, and possibly a change in the trait but I would put that out of scope of this pr.
  • memorydb construction through utility function (I put it in journaldb but it is probably not the best place).
  • paritytech/trie#2 makes 'keys' function a requirement of parity-eth only so I added some traits (in journaldb again as it is mainly use for it), I did not add the parametrics types as it is only related to eth at this point.
  • triehash crate may be replace by trieroot but for now I also put that out of scope of this PR.

@cheme cheme added the A0-pleasereview 🤓 Pull request needs code review. label Feb 8, 2019
@5chdn 5chdn added this to the 2.4 milestone Feb 8, 2019
@5chdn 5chdn added the M5-dependencies 🖇 Dependencies. label Feb 8, 2019
Copy link
Contributor

@ngotchac ngotchac left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -73,7 +74,8 @@ impl<DB: HashDB<KeccakHasher, DBValue>> CHT<DB> {
if block_to_cht_number(num) != Some(self.number) { return Ok(None) }

let mut recorder = Recorder::with_depth(from_level);
let t = TrieDB::new(&self.db, &self.root)?;
let db: &HashDB<_,_> = &self.db;
Copy link
Contributor

Choose a reason for hiding this comment

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

Indentation is off.

@5chdn 5chdn added A8-looksgood 🦄 Pull request is reviewed well. and removed A0-pleasereview 🤓 Pull request needs code review. labels Feb 20, 2019
indentation

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

@sorpaas sorpaas left a comment

Choose a reason for hiding this comment

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

LGTM!

ethcore/src/snapshot/tests/state.rs Outdated Show resolved Hide resolved
Co-Authored-By: cheme <emericchevalier.pro@gmail.com>
@ordian ordian merged commit 6bb106a into openethereum:master Feb 20, 2019
@cheme cheme deleted the use-trie2 branch February 20, 2019 18:58
ordian added a commit that referenced this pull request Apr 5, 2019
* master:
  fix #10390 (#10391)
  Fix to_pod storage trie value decoding (#10368)
  revert some changes, could be buggy (#10399)
  version: bump nightly to 2.5 (#10392)
  no-git for publish jobs, empty artifacts dir (#10393)
  fix(jni): bump to jni to 0.11 & remove unsafe impl (#10394)
  chore(bump ethereum-types) (#10396)
  Update to latest mem-db, hash-db and trie-db. (#10314)
  tx pool: always accept local transactions (#10375)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A8-looksgood 🦄 Pull request is reviewed well. M5-dependencies 🖇 Dependencies.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants