-
Notifications
You must be signed in to change notification settings - Fork 70
Deprecate heapsize #14
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
Merged
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
c2e19fc
use parity-util-mem to get heapsize of memory db
cheme 4284b85
Use github temp instead of local
cheme cba8e5e
keep version update for later (first need to get util-mem published)
cheme 2a1d3bb
Deprecated heapsize only if feature activated (note the value was alr…
cheme 7d8022c
Merge branch 'master' into deprecate_heapsize
cheme 0112297
improve import of malloc, and change deprecated message.
cheme 6c01e71
Use published crate
cheme ecef806
Full crate version update (mem db is use by hash and trie so updating
cheme 4fbc110
no_std for parity util mem
cheme cfe6c0b
Add prefix and empty prefix.
cheme e670d38
Needed clone on kf
cheme 2ec922a
manually implement partialeq to memorydb
cheme 3867002
Fix maybedebug trait absence.
cheme 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
This file contains hidden or 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[package] | ||
name = "hash-db" | ||
version = "0.12.2" | ||
version = "0.12.3" | ||
authors = ["Parity Technologies <[email protected]>"] | ||
description = "Trait for hash-keyed databases." | ||
license = "Apache-2.0" | ||
|
This file contains hidden or 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 hidden or 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
[package] | ||
name = "hash256-std-hasher" | ||
description = "Standard library hasher for 256-bit prehashed keys." | ||
version = "0.12.2" | ||
version = "0.12.3" | ||
authors = ["Parity Technologies <[email protected]>"] | ||
license = "Apache-2.0" | ||
homepage = "https://github.com/paritytech/trie" | ||
|
This file contains hidden or 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,29 @@ | ||
[package] | ||
name = "memory-db" | ||
version = "0.12.2" | ||
version = "0.12.3" | ||
authors = ["Parity Technologies <[email protected]>"] | ||
description = "In-memory implementation of hash-db, useful for tests" | ||
repository = "https://github.com/paritytech/trie" | ||
license = "Apache-2.0" | ||
|
||
[dependencies] | ||
heapsize = { version = "0.4", optional = true} | ||
hash-db = { path = "../hash-db", default-features = false, version = "0.12.2"} | ||
heapsize = { version = "0.4", optional = true } | ||
parity-util-mem = { version = "0.1", default-features = false } | ||
hash-db = { path = "../hash-db", default-features = false, version = "0.12.3"} | ||
hashmap_core = { version = "0.1" } | ||
|
||
[dev-dependencies] | ||
keccak-hasher = { path = "../test-support/keccak-hasher", version = "0.12.2"} | ||
keccak-hasher = { path = "../test-support/keccak-hasher", version = "0.12.3"} | ||
criterion = "0.2.8" | ||
|
||
[features] | ||
default = ["std"] | ||
std = [ | ||
"heapsize", | ||
"hash-db/std", | ||
"hashmap_core/disable", | ||
"parity-util-mem/std", | ||
] | ||
deprecated = [ "heapsize" ] | ||
|
||
[[bench]] | ||
name = "bench" | ||
|
This file contains hidden or 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 hidden or 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
[package] | ||
name = "keccak-hasher" | ||
version = "0.12.2" | ||
version = "0.12.3" | ||
authors = ["Parity Technologies <[email protected]>"] | ||
description = "Keccak-256 implementation of the Hasher trait" | ||
repository = "https://github.com/paritytech/parity/" | ||
license = "Apache-2.0" | ||
|
||
[dependencies] | ||
tiny-keccak = "1.4.2" | ||
hash-db = { path = "../../hash-db", default-features = false, version = "0.12.2" } | ||
hash256-std-hasher = { path = "../../hash256-std-hasher", version = "0.12.2" } | ||
hash-db = { path = "../../hash-db", default-features = false, version = "0.12.3" } | ||
hash256-std-hasher = { path = "../../hash256-std-hasher", version = "0.12.3" } | ||
|
||
[features] | ||
default = ["std"] | ||
|
This file contains hidden or 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,22 @@ | ||
[package] | ||
name = "reference-trie" | ||
version = "0.12.2" | ||
version = "0.12.3" | ||
authors = ["Parity Technologies <[email protected]>"] | ||
description = "Simple reference trie format" | ||
repository = "https://github.com/paritytech/trie/" | ||
license = "Apache-2.0" | ||
|
||
[dependencies] | ||
hash-db = { path = "../../hash-db" , version = "0.12.2"} | ||
hash256-std-hasher = { path = "../../hash256-std-hasher", version = "0.12.2" } | ||
keccak-hasher = { path = "../keccak-hasher", version = "0.12.2" } | ||
trie-db = { path = "../../trie-db", default-features = false, version = "0.12.2"} | ||
trie-root = { path = "../../trie-root", default-features = false, version = "0.12.2" } | ||
hash-db = { path = "../../hash-db" , version = "0.12.3"} | ||
hash256-std-hasher = { path = "../../hash256-std-hasher", version = "0.12.3" } | ||
keccak-hasher = { path = "../keccak-hasher", version = "0.12.3" } | ||
trie-db = { path = "../../trie-db", default-features = false, version = "0.12.3"} | ||
trie-root = { path = "../../trie-root", default-features = false, version = "0.12.3" } | ||
parity-codec = "3.0" | ||
parity-codec-derive = "3.0" | ||
|
||
[dev-dependencies] | ||
trie-bench = { path = "../trie-bench", version = "0.12.2" } | ||
trie-bench = { path = "../trie-bench", version = "0.12.3" } | ||
criterion = "0.2.8" | ||
|
||
[[bench]] | ||
|
This file contains hidden or 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,16 @@ | ||
[package] | ||
name = "trie-bench" | ||
description = "Standard benchmarking suite for tries" | ||
version = "0.12.2" | ||
version = "0.12.3" | ||
authors = ["Parity Technologies <[email protected]>"] | ||
license = "Apache-2.0" | ||
|
||
[dependencies] | ||
keccak-hasher = { path = "../keccak-hasher", version = "0.12.2" } | ||
trie-standardmap = { path = "../trie-standardmap", version = "0.12.2" } | ||
hash-db = { path = "../../hash-db" , version = "0.12.2"} | ||
memory-db = { path = "../../memory-db", version = "0.12.2" } | ||
trie-root = { path = "../../trie-root", version = "0.12.2" } | ||
trie-db = { path = "../../trie-db", version = "0.12.2" } | ||
keccak-hasher = { path = "../keccak-hasher", version = "0.12.3" } | ||
trie-standardmap = { path = "../trie-standardmap", version = "0.12.3" } | ||
hash-db = { path = "../../hash-db" , version = "0.12.3"} | ||
memory-db = { path = "../../memory-db", version = "0.12.3" } | ||
trie-root = { path = "../../trie-root", version = "0.12.3" } | ||
trie-db = { path = "../../trie-db", version = "0.12.3" } | ||
criterion = "0.2.8" | ||
parity-codec = "3.0" |
This file contains hidden or 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,5 +6,5 @@ authors = ["Parity Technologies <[email protected]>"] | |
license = "Apache-2.0" | ||
|
||
[dependencies] | ||
keccak-hasher = { path = "../keccak-hasher", version = "0.12.2"} | ||
hash-db = { path = "../../hash-db" , version = "0.12.2"} | ||
keccak-hasher = { path = "../keccak-hasher", version = "0.12.3"} | ||
hash-db = { path = "../../hash-db" , version = "0.12.3"} |
This file contains hidden or 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[package] | ||
name = "trie-db" | ||
version = "0.12.2" | ||
version = "0.12.3" | ||
authors = ["Parity Technologies <[email protected]>"] | ||
description = "Merkle-Patricia Trie generic over key hasher and node encoding" | ||
repository = "https://github.com/paritytech/trie" | ||
|
@@ -10,17 +10,17 @@ license = "Apache-2.0" | |
log = "0.4" | ||
rand = { version = "0.6", default-features = false } | ||
elastic-array = { version = "0.10", default-features = false } | ||
hash-db = { path = "../hash-db", default-features = false, version = "0.12.2"} | ||
hash-db = { path = "../hash-db", default-features = false, version = "0.12.3"} | ||
hashmap_core = { version = "0.1" } | ||
|
||
[dev-dependencies] | ||
env_logger = "0.6" | ||
memory-db = { path = "../memory-db", version = "0.12.2" } | ||
trie-root = { path = "../trie-root", version = "0.12.2"} | ||
trie-standardmap = { path = "../test-support/trie-standardmap", version = "0.12.2" } | ||
keccak-hasher = { path = "../test-support/keccak-hasher", version = "0.12.2" } | ||
memory-db = { path = "../memory-db", version = "0.12.3" } | ||
trie-root = { path = "../trie-root", version = "0.12.3"} | ||
trie-standardmap = { path = "../test-support/trie-standardmap", version = "0.12.3" } | ||
keccak-hasher = { path = "../test-support/keccak-hasher", version = "0.12.3" } | ||
# DISABLE the following line when publishing until cyclic dependencies are resolved https://github.com/rust-lang/cargo/issues/4242 | ||
reference-trie = { path = "../test-support/reference-trie", version = "0.12.2" } | ||
reference-trie = { path = "../test-support/reference-trie", version = "0.12.3" } | ||
hex-literal = "0.1" | ||
criterion = "0.2.8" | ||
|
||
|
This file contains hidden or 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,21 @@ | ||
[package] | ||
name = "trie-root" | ||
version = "0.12.2" | ||
version = "0.12.3" | ||
authors = ["Parity Technologies <[email protected]>"] | ||
description = "In-memory patricia trie operations" | ||
repository = "https://github.com/paritytech/trie" | ||
license = "Apache-2.0" | ||
categories = [ "no-std" ] | ||
|
||
[dependencies] | ||
hash-db = { path = "../hash-db", default-features = false, version = "0.12.2"} | ||
hash-db = { path = "../hash-db", default-features = false, version = "0.12.3"} | ||
|
||
[dev-dependencies] | ||
hex-literal = "0.1" | ||
keccak-hasher = { path = "../test-support/keccak-hasher", version = "0.12.2" } | ||
trie-standardmap = { path = "../test-support/trie-standardmap", version = "0.12.2" } | ||
keccak-hasher = { path = "../test-support/keccak-hasher", version = "0.12.3" } | ||
trie-standardmap = { path = "../test-support/trie-standardmap", version = "0.12.3" } | ||
# DISABLE the following line when publishing until cyclic dependencies are resolved https://github.com/rust-lang/cargo/issues/4242 | ||
reference-trie = { path = "../test-support/reference-trie", version = "0.12.2" } | ||
reference-trie = { path = "../test-support/reference-trie", version = "0.12.3" } | ||
|
||
[features] | ||
default = ["std"] | ||
|
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.
Can you help me understand what this does?
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.
That is an additional information that can be use to ensure key uniqueness in the hashdb.
Basically we do not reference count the key value; if some different nodes in the trie contains the same content a pruning conflict will occur.
For ethereum, the constructed keys are long and unique enough so that leaf contains a part of the key big enough to ensure that it is hash is unique and no rc is needed (intermediatory node containing those leaf hash that is also the case). This really depends on the way keys are build.
In substrate where the use cases are more open, there was this pruning issue, solution there was to add the path in the trie to the info (unique by nature of the trie), we did not have to use reference count.
There trie issue with the merged pr contains more info (I did not understand directly so I asked my questions there).
So for parity ethereum, this is strictly overhead, note that with my trie pr about removal of extension, this overhead gets a bit reduced (there is also an interesting scheme that add the prefix in an ordered encoding to try to allow iteration directly from rocksdb but I do not know if it is worth the overhead (unless the state is totally pruned that does not allow state iteration still can be use for some analysis)).