This repository has been archived by the owner on Nov 6, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Make HashDB generic #8739
Merged
Merged
Make HashDB generic #8739
Changes from 3 commits
Commits
Show all changes
185 commits
Select commit
Hold shift + click to select a range
e0c064a
WIP Make HashDB generic
dvdplm 1cd7ded
Add HeapSizeOf bound to the output type of a Hasher
dvdplm 4bf7f6d
Add comments and todos
dvdplm fd666d6
Cleanup and more todos
dvdplm 5325a70
Move concrete hasher impl to hashdb – TODO: where do these go?
dvdplm 041d6a2
Remove unused crates/uses
dvdplm f716105
Version bump – breaking change => 0.2.0
dvdplm 8ce39eb
Version bump
dvdplm a7ff7c2
Derive Clone and PartialEq for KeccakHasher to satisfy the code in jo…
dvdplm ef1e48a
Thread `Hasher` throughout the crate – WIP
dvdplm 3a7c490
Use v0.2 of hashdb and memorydb
dvdplm 83342c0
Make journaldb use generic hashdb/memorydb
dvdplm aa268bd
Version bump: use newer hasdb
dvdplm bf01073
Additional bounds on Hasher output
dvdplm 013666f
TrieDB, TrieDBMut, SecTrieDB, FatDB typechecks
dvdplm aabe7dd
Merge remote-tracking branch 'origin/master' into refactor/hashdb-gen…
dvdplm 1f892fe
Fix tests
dvdplm f98e905
FatDBMut and test fixes
dvdplm b42f92e
FatDBMut test
dvdplm 5e9fda0
SecTrieDB tests
dvdplm 841abc4
Tests for TrieDBMut
dvdplm f29132c
Recorder tests
dvdplm 201cdcb
SecTrieDBMut + test
dvdplm 6bf7e5b
Remove scratch pad files
dvdplm fc058e6
Remove more traces of scratch pad files
dvdplm 03ff20e
Add a test for using MemoryDB with a different hasher (TODO)
dvdplm 8082d40
cleanup
dvdplm c9fc6a9
cleanup
dvdplm 13d1de3
Comment out WIP test
dvdplm 33e0531
cleanup
dvdplm ef707b0
TrieError<T> needs T: Debug
dvdplm ada0b7e
Cleanup
dvdplm 56af2c4
Don't compare rc against i32::MIN
dvdplm cb61a01
Merge branch 'master' into refactor/hashdb-generic
dvdplm 3f1cfc5
missing use's
dvdplm 4e2e81b
Remove Decodable bound
dvdplm c78037c
Merge branch 'master' into refactor/hashdb-generic
dvdplm c149786
Comment out fatdb/sectriedb
dvdplm 68fa728
Add `NodeCodec` with impl for `Node` (the Rlp-kind)
dvdplm c198d0f
WIP try to extract more rlp-dependent code into `NodeCodec` trait
dvdplm a7e9cbf
WIP Add NodeCodec in the proper place
dvdplm 8bc455c
Fix FatDB, FatDBMut, SecTrieDB, SecTrieDBMut
dvdplm 6d89eba
Make NodeCodec error type an associated type
dvdplm 3d69e55
Minor doc changes
dvdplm e905494
Fix benches
dvdplm 2a579a3
Handle DecoderError better
dvdplm 12ea521
Include the DecoderError as a Box<Error>
dvdplm 4fd7990
Merge remote-tracking branch 'origin/master' into refactor/hashdb-gen…
dvdplm 829325e
Store a `String` in the TrieError::DecoderError variant instead of a …
dvdplm 494e58f
WIP use generic hashdb in ethcore
dvdplm aaf5f4c
Switch JournalDB to use type param'd HashDB
dvdplm 80f5545
Switch to use type param instead of assoc type
dvdplm 89e22d1
Fix memorydb
dvdplm f374cc5
Fix patricia_trie
dvdplm e6e35b7
Fix ethcore/src with generic HashDB
dvdplm 7d2a414
Fix running tests depending on the parent `test-helpers` feature
dvdplm ae55ca4
Fix ethcore/light
dvdplm 6b4095e
"Handle" Trie errors
dvdplm 4288d49
Add `version` key for new generic crates
dvdplm 1d5f5e2
New cargo lockfile
dvdplm 33f4e79
Fix tests
dvdplm a567462
Add review comment about error_chain and generic errors
dvdplm b146e3c
Bump version
dvdplm f3dd59b
Generic hasdb
dvdplm 6f48370
Merge branch 'master' into refactor/hashdb-generic
dvdplm 1741d81
Merge branch 'refactor/hashdb-generic-hasher-as-type-param-not-assoc-…
dvdplm 0374aa8
Fix merge issues
dvdplm 1a1f98e
cleanup
dvdplm 5d12612
Fix build error
dvdplm b9f1760
Fix json_tests
dvdplm 4d733bc
Merge branch 'master' into refactor/hashdb-generic
dvdplm fe91723
Merge branch 'master' into refactor/hashdb-generic
dvdplm 468525e
Minor cleanup
dvdplm 071fa8f
cleanup
dvdplm 03d266d
Add more questions to reviewers wrt error handling in ethcore
dvdplm 9ce95cd
Merge branch 'master' into refactor/hashdb-generic
dvdplm 5db5de9
Remove `Decodable` bound and reduce the nr of `Encodable` bounds requ…
dvdplm b2e8b93
Add a rlp::Stream trait with the stuff we need in patricia_trie
dvdplm 4f172f7
Get rid of more RLP dependent code
dvdplm a6fd313
Add special-cased `append_bytes` to `Stream` to work around the `Enco…
dvdplm 073c213
Add trie-node-codec crate and move Stream trait there
dvdplm cf51e79
Rename trie-node-codec to stream-encoder
dvdplm 574a22a
Address some grumbles
dvdplm 42df94e
Add `LENGTH` const to `Hasher` and use it to remove the assumption of…
dvdplm f081b35
remove solved review comment
dvdplm c6333af
Add stream_encoder::Stream where needed
dvdplm c8a1c93
Fix tests in ethcore
dvdplm a66596d
A few grumbles and made more tests passing
dvdplm c5c6021
fix more tests
dvdplm 8b219ad
Merge branch 'master' into refactor/hashdb-generic
dvdplm f6cd87b
grumble: Idiomatic use of Result
dvdplm f57565c
Add keccak-hasher crate that implements Hasher with the Keccak-256 hash
dvdplm c2c7789
Remove KeccakHasher impl from hashdb
dvdplm 046b5d6
memorydb: Use keccak_hasher::KeccakHasher
dvdplm 91fd334
patricia_trie: Use keccak_hasher::KeccakHasher
dvdplm 57b79b8
Add keccak-hasher crate to main Cargo.toml
dvdplm f3da9b1
journaldb: Use keccak-hasher
dvdplm 5f47442
cargo lock changes
dvdplm b0c715b
rlp: Fix doc tests
dvdplm 730099a
ethcore: Use keccak-hasher
dvdplm 0e5fdfa
cargo lock
dvdplm 5ac48b3
sync: Use keccak-hasher
dvdplm 67bf644
Add patricia-trie-ethereum façade crate for keccak/rlp concrete impls…
dvdplm b8e9764
Remove all Rlp dependencies from patricia_trie
dvdplm c1eee0c
cleanup nibbleslice
debris 60e7c90
Fix ethcore tests
dvdplm 1d7dc83
Merge branch 'master' into refactor/hashdb-generic
dvdplm 50d66fd
Merge remote-tracking branch 'origin/nibbleslice_cleanup' into refact…
dvdplm 28358da
Merge branch 'master' into refactor/hashdb-generic
dvdplm acd757d
Fix tests in ethcore/light
dvdplm 3376c7d
Fix broken iterator Item type
dvdplm 46609fc
Export an ethereum TrieError
dvdplm 40c4beb
Fix trie error handling in ethcore
dvdplm 9cd8145
Add stream_encoder and patricia-trie-ethereum where needed
dvdplm 1eeaa1f
lockfile
dvdplm bc54358
fix docs
dvdplm f5c0440
TrieError takes two type params
dvdplm 7ccb350
Export concrete impls of the Trie result/error
dvdplm 15a754b
Use better result/error types in ethcore
dvdplm f1be1a1
lock file
dvdplm b48e2c8
Do not export a Keccak impl of MemoryDB
dvdplm c366b2a
Merge branch 'master' into refactor/hashdb-generic
dvdplm 4febf0d
Cleanup rlp Stream and add test for append_bytes
dvdplm 5f3ba13
Fix json_tests
dvdplm 80af9db
Merge branch 'master' into refactor/hashdb-generic
dvdplm bcd1ad2
Fix benches
dvdplm ce5d5b9
Minor cleanup
dvdplm 1d5c2b3
Cleanup
dvdplm 438e21c
Move the null node hash from the Hasher trait to NodeCodec
dvdplm 27fbbb3
Remove TODO
dvdplm 9c84453
cleanup
dvdplm 0142e70
Box TrieErrors
dvdplm 3e85645
Merge branch 'master' into refactor/hashdb-generic
dvdplm deed06e
Merge branch 'master' into refactor/hashdb-generic
dvdplm 5666873
whitespace
dvdplm 8bd8847
Colesce notes on why the AsHashDB trait looks the way it does
dvdplm e54ff1f
Fix Rlp benches
dvdplm 027862a
Merge branch 'master' into refactor/hashdb-generic
dvdplm 37685ad
Merge branch 'master' into refactor/hashdb-generic
dvdplm 0aab7e2
Address docs grumble
dvdplm b5e4485
Move AsHashDB impls out of the way
dvdplm ae5346e
Add missing docs
dvdplm 66d3b76
Missing docs
dvdplm 06fd57e
Add missing file
dvdplm d1ae199
Merge branch 'master' into refactor/hashdb-generic
dvdplm 7f004a9
Fix deps
dvdplm 75d2d23
Add some simple benches for memorydb
dvdplm c061f38
Add dep for memorydb benches
dvdplm 5d03e71
Move RlpNodeCodec impl to own file
dvdplm 54ab636
WIP typechecks, failing tests
dvdplm 7cbe20f
WIP instrument into_encoded
dvdplm db2346d
lock
dvdplm 31c4cb4
WIP instrument into_encoded
dvdplm 4fcd004
Heavily instrumented test
dvdplm aab4077
Remove instrumentation and cleanup
dvdplm a88616f
Remove stream_encoder
dvdplm 17e6c92
Remove stream_encoder usage
dvdplm e1c4bea
Remove stream_encoder crate
dvdplm 03604e8
Merge branch 'refactor/hashdb-generic-without-stream-encoder' into re…
dvdplm bfcf114
Remove unused extern crate
dvdplm c45cad9
Preallocate space for trail and key_nibbles (minor speedup)
dvdplm 627567d
Ignore build artifacts
dvdplm 550f852
Merge branch 'master' into refactor/hashdb-generic
dvdplm f55d96a
Use RlpStream::append
dvdplm 6bd549a
Inline NibbleVec::len and NibbleVec::at
dvdplm e4cb2ac
Aggressive inlining of NibbleSlice::at and NibbleSlice::encoded
dvdplm fc3d48c
Remove bench profile
dvdplm 1cf7c28
Fix tests
dvdplm 44bb8b6
Rename NodeCodec::E to Error
dvdplm 29bf049
Make Recorder and Record generic over the Hasher output rather than t…
dvdplm 7be2120
Fix trat descr
dvdplm 211882e
Remove dead code
dvdplm 609ebde
Ditch ethcore-logger for env-logger
dvdplm 308f281
Parametrize the HashMap builder from the Hasher
dvdplm 1aaaa63
Less aggressive inlining
dvdplm b76fffa
Add convenience types and use them for less line noise
dvdplm 92582c7
Remove unused deps
dvdplm 988bfaf
Clean up tests
dvdplm f487a69
Merge branch 'master' into refactor/hashdb-generic
dvdplm d625d8e
Address grumbles
dvdplm 67003be
Remove tempdir as test dep
dvdplm 412ae9c
Boxed errors
dvdplm 07dfdc7
Remove spurious whitespace after use blocks
dvdplm afbf3a9
Merge branch 'master' into refactor/hashdb-generic
dvdplm b9e310b
Merge branch 'master' into refactor/hashdb-generic
dvdplm File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
This function is non-trivial and so I'd probably annotate it
#[inline]
so LLVM can make the choice to inline or not itself.#[inline(always)]
is only for really trivial functions that are really hot but you have profiled to see are not being inlined automatically (likelen
below) and should be used with care. Although if you've benchmarked this and found that the(always)
is necessary then ignore this comment, of course!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.
It did show up in the traces and looked suspicious, but now that I try again it doesn't seem to make any difference at all so dialing back to just
#[inline]
makes sense. :)