benchmarking: Support child trie key whitelisting#10992
Open
benchmarking: Support child trie key whitelisting#10992
Conversation
Extends the benchmarking framework to support whitelisting child trie storage keys, which enables accurate PoV (Proof of Validity) measurement for pallets that use child tries (e.g. pallet-revive for contract storage). Changes: - Add `child_trie_key` field to `TrackedStorageKey` with `new_child()` constructor - Add `add_to_whitelist_child()` helper function - Update whitelist pre-read in both v1 and v2 benchmark macros to handle child trie keys via `child::get_raw()` - Fix stale whitelist bug: `on_before_start` now reads from the global whitelist (`get_whitelist()`) instead of a captured local copy, so keys added during benchmark setup are properly pre-loaded - Export `ChildInfo` from `frame_support::storage` Without this fix, whitelisting child trie keys had no effect on PoV measurement because: 1. The pre-read only used `unhashed::get_raw()` (main storage only) 2. The pre-read iterated a local whitelist copy that missed keys added during benchmark setup via `add_to_whitelist()`
Contributor
Author
|
/cmd prdoc --audience runtime_dev --bump patch |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Extends the benchmarking framework to support whitelisting child trie storage keys, enabling accurate PoV measurement for pallets that use child tries (e.g.
pallet-revivefor contract storage).child_trie_key: Option<Vec<u8>>field toTrackedStorageKeywithnew_child()constructoradd_to_whitelist_child()helper function for benchmarkschild::get_raw()on_before_startnow reads from the global whitelist (get_whitelist()) instead of a captured local copy, so keys added during benchmark setup are properly pre-loadedChildInfofromframe_support::storageProblem
Calling
add_to_whitelist()oradd_to_whitelist_child()during benchmark setup had no effect on PoV measurement because:unhashed::get_raw()which doesn't work for child tries