BlockAtRegistration

Storage Map v101 → v472 · 1 shape change

Block number when a neuron registered.

Explore chain
Queried by: minersvalidatorsdevelopersanalytics

The Big Picture

This records when each neuron first registered. Combined with ImmunityPeriod, it determines if a neuron is still protected from pruning. Also useful for tenure analysis - how long have neurons been active?

Why This Matters

Are you still immune from pruning? Check (current_block - BlockAtRegistration) < ImmunityPeriod. Also shows your tenure on the subnet.

Example Scenario

Query BlockAtRegistration(netuid=1, uid=47) returns 7000000. Current block is 7005000. You registered 5000 blocks ago. If ImmunityPeriod is 7200, you're still protected.

Common Questions

What if I re-register?
If you're pruned and re-register, BlockAtRegistration updates to the new registration. You get a fresh immunity period.
Can I check other neurons' registration time?
Yes, this is public. You can see when any neuron registered and calculate their age and immunity status.

Use Cases

  • Check if you're still in immunity period
  • Calculate neuron age on a subnet
  • Build neuron tenure analytics
  • Research registration patterns over time
  • Debug immunity-related issues

From Chain Metadata

DMAP ( netuid, uid ) --> block_at_registration

Purpose & Usage

Purpose

Track registration timing for immunity - when did this neuron first appear.

Common Query Patterns

  • Query by netuid-uid
  • Calculate immunity status
  • Research neuron age
Part of: Neuron Pruning

Migration Notes

v424 v432 Breaking

key type changed from (u16, u16) to (NetUid, u16)

Update decoders: SCALE encoding is positional, so any signature change (added, removed, or type-changed fields, or storage shape changes) shifts byte offsets and existing decoders will misparse this item. Re-derive types from the new metadata.

Query Keys

#NameTypeDescription
1
netuid
NetUid netuid (NetUid, hashed key component)
2
uid
u16 uid (u16, hashed key component)

Stored Value

block_at_registration (u64)

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.

Relationships

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 BlockAtRegistration storage
const netuid = 1;
const uid = 0;

const result = await api.query.SubtensorModule.BlockAtRegistration.getValue(netuid, uid);
console.log("BlockAtRegistration:", result);

On-Chain Activity

Write Frequency
●●●●○○ Medium 100K–1M est. writes

100K–1M estimated writes

#29 most written storage item

Write Source User Extrinsics

Modified via user-submitted extrinsics

As of block 7,429,232

Version History

v101 block 1 Added
v425–v431 · runtime versions skipped on chain (never deployed)
v432 block 8,636,190 Shape changed Current
  • key : (u16, u16) → (NetUid, u16)

Runtime Info

View Source
Pallet
SubtensorModule
Storage Kind
Map
First Version
v101
Current Version
v472