CurrentSetId
Storage Plain v101 → currentMonotonically increasing counter for GRANDPA authority set changes.
Explore chainQueried by: validatorsdevelopersanalytics
The Big Picture
Every time the authority set changes, this counter increments. It's used to identify which set was active during any given period - essential for validating equivocation proofs which must reference the correct set.
Use Cases
- Track how many authority set changes have occurred since genesis
- Construct equivocation proofs (requires set ID)
- Correlate events with specific authority sets
From Chain Metadata
The number of changes (both in terms of keys and underlying economic responsibilities) in the "set" of Grandpa validators from genesis.
Purpose & Usage
Purpose
Uniquely identifies each authority set for equivocation proof validation.
Common Query Patterns
- Single value query
Stored Value
Value in RAO (÷10⁹ for TAO)
RAO -> TAO (/ 10^9)
Default Value
0 0x0000000000000000
Absent keys read as this value — querying a key that has never been written returns this default, not an error or empty result.
Code Examples
import { createClient, Binary } from "polkadot-api";
import { getWsProvider } from "polkadot-api/ws";
import { sub } from "@polkadot-api/descriptors"; // generated by: npx papi add sub -w wss://entrypoint-finney.opentensor.ai:443
const client = createClient(getWsProvider("wss://entrypoint-finney.opentensor.ai:443"));
const api = client.getTypedApi(sub);
// Query CurrentSetId storage (no keys - plain value)
const result = await api.query.Grandpa.CurrentSetId.getValue();
console.log("CurrentSetId:", result);Runtime Info
- Pallet
- Grandpa
- Storage Kind
- Plain
- First Version
- v101
- Current Version
- v472