Consensus

Consensus uses a similar consensus mechanism to most PoS blockchains geared towards decentralized subnets. Consensus mimics the concept of routing tables in a P2P network, where each node can recognize all other nodes or have access to the knowledge of all other nodes. Meaning, consensus requires that each node gets a score regardless of its in-subnet roles or tasks. The validator must submit scores on each node, and every other node attests to them. Subnets should be designed in such a way that scores are deterministic and attesting requires 100% accuracy.

66% Consensus

To receive rewards, the subnet must pass the required attestation rate of 66%.


Elected Subnet Validator Node

On each epoch, a Validator classified subnet node is randomly elected to be the validator to submit consensus data from each subnet. This elected subnet validator node submits a score on each node in its subnet. Subnets can optionally pass through miscellaneous data that the subnet can utilize.

Note

The election happens in the subnet slot.

The elected validator calls validate to submit consensus data

pub fn validate(
    origin: OriginFor<T>, 
    subnet_id: u32,
    data: Vec<SubnetNodeConsensusData>,
    args: Option<BoundedVec<u8, DefaultValidatorArgsLimit>>,
)
pub struct SubnetNodeConsensusData {
    pub subnet_node_id: u32,
    pub score: u128,
}

Attestors

Each other Validator classified subnet nodes can attest to the validator's consensus submission.

Attestors call attest to attest to the elected validators' consensus data

pub fn attest(
    origin: OriginFor<T>, 
    subnet_id: u32,
)

Penalties

Slashing

The elected validator is slashed for not achieving a 66% attestation ratio or for not submitting consensus data.

Validators are slashed 3.125% of their total staked balance, up to the maximum slash value of 1 TENSOR.

Given:

  • S = Validator's subnet stake (node's stake balance in subnet)

  • B = BaseSlashPercentage (as a percentage, e.g., 3.125%)

  • A = Attestation Percentage (actual %)

  • M = Minimum attestation percentage (minimum required %)

  • Max = MaxSlashAmount

Formula

and

Where

  1. Base Slash

  2. Attestation Delta

    • Attestation ratio:

      r=MAr=MA​

    • Delta (difference from 1.0):

      δ=1r=1AM\delta = 1 - r = 1 - \frac{A}{M}

  3. Adjusted Slash

  4. Max Cap

  5. Final Stake Update

Elected Validator Penalties

The elected validator can increase its penalty score by not achieving a 66% attestation ratio or by not submitting its consensus data.

Elected validators have penalties decreased for every successfully attested epoch.

Node Penalties

Nodes can have penalties increased if the validator doesn't submit them in its consensus data, and the epochs' attestation rate is at least 66%. Meaning, if the subnet comes to a consensus that a node is not in consensus, that node increases its penalties until it reaches the maximum penalties and is removed.

Nodes have penalties decreased for every successfully attested epoch they are included in the consensus.

Each node's score is used as a percentage of the sum of scores for its portion of emissions. See Incentives for more information.

Last updated