This repository has been archived by the owner on Nov 15, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Rework storage iterators #13284
Merged
paritytech-processbot
merged 27 commits into
paritytech:master
from
koute:master_rework_storage_iterators
Feb 22, 2023
Merged
Rework storage iterators #13284
Changes from 14 commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
523ddf5
Rework storage iterators
koute 8497910
Make sure storage iteration is also accounted for when benchmarking
koute e6b35c9
Use `trie-db` from crates.io
koute 6b640c8
Merge remote-tracking branch 'origin/master' into master_rework_stora…
koute 2556581
Appease clippy
koute 1f1ff7a
Bump `trie-bench` to 0.35.0
koute fa3edbd
Fix tests' compilation
koute 4be0cad
Update comment to clarify how `IterArgs::start_at` works
koute 825ba75
Add extra tests
koute 65d99ed
Fix iterators on `Client` so that they behave as before
koute ab0fff6
Add extra `unwrap`s in tests
koute 2e41604
More clippy fixes
koute b5ce5f5
Come on clippy, give me a break already
koute 104894b
Merge remote-tracking branch 'origin/master' into master_rework_stora…
koute e049042
Rename `allow_missing` to `stop_on_incomplete_database`
koute 079e6ab
Merge remote-tracking branch 'origin/master' into master_rework_stora…
koute 387c600
Add `#[inline]` to `with_recorder_and_cache`
koute 962cdbc
Use `with_recorder_and_cache` in `with_trie_db`; add doc comment
koute 6582bc9
Simplify code: use `with_trie_db` in `next_storage_key_from_root`
koute 0569cb8
Remove `expect`s in the benchmarking CLI
koute 0c332c6
Add extra doc comments
koute 4717063
Move `RawIter` before `TrieBackendEssence` (no code changes; just cut…
koute 2516435
Remove a TODO in tests
koute fa585d9
Update comment for `StorageIterator::was_complete`
koute 17b1356
Merge remote-tracking branch 'origin/master' into master_rework_stora…
koute fdb6b63
Update `trie-db` to 0.25.1
koute fedc9f3
Merge remote-tracking branch 'origin/master' into master_rework_stora…
koute 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
Oops, something went wrong.
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.
Note: the iterators on the storage backend and on
Client
work differently regarding thestart_at
.For the backend if a
start_at
is specified then it will seek to that key and it will always include that key in the iterator's output. For theClient
if the key specified instart_at
matches exactly the first key it encounters then it skips that key.This inconsistency is a little confusing, but that's how it works.
I've added some extra tests that verify this behavior, and I've also checked that they pass before my changes.
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.
Yes that's a point to be extremely careful with, retaining the sometime ~ behavior of iteration calls from the existing host functions (all that is touched by
clear_prefix
from sp_externalities).I remember something ~ with the way error are handled, but I may be confusing with something else.
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.
Yeah, I'll probably run a full burn-in before merging this just to make sure nothing's broken.