-
Notifications
You must be signed in to change notification settings - Fork 721
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
chainHead: Add support for storage closest merkle descendant #14818 #1153
Conversation
Signed-off-by: Alexandru Vasile <[email protected]>
Signed-off-by: Alexandru Vasile <[email protected]>
Signed-off-by: Alexandru Vasile <[email protected]>
Signed-off-by: Alexandru Vasile <[email protected]>
Signed-off-by: Alexandru Vasile <[email protected]>
and TrieBackend Signed-off-by: Alexandru Vasile <[email protected]>
Signed-off-by: Alexandru Vasile <[email protected]>
Signed-off-by: Alexandru Vasile <[email protected]>
Signed-off-by: Alexandru Vasile <[email protected]>
…_db_merkle Signed-off-by: Alexandru Vasile <[email protected]>
Signed-off-by: Alexandru Vasile <[email protected]>
Signed-off-by: Alexandru Vasile <[email protected]>
Signed-off-by: Alexandru Vasile <[email protected]>
Signed-off-by: Alexandru Vasile <[email protected]>
Signed-off-by: Alexandru Vasile <[email protected]>
Signed-off-by: Alexandru Vasile <[email protected]>
Signed-off-by: Alexandru Vasile <[email protected]>
This PR updates: - trie-db from 0.27.1 to 0.28.0 - trie-bench from 0.37.0 to 0.38.0 (deb-dependency) While at it, also adapts the recorder to take into account the newly added `TrieAccess::InlineValue`. Needed by: - #1153 @paritytech/subxt-team --------- Signed-off-by: Alexandru Vasile <[email protected]> Co-authored-by: Bastian Köcher <[email protected]>
…_db_merkle Signed-off-by: Alexandru Vasile <[email protected]>
This PR updates: - trie-db from 0.27.1 to 0.28.0 - trie-bench from 0.37.0 to 0.38.0 (deb-dependency) While at it, also adapts the recorder to take into account the newly added `TrieAccess::InlineValue`. Needed by: - paritytech/polkadot-sdk#1153 @paritytech/subxt-team --------- Signed-off-by: Alexandru Vasile <[email protected]> Co-authored-by: Bastian Köcher <[email protected]>
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.
Looks nice!
Co-authored-by: Sebastian Kunert <[email protected]>
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.
I don't know too much about how substrate handles storage, but since the changes got merged into sp-trie
and this PR mostly forwards to functions from sp-trie
I think this should be all good. Good work!
key: &[u8], | ||
) -> Result<Option<MerkleValue<B::Hash>>, Self::Error> { | ||
self.state.closest_merkle_value(key) | ||
} |
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.
Question: What does it mean here, if an Error is returned, vs. an Option is returned? Under what circumstances can errors happen?
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.
In this case, the Option
tells us if there is descendant merkle value below the provided key, since the key may not be in the database and may not have any descendants.
On the other hand, the error is a way to propagate that something went wrong during this operation. Mainly on the trie-db side:
- unable to fetch bytes from the database (invalid state root / incomplete data)
- corrupted data (failing to decode the node)
Here would be the main place from which those errors originate
This PR updates: - trie-db from 0.27.1 to 0.28.0 - trie-bench from 0.37.0 to 0.38.0 (deb-dependency) While at it, also adapts the recorder to take into account the newly added `TrieAccess::InlineValue`. Needed by: - paritytech#1153 @paritytech/subxt-team --------- Signed-off-by: Alexandru Vasile <[email protected]> Co-authored-by: Bastian Köcher <[email protected]>
…aritytech#1153) This PR adds support for fetching the closest merkle value of some key. Builds on top of - paritytech/trie#199 Migrates paritytech/substrate#14818 to the monorepo. Closes: paritytech/substrate#14550 Closes: paritytech#1506 // @paritytech/subxt-team --------- Signed-off-by: Alexandru Vasile <[email protected]> Co-authored-by: Sebastian Kunert <[email protected]>
…nt` (paritytech#1153) * Refactor logic * Thanks svyatonik help, it compile * Fix failed unit test * Remove compile warning * Rename * Return result in pay_relayers_rewards * Fix runtime compile issue * Use MessageNonce * Fix review issue * Missing u64 replacement * Revert return type changes * Fix merge issue * Remove useless clone
…nt` (paritytech#1153) * Refactor logic * Thanks svyatonik help, it compile * Fix failed unit test * Remove compile warning * Rename * Return result in pay_relayers_rewards * Fix runtime compile issue * Use MessageNonce * Fix review issue * Missing u64 replacement * Revert return type changes * Fix merge issue * Remove useless clone
…nt` (paritytech#1153) * Refactor logic * Thanks svyatonik help, it compile * Fix failed unit test * Remove compile warning * Rename * Return result in pay_relayers_rewards * Fix runtime compile issue * Use MessageNonce * Fix review issue * Missing u64 replacement * Revert return type changes * Fix merge issue * Remove useless clone
…nt` (paritytech#1153) * Refactor logic * Thanks svyatonik help, it compile * Fix failed unit test * Remove compile warning * Rename * Return result in pay_relayers_rewards * Fix runtime compile issue * Use MessageNonce * Fix review issue * Missing u64 replacement * Revert return type changes * Fix merge issue * Remove useless clone
…nt` (paritytech#1153) * Refactor logic * Thanks svyatonik help, it compile * Fix failed unit test * Remove compile warning * Rename * Return result in pay_relayers_rewards * Fix runtime compile issue * Use MessageNonce * Fix review issue * Missing u64 replacement * Revert return type changes * Fix merge issue * Remove useless clone
…nt` (paritytech#1153) * Refactor logic * Thanks svyatonik help, it compile * Fix failed unit test * Remove compile warning * Rename * Return result in pay_relayers_rewards * Fix runtime compile issue * Use MessageNonce * Fix review issue * Missing u64 replacement * Revert return type changes * Fix merge issue * Remove useless clone
…nt` (paritytech#1153) * Refactor logic * Thanks svyatonik help, it compile * Fix failed unit test * Remove compile warning * Rename * Return result in pay_relayers_rewards * Fix runtime compile issue * Use MessageNonce * Fix review issue * Missing u64 replacement * Revert return type changes * Fix merge issue * Remove useless clone
…nt` (paritytech#1153) * Refactor logic * Thanks svyatonik help, it compile * Fix failed unit test * Remove compile warning * Rename * Return result in pay_relayers_rewards * Fix runtime compile issue * Use MessageNonce * Fix review issue * Missing u64 replacement * Revert return type changes * Fix merge issue * Remove useless clone
…nt` (paritytech#1153) * Refactor logic * Thanks svyatonik help, it compile * Fix failed unit test * Remove compile warning * Rename * Return result in pay_relayers_rewards * Fix runtime compile issue * Use MessageNonce * Fix review issue * Missing u64 replacement * Revert return type changes * Fix merge issue * Remove useless clone
…nt` (paritytech#1153) * Refactor logic * Thanks svyatonik help, it compile * Fix failed unit test * Remove compile warning * Rename * Return result in pay_relayers_rewards * Fix runtime compile issue * Use MessageNonce * Fix review issue * Missing u64 replacement * Revert return type changes * Fix merge issue * Remove useless clone
…nt` (paritytech#1153) * Refactor logic * Thanks svyatonik help, it compile * Fix failed unit test * Remove compile warning * Rename * Return result in pay_relayers_rewards * Fix runtime compile issue * Use MessageNonce * Fix review issue * Missing u64 replacement * Revert return type changes * Fix merge issue * Remove useless clone
…nt` (paritytech#1153) * Refactor logic * Thanks svyatonik help, it compile * Fix failed unit test * Remove compile warning * Rename * Return result in pay_relayers_rewards * Fix runtime compile issue * Use MessageNonce * Fix review issue * Missing u64 replacement * Revert return type changes * Fix merge issue * Remove useless clone
…nt` (#1153) * Refactor logic * Thanks svyatonik help, it compile * Fix failed unit test * Remove compile warning * Rename * Return result in pay_relayers_rewards * Fix runtime compile issue * Use MessageNonce * Fix review issue * Missing u64 replacement * Revert return type changes * Fix merge issue * Remove useless clone
This PR adds support for fetching the closest merkle value of some key.
Builds on top of
Migrates paritytech/substrate#14818 to the monorepo.
Closes: paritytech/substrate#14550
Closes: #1506
// @paritytech/subxt-team