DeletionQueue

Storage Map v334 → current

Queue of contracts marked for deletion.

Explore chain
Queried by: developers

The Big Picture

Contract deletion can be expensive. This queue holds contracts being cleaned up incrementally, spreading the cost across multiple blocks.

Use Cases

  • Monitor cleanup progress
  • Debug termination issues

From Chain Metadata

Evicted contracts that await child trie deletion. Child trie deletion is a heavy operation depending on the amount of storage items stored in said trie. Therefore this operation is performed lazily in `on_idle`.

Purpose & Usage

Purpose

Tracks contracts being cleaned up after termination.

Common Query Patterns

  • Query by index
  • Iterate for pending deletions

Query Keys

#NameTypeDescription
1
key1
u32 key1 (u32)

Stored Value

value (BoundedVec)

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 });

// Query DeletionQueue storage
const key1 = 0;

const result = await api.query
  [stringCamelCase("Contracts")]
  [stringCamelCase("DeletionQueue")](
  key1
);

console.log("DeletionQueue:", result.toHuman());

Runtime Info

Pallet
Contracts
Storage Kind
Map
First Version
v334
Current Version
v393