StorageVersion

Storage Plain v101 → current

Version of the transaction payment pallet 's storage schema.

Explore chain
Queried by: developers

The Big Picture

As the runtime evolves, storage schemas may change. This version tracks which schema the pallet is using, enabling migrations during upgrades. For most users this is internal infrastructure - you only need to care about it if you're building low-level tools or debugging upgrade issues.

Why This Matters

Most users don't need this directly. It's infrastructure for runtime upgrades. If you're building tools that directly decode storage, check this to ensure your decoder matches the current schema.

Example Scenario

Query StorageVersion() returns V2. This means the pallet is using storage schema version 2. Your decoder should expect V2 format for any TransactionPayment storage items.

Common Questions

When does this change?
Only during runtime upgrades that include storage migrations for this pallet. These are rare and announced in advance.
What happens if I use the wrong version decoder?
You'll get garbage data or decoding errors. Always check StorageVersion before building custom storage decoders.

Use Cases

  • Verify storage format during node synchronization
  • Debug storage compatibility issues after upgrades
  • Build migration-aware indexing tools

Purpose & Usage

Purpose

Track storage migrations for runtime upgrades - indicates which storage format is in use.

Common Query Patterns

  • Query to verify storage format compatibility
  • Check during runtime upgrades

Stored Value

Storage schema version (Releases enum)

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 StorageVersion storage (no keys - plain value)
const result = await api.query
  [stringCamelCase("TransactionPayment")]
  [stringCamelCase("StorageVersion")]();
console.log("StorageVersion:", result.toHuman());

Runtime Info

Pallet
TransactionPayment
Storage Kind
Plain
First Version
v101
Current Version
v393