Skip to content

Conversation

@cheme
Copy link

@cheme cheme commented Mar 27, 2024

changes from paritytech#210 .

I also rename the main crate trie-db to subtrie version 0.0.1 so we can publish it freely, cc @arkpar sounds good?

arkpar and others added 30 commits August 10, 2023 18:25
* trie-db: Add `get_closest_merkle_value` to Trie trait

Signed-off-by: Alexandru Vasile <[email protected]>

* trie-db: Extract the merkle value

Signed-off-by: Alexandru Vasile <[email protected]>

* trie-db/test: Check merkle value on update key

Signed-off-by: Alexandru Vasile <[email protected]>

* Update trie-db/src/lookup.rs

Co-authored-by: Arkadiy Paronyan <[email protected]>

* Update trie-db/src/lookup.rs

Co-authored-by: Arkadiy Paronyan <[email protected]>

* trie-db: Rename look_up_merkle_without_cache function

Signed-off-by: Alexandru Vasile <[email protected]>

* trie-db/tests: Check closest descendant of partial keys

Signed-off-by: Alexandru Vasile <[email protected]>

* trie-db: Adjust lookups for partial keys

Signed-off-by: Alexandru Vasile <[email protected]>

* trie-db/tests: Check non-existent key and branch nodes

Signed-off-by: Alexandru Vasile <[email protected]>

* trie-db: Ensure recording of `NonExisting` for leaves

Signed-off-by: Alexandru Vasile <[email protected]>

* trie-db: Ensure the merkle descedent hash is returned

Signed-off-by: Alexandru Vasile <[email protected]>

* trie-db/tests: Extend tests with branch nodes and single key db

Signed-off-by: Alexandru Vasile <[email protected]>

* trie-db/tests: Check trie modification and merkle propagation

Signed-off-by: Alexandru Vasile <[email protected]>

* trie-db/tests: Use `PrefixedKey` instead of `HashKey`

Signed-off-by: Alexandru Vasile <[email protected]>

* trie-db/tests: Test extra keys for `test_merkle_value`

Signed-off-by: Alexandru Vasile <[email protected]>

* trie-db: Return the extension node hash

Signed-off-by: Alexandru Vasile <[email protected]>

* trie-db: Use `starts_with` method instead of common prefix

Signed-off-by: Alexandru Vasile <[email protected]>

* trie-db: Return no merkle value on empty node

Signed-off-by: Alexandru Vasile <[email protected]>

* trie-db/tests: Ensure inline nodes

Signed-off-by: Alexandru Vasile <[email protected]>

* trie-db/tests: Check empty trie with empty keys

Signed-off-by: Alexandru Vasile <[email protected]>

* trie-db/tests: Add extra keys to check

Signed-off-by: Alexandru Vasile <[email protected]>

* trie-db: Use `starts_with` for extension nodes

Signed-off-by: Alexandru Vasile <[email protected]>

* trie-db: Rename merkle lookups to lookup_first_descendant

Signed-off-by: Alexandru Vasile <[email protected]>

* trie-db: Return inline hashes properly

Signed-off-by: Alexandru Vasile <[email protected]>

* trie-db: Implement starts_with_slice for NibbleVec

Signed-off-by: Alexandru Vasile <[email protected]>

* trie-db: Use cache for finding first descendent hash

Signed-off-by: Alexandru Vasile <[email protected]>

* trie-db: Introduce caching for descedent node access

Signed-off-by: Alexandru Vasile <[email protected]>

* trie-db: Use rstd::vec::Vec

Signed-off-by: Alexandru Vasile <[email protected]>

* trie-db: Forward merkle value for fatdb and sectriedb

Signed-off-by: Alexandru Vasile <[email protected]>

* trie-db: Rename `get_closest_merkle_value` to `lookup_first_descendant`

Signed-off-by: Alexandru Vasile <[email protected]>

* trie-db: Introduce MerkleValue to return inline nodes and hashes

Signed-off-by: Alexandru Vasile <[email protected]>

* trie-db: Remove inner function for merkle value lookups

Signed-off-by: Alexandru Vasile <[email protected]>

* Update trie-db/src/lib.rs

Co-authored-by: Bastian Köcher <[email protected]>

* Update trie-db/src/lib.rs

Co-authored-by: Bastian Köcher <[email protected]>

* Apply fmt

Signed-off-by: Alexandru Vasile <[email protected]>

---------

Signed-off-by: Alexandru Vasile <[email protected]>
Co-authored-by: Arkadiy Paronyan <[email protected]>
Co-authored-by: Bastian Köcher <[email protected]>
…#194)

* Make `trie_nodes_recorded_for_key` work for inline values

`trie_nodes_recorded_for_key` was not working properly for inline values. It would always return `RecordedForKey::None`
while we actually have accessed and recorded all the trie nodes for the value. The pr introduces
`TrieAccess::InlineValue` to communicate this access to the recorder properly to make it then return
`RecordedForKey::Value`.

* FMT

* Add soe comments
* Update changelog

Signed-off-by: Alexandru Vasile <[email protected]>

* trie-db: Bump version to 0.28

Signed-off-by: Alexandru Vasile <[email protected]>

* Update trie-db across workspace

Signed-off-by: Alexandru Vasile <[email protected]>

* Update trie-bench to 0.38.0

Signed-off-by: Alexandru Vasile <[email protected]>

---------

Signed-off-by: Alexandru Vasile <[email protected]>
We handle `NonExisting` keys as if we have recorded the value. The reason behind this is that we have recorded all the
trie nodes to proof that the key doesn't exist in the `trie`. So, next time we want to access the key we can use the
`cache` (if present) and do not net to iterate over the trie nodes again.
Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](actions/checkout@v3...v4)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Updates the requirements on [hex-literal](https://github.com/RustCrypto/utils) to permit the latest version.
- [Release notes](https://github.com/RustCrypto/utils/releases)
- [Commits](RustCrypto/utils@hex-literal-v0.3.0...hex-literal-v0.4.0)

---
updated-dependencies:
- dependency-name: hex-literal
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* totally remove hashbrown dep

* fix no_std
Updates the requirements on [hashbrown](https://github.com/rust-lang/hashbrown) to permit the latest version.
- [Changelog](https://github.com/rust-lang/hashbrown/blob/master/CHANGELOG.md)
- [Commits](rust-lang/hashbrown@v0.13.2...v0.14.1)

---
updated-dependencies:
- dependency-name: hashbrown
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Updates the requirements on [criterion](https://github.com/bheisler/criterion.rs) to permit the latest version.
- [Changelog](https://github.com/bheisler/criterion.rs/blob/master/CHANGELOG.md)
- [Commits](bheisler/criterion.rs@0.4.0...0.5.1)

---
updated-dependencies:
- dependency-name: criterion
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
@cheme cheme merged commit 61c6261 into master Apr 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants