Consensus
Storage Map v101 → v411 Changed in v411Consensus scores for neurons on a subnet .
Explore chainThe Big Picture
Consensus score measures how well a neuron's weights align with the network consensus. Validators with high consensus are in agreement with others. Low consensus suggests the validator is an outlier - either innovative or potentially malicious.
Why This Matters
Is this validator scoring like everyone else, or going against the grain? High consensus = mainstream views. Low consensus = outlier behavior (could be good or bad).
Example Scenario
Query Consensus(netuid=1, uid=5) returns 0.92. This validator is 92% aligned with network consensus - very mainstream. A score of 0.3 would indicate significant disagreement with other validators.
Common Questions
- Is high consensus always good?
- Usually, but not always. Very high consensus everywhere could mean validators are lazy/copying. Some healthy disagreement shows independent thinking.
- How does this differ from trust?
- Trust is about a neuron receiving consistent ratings. Consensus is about a validator giving ratings that align with others.
Use Cases
- Measure validator's alignment with network consensus
- Identify outlier validators with unusual scoring
- Build consensus health monitoring tools
- Research consensus mechanism dynamics
From Chain Metadata
MAP ( netuid ) --> consensus
Purpose & Usage
Purpose
Track consensus participation.
Common Query Patterns
- Query by netuid-uid
Query Keys
| # | Name | Type | Description |
|---|---|---|---|
| 1 | netuid | u16 | netuid (u16, hashed key component) |
Stored Value
consensus (Vec<u16>)
Relationships
Modified By
Related Events
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 Consensus storage
const netuid = 1;
const result = await api.query.SubtensorModule.Consensus.getValue(netuid);
console.log("Consensus:", result);On-Chain Activity
100K–1M estimated writes
#33 most written storage item
Modified by both user extrinsics and runtime hooks
As of block 7,429,232
Version History
Runtime Info
View Source- Pallet
- SubtensorModule
- Storage Kind
- Map
- First Version
- v101
- Current Version
- v411