Skip to content
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

Support maps for whitelist_storage #7421

Open
bkchr opened this issue Feb 1, 2025 · 1 comment
Open

Support maps for whitelist_storage #7421

bkchr opened this issue Feb 1, 2025 · 1 comment
Labels
I5-enhancement An additional feature request.

Comments

@bkchr
Copy link
Member

bkchr commented Feb 1, 2025

Right now we only support storage keys for whitelist_storage (maybe the macro already supports this, but for sure the benchmarking infrastructure doesn't support this). For a map we would insert the prefix of the map as key. In the benchmarking code we would need to start checking if keys start with the prefix and then whitelist them. This should be backwards compatible, because a prefix should be unique and not be used by anything else.

@bkchr bkchr added the I5-enhancement An additional feature request. label Feb 1, 2025
@gui1117
Copy link
Contributor

gui1117 commented Feb 2, 2025

If we want to include whitelisted key in the base block weight we would also need to associated the number of keys whitelisted in the prefix.

Note that for storage of the pallet, the benchmark of the pallet can explicitly whitelist all they keys it wants with add_to_whitelist.

But this enhancement is required for whitelisting storage when benchmarking other pallets.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I5-enhancement An additional feature request.
Projects
Status: Backlog
Development

No branches or pull requests

2 participants