kill_prefix
Call v101 → current #6Remove all storage items with a given prefix (root only).
View calls on chainCall Workflow
This diagram shows the call execution flow: starting with kill_prefix, passing through validation
(signature, nonce, mortality, fee payment), then pre-dispatch checks, followed by dispatch, and finally post-dispatch where ExtrinsicSuccess is emitted and fees are settled.
Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.
Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.
Click items to navigate. Pan and zoom to explore.
Used by: validatorsdevelopers
The Big Picture
Bulk deletion of storage by prefix. When a pallet is removed, this removes all its storage.
Use Cases
- Remove entire pallet storage
- Clean up all map entries
From Chain Metadata
Kill all storage items with a key that starts with the given prefix. **NOTE:** We rely on the Root origin to provide us the number of subkeys under the prefix we are removing to accurately calculate the weight of this function.
Input Parameters
Permissions
Origin
Unknown
Required Role
Permission data inferred from metadata. May be incomplete.
Requirements
- Caller is root/sudo
- Valid storage prefix
- Accurate subkey count
Effects
Postconditions
- All matching storage items deleted
Side Effects
- Can delete large amounts of data
Code Examples
import { ApiPromise, WsProvider } from "@polkadot/api";
import { stringCamelCase } from "@polkadot/util";
const provider = new WsProvider("wss://entrypoint-finney.opentensor.ai:443");
const api = await ApiPromise.create({ provider });
// Build kill_prefix call
const prefix = 0;
const subkeys = 0;
const call = api.tx[stringCamelCase("System")][stringCamelCase("kill_prefix")](
prefix,
subkeys
);Runtime Info
- Pallet Index
- 0
- Call Index
- 6
- First Version
- v101
- Current Version
- v393