Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

switch to single subtrie crate dep #1

Merged
merged 85 commits into from
Apr 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
85 commits
Select commit Hold shift + click to select a range
91681c8
Adopt the new HashDB API
arkpar Jul 25, 2023
6f097f6
Fixed a test
arkpar Aug 10, 2023
d9ac5aa
Fixes
arkpar Aug 12, 2023
00b4fa9
fmt
arkpar Aug 12, 2023
c4be095
fixing triedbmut lookup, added some testing in test. (#198)
cheme Aug 13, 2023
719aa79
fixing triedbmut lookup, added some testing in test. (#198)
cheme Aug 13, 2023
bd9e3d1
Fixed fuzzing tests
arkpar Aug 13, 2023
1cf9d43
Removed missing_location
arkpar Sep 6, 2023
08a2305
trie-db: Fetch the closest merkle value (#199)
lexnv Sep 11, 2023
61c21a5
Make `trie_nodes_recorded_for_key` work for inline values (#194)
bkchr Sep 12, 2023
0b9bede
chore: Release trie-db 0.28.0 (#200)
lexnv Sep 12, 2023
66774b3
Fix recorder for `NonExisting` keys (#202)
bkchr Sep 13, 2023
bc79f51
Bump actions/checkout from 3 to 4 (#201)
dependabot[bot] Sep 13, 2023
4d05c64
Update hex-literal requirement from 0.3 to 0.4 (#191)
dependabot[bot] Sep 13, 2023
bac0cbc
Comments
arkpar Sep 20, 2023
ada1da6
Merge branch 'master' of github.com:paritytech/trie into arkpar/new-trie
arkpar Sep 20, 2023
d0b9166
totally remove hashbrown dep (#203)
cheme Oct 1, 2023
6eb4b88
Update hashbrown requirement from 0.13.2 to 0.14.1 (#204)
dependabot[bot] Oct 2, 2023
5a9c3b4
Merge branch 'master' of github.com:paritytech/trie into arkpar/new-trie
arkpar Oct 3, 2023
0ff5025
Tests and fixes
arkpar Nov 26, 2023
d00240e
fmt
arkpar Nov 26, 2023
81446ab
Test fixes
arkpar Nov 27, 2023
d3e6377
Update criterion requirement from 0.4.0 to 0.5.1 (#193)
dependabot[bot] Dec 2, 2023
2edd0a1
Implements `DoubleEndedIterator` for trie iterators (#208)
snowmead Jan 5, 2024
599b0f1
api for child changeset
cheme Jan 15, 2024
314179d
attach in triedbmut node
cheme Jan 15, 2024
269ef62
push changeset (warn need to init key individually for compat)
cheme Jan 15, 2024
675ae01
fix test and assert
cheme Jan 15, 2024
87d60c8
push attached changeset at last.
cheme Jan 16, 2024
e031dbf
init a test
cheme Jan 16, 2024
7faf394
meh, removed key pass through nodemaybe
cheme Jan 16, 2024
557b52d
better
cheme Jan 16, 2024
ed42db6
memtrie issue
cheme Jan 16, 2024
8d334d2
change children location
cheme Jan 16, 2024
a244144
access to child trie through location.
cheme Jan 17, 2024
f5bc93c
allow access to prefixed child trie
cheme Jan 17, 2024
caf67f3
share more code in test
cheme Jan 17, 2024
de3bc22
extract in fn
cheme Jan 17, 2024
8edcc92
need support of location to init triedbmut
cheme Jan 17, 2024
1f9b8ed
ok
cheme Jan 17, 2024
270aa81
default location instead of none
cheme Jan 17, 2024
d858765
remove unused location parameters from lookup (root location is a loo…
cheme Jan 17, 2024
b5076f8
apply_with_prefix should not be needed.
cheme Jan 18, 2024
39e81cb
attach changeset in explicit function
cheme Jan 18, 2024
04e7a18
no_std
cheme Jan 18, 2024
49bc5a7
Merge branch 'master' into cheme/new-trie
cheme Jan 22, 2024
956ed99
fix
cheme Jan 22, 2024
37a0555
crumb on layout
cheme Jan 22, 2024
ac8a09f
less node decoding, but would need to put location directly in node plan
cheme Jan 22, 2024
bc76a21
minor changes
cheme Jan 23, 2024
542829a
refa remove unused hash_count (#209)
dimartiro Jan 23, 2024
5df1cd8
fix
cheme Jan 23, 2024
aeec4fa
avoid using child trie name
cheme Jan 23, 2024
f0d3662
more renamings
cheme Jan 23, 2024
e83c8f0
rename
cheme Jan 23, 2024
367c0e7
HashDB to NodeDB
cheme Jan 23, 2024
c7547c6
cleaning more references to child trie
cheme Jan 23, 2024
1a969ad
use removed key from node only
cheme Jan 23, 2024
6cc8363
remove ChangesetNodeRef
cheme Jan 23, 2024
28a5476
move memorydb hashdb and mem-tree-db into triedb, except Hasher trait.
cheme Jan 23, 2024
b6e4393
Merge branch 'master' into cheme/new-trie
cheme Jan 23, 2024
93433ca
fix
cheme Jan 23, 2024
16f1cd5
no_std
cheme Jan 23, 2024
04a1ee4
missing file write
cheme Jan 23, 2024
5e26628
don't check memorydb
cheme Jan 23, 2024
554187b
flatten crate, only keep h256-std-hasher.
cheme Jan 24, 2024
10cc948
fix
cheme Jan 24, 2024
024e964
fmt
cheme Jan 24, 2024
d176e42
fix
cheme Jan 24, 2024
7a575ef
ci
cheme Jan 24, 2024
fca9577
add testutils when using bench
cheme Jan 24, 2024
26e462d
restore empty function, call it unchanged
cheme Jan 24, 2024
8801370
store child index in node plan
cheme Feb 14, 2024
bb561a0
NodeDBMut trait for testing in polkadot sdk
cheme Feb 15, 2024
e911ebc
Allow non send sync db
cheme Feb 16, 2024
bef6e0f
Revert "Allow non send sync db"
cheme Feb 16, 2024
04ac7a0
rem ref to TrieMut
cheme Feb 16, 2024
e4b29e4
return root from apply changeset
cheme Feb 19, 2024
1b8cced
method to visit changeset to avoid apply_to cost in sc-client-db
cheme Feb 21, 2024
8ad4ee8
Revert "method to visit changeset to avoid apply_to cost in sc-client…
cheme Feb 21, 2024
d352340
empty tree change set
cheme Feb 29, 2024
8f33c2c
better naming
cheme Feb 29, 2024
8e2852f
Switch from trie-db crate to subtrie.
cheme Mar 27, 2024
71bcaf8
fix doctests
cheme Mar 27, 2024
af1b48c
ci
cheme Mar 27, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 6 additions & 12 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:

steps:
- name: Checkout Sources
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Install Rust Toolchain
uses: actions-rs/toolchain@v1
Expand All @@ -37,29 +37,23 @@ jobs:
command: test
args: --workspace

- name: Check trie-db Without Std
- name: Check subtrie Without Std
uses: actions-rs/cargo@v1
with:
command: check
args: --manifest-path trie-db/Cargo.toml --no-default-features
args: --manifest-path subtrie/Cargo.toml --no-default-features

- name: Check memory-db Without Std
- name: Check subtrie-test With bench
uses: actions-rs/cargo@v1
with:
command: check
args: --manifest-path memory-db/Cargo.toml --no-default-features

- name: Check trie-root Without Std
uses: actions-rs/cargo@v1
with:
command: check
args: --manifest-path trie-root/Cargo.toml --no-default-features
args: --manifest-path test/Cargo.toml --benches

fmt:
name: Rustfmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
with:
profile: minimal
Expand Down
15 changes: 3 additions & 12 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,16 +1,7 @@
[workspace]
members = [
"hash-db",
"memory-db",
"hash256-std-hasher",
"test-support/keccak-hasher",
"test-support/reference-trie",
"test-support/trie-standardmap",
"test-support/trie-bench",
"trie-db",
"trie-db/test",
"trie-eip1186",
"trie-eip1186/test",
"trie-root",
"trie-root/test"
"subtrie",
"test",
"reference-trie",
]
33 changes: 2 additions & 31 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,40 +4,11 @@
A generic implementation of the Base-16 Modified Merkle Tree ("Trie") data structure,
provided under the Apache2 license.

The implementation comes in two formats:

- Trie DB (`trie-db` crate) which can be combined with a backend database to provide
a persistent trie structure whose contents can be modified and whose root hash
is recalculated efficiently.
- Trie Root (`trie-root` crate) which provides a closed-form function that accepts a
enumeration of keys and values and provides a root calculated entirely in-memory and
closed form.

Trie Hash alone is able to be used in `no_std` builds by disabling its (default)
`std` feature.
Implementation is in `subtrie` crate.

In addition to these, several support crates are provided:

- `hash-db` crate, used to provide `Hasher` (trait for all things that
can make cryptographic hashes) and `HashDB` (trait for databases that can have byte
slices pushed into them and allow for them to be retrieved based on their hash).
Suitable for `no_std`, though in this case will only provide `Hasher`.
- `memory-db` crate, contains `MemoryDB`, an implementation of a `HashDB` using only
in in-memory map.
- `hash256-std-hasher` crate, an implementation of a `std::hash::Hasher` for 32-byte
keys that have already been hashed. Useful to build the backing `HashMap` for `MemoryDB`.

There are also three crates used only for testing:

- `keccak-hasher` crate, an implementation of `Hasher` based on the Keccak-256 algorithm.
- `reference-trie` crate, an implementation of a simple trie format; this provides both
a `NodeCodec` and `TrieStream` implementation making it suitable for both Trie DB and
Trie Root.
- `trie-standardmap` crate, a key/value generation tool for creating large test datasets
to specific qualities.
- `trie-bench` crate, a comprehensive standard benchmarking tool for trie format
implementations. Works using the `criterion` project so benchmarking can be done with
the stable rustc branch.
Testing in `reference-trie` crate and `trie-db-test`.

In the spirit of all things Rust, this aims to be reliable, secure, and high performance.

Expand Down
10 changes: 0 additions & 10 deletions hash-db/CHANGELOG.md

This file was deleted.

14 changes: 0 additions & 14 deletions hash-db/Cargo.toml

This file was deleted.

4 changes: 0 additions & 4 deletions hash-db/README.md

This file was deleted.

216 changes: 0 additions & 216 deletions hash-db/src/lib.rs

This file was deleted.

2 changes: 1 addition & 1 deletion hash256-std-hasher/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ harness = false
crunchy = "0.2.1"

[dev-dependencies]
criterion = "0.4.0"
criterion = "0.5.1"

[features]
default = ["std"]
Expand Down
Loading
Loading