Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

FRAME Storage remove_all API should have a key limit #9002

Closed
shawntabrizi opened this issue Jun 3, 2021 · 2 comments · Fixed by #9106
Closed

FRAME Storage remove_all API should have a key limit #9002

shawntabrizi opened this issue Jun 3, 2021 · 2 comments · Fixed by #9106
Labels
C3-medium PR touches the given topic and has a medium impact on builders. Z6-mentor An easy task where a mentor is available. Please indicate in the issue who the mentor could be.

Comments

@shawntabrizi
Copy link
Member

Similar to the storage_kill api in child tries, the remove_all api on any maps should also have an optional key limit to enforce weight restrictions.

#8166

When calling remove_all, a user should also be able to include Option<u32>, which describes the maximum number of keys that can be removed at once.

At the end of the operation, you can return AllRemoved(u32) or SomeReamining(u32) with the number of items that were actually removed at the end of the operation.

Should reuse and rename KillChildStorageResult:

https://github.com/paritytech/substrate/blob/master/primitives/io/src/lib.rs#L89

@shawntabrizi shawntabrizi added Z6-mentor An easy task where a mentor is available. Please indicate in the issue who the mentor could be. C3-medium PR touches the given topic and has a medium impact on builders. labels Jun 3, 2021
@xlc
Copy link
Contributor

xlc commented Jun 3, 2021

#8742 should I close my one?

@shawntabrizi
Copy link
Member Author

ah didnt see it. Yeah this is a bit more descriptive, and I will have someone work on it soon.

This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
C3-medium PR touches the given topic and has a medium impact on builders. Z6-mentor An easy task where a mentor is available. Please indicate in the issue who the mentor could be.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants