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

srml: system: add kill_prefix #3729

Merged
merged 2 commits into from
Oct 1, 2019
Merged

srml: system: add kill_prefix #3729

merged 2 commits into from
Oct 1, 2019

Conversation

andresilva
Copy link
Contributor

Add a kill_prefix extrinsic to system. This is useful to manually cleanup storage from double maps (needed as a result of #3724 but should be useful in general).

@andresilva andresilva added A0-please_review Pull request needs code review. M4-core labels Sep 30, 2019
@andresilva andresilva force-pushed the andre/system-kill-prefix branch from bf17948 to 96c3bbf Compare September 30, 2019 21:07
@andresilva andresilva changed the title srml: add System::kill_prefix srml: system: add kill_prefix Sep 30, 2019
@@ -278,6 +278,13 @@ decl_module! {
storage::unhashed::kill(&key);
}
}

/// Kill all storage items with a key that starts with the given prefix.
#[weight = SimpleDispatchInfo::FixedOperational(10_000)]
Copy link
Contributor Author

Choose a reason for hiding this comment

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

What should we set this to?

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

it's entirely dependent on state, so we'd need a specialised weight type. and calculating it would take about as long as actually doing it, so kind of pointless. in any case it's root-only, so doesn't actually matter.

Copy link
Contributor

Choose a reason for hiding this comment

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

@bkchr bkchr merged commit aae1a9e into master Oct 1, 2019
@bkchr bkchr deleted the andre/system-kill-prefix branch October 1, 2019 06:44
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants