kill_storage

Call v101 → current #5

Remove storage values by key (root only).

View calls on chain

Click items to navigate. Pan and zoom to explore.

Used by: validatorsdevelopers

The Big Picture

Deletes specific storage keys. Used during migrations to clean up old storage.

Use Cases

  • Remove obsolete storage
  • Clean up after failed upgrades

From Chain Metadata

Kill some items from storage.

Input Parameters

#NameTypeDescription
0
keys
Vec<Vec<u8>> Veckeys (Vec<Vec<u8>>)

Permissions

Origin
Unknown
Required Role

Permission data inferred from metadata. May be incomplete.

Requirements

  • Caller is root/sudo
  • Valid storage keys

Effects

Postconditions

  • Storage values deleted
  • Keys return default values

Side Effects

  • Can corrupt chain state
  • Bypasses cleanup logic

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_storage call
const keys = 0;

const call = api.tx[stringCamelCase("System")][stringCamelCase("kill_storage")](
  keys
);

Runtime Info

Pallet Index
0
Call Index
5
First Version
v101
Current Version
v393