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

Frame remove_all with size limit. - #9106

Merged
5 commits merged into
paritytech:masterfrom
cheme:prefix_limit
Jun 15, 2021
Merged

5 commits merged into
paritytech:masterfrom
cheme:prefix_limit

Conversation

@cheme

@cheme cheme commented Jun 14, 2021 •

Copy link
Copy Markdown
Contributor

Fixes #9002.

Note that it breaks existing frame api (could have define new function with the limit but it does not seem good).

Affected APIs:

  • remove_prefix
  • clear_prefix
  • kill_prefix
  • remove_all

To fix these APIs to act the same as before, simply add an additional input parameter of None.

Also rename:

  • KillChildStorageResult -> KillStorageResult

polkadot companion: paritytech/polkadot#3257

@cheme cheme added A0-please_review Pull request needs code review. B7-runtimenoteworthy C1-low PR touches the given topic and has a low impact on builders. D3-trivial 🧸 PR contains trivial changes in a runtime directory that do not require an audit labels Jun 14, 2021
@cheme
cheme requested review from athei and kianenigma as code owners June 14, 2021 12:23
@shawntabrizi

Copy link
Copy Markdown
Member

Note that it breaks existing frame api

The solution is simply to add None to the end right? Not actually breaking any logic silently

@cheme

cheme commented Jun 14, 2021

Copy link
Copy Markdown
Contributor Author

Note that it breaks existing frame api

The solution is simply to add None to the end right? Not actually breaking any logic silently

Yes, updating is very straight forward. Seems better to me than having two function for the same thing.

@athei athei left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

API changes look good to me. But we need to remove some duplication.

Comment thread primitives/io/src/lib.rs
Comment thread primitives/state-machine/src/ext.rs Outdated
@shawntabrizi

Copy link
Copy Markdown
Member

bot merge

@ghost

ghost commented Jun 15, 2021

Copy link
Copy Markdown

Trying merge.

@ghost
ghost merged commit cdc55fe into paritytech:master Jun 15, 2021
@gui1117

gui1117 commented Jun 16, 2021

Copy link
Copy Markdown
Contributor

maybe it worth documenting that the function remove_all, and warn that it removes all overlay, and up to limit in the backend, people shouldn't rely on the fact that it removes exactly up to the limit.

rphmeier pushed a commit that referenced this pull request Jun 18, 2021
* remove prefixed content with limit.

* test match

* factor comment and factor ext limit removal.

* fix benchmark

Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
This pull request was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

A0-please_review Pull request needs code review. C1-low PR touches the given topic and has a low impact on builders. D2-breaksapi D3-trivial 🧸 PR contains trivial changes in a runtime directory that do not require an audit

Projects

None yet

Development

Successfully merging this pull request may close these issues.

FRAME Storage remove_all API should have a key limit

5 participants