-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Trie query recording and AccountDB factory for no mangling #1944
Conversation
0b0a669
to
9b993d7
Compare
@@ -51,10 +51,12 @@ impl StateProducer { | |||
// modify existing accounts. | |||
let mut accounts_to_modify: Vec<_> = { | |||
let trie = TrieDB::new(&*db, &self.state_root).unwrap(); | |||
trie.iter() | |||
let regionck_bug = trie.iter() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
???
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
knee-jerk reaction to working around a lifetime checker (regionck) error in rustc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
right - figured it might be something like that. shame it's buggy. if there's a tracking issue in the rust GH would be good to note it so can be fixed later.
a decent chunk of tests would be nice. |
The recorders are unit-tested, and I've just added a test which verifies the recording for a given trie. The next PR will create a more generic "prover" module which will create pseudorandom tries and verify proofs as well as idempotence. |
* optionally use no mangling for accountdb * add the recorder module * get_recorded for tries, no virtual dispatch on readonly tries * add recording test
I thought it was important to have the recorder stuff be statically dispatched so LLVM can inline out record calls to
NoOp
recorders. This lead toTrieDB
not being object-safe any more so I put together an enum that the trie factory produces, which has the added bonus of reducing allocations and virtual dispatch for trie queries. Probably will extend that toTrieMut
as well.