Consensus

The Consensus system governs how nodes in a subnet agree on the behavior and performance of each other, particularly by assigning weights (or scores) that reflect the quality of their contributions.

The Consensus class runs independently and in parallel to the main Hypertensor network logic, and is designed to execute during each epoch.

What It Does

The template provides a baseline Consensus implementation with the following responsibilities:

1. Validator

If the current node is elected as the validator for this epoch:

  • Collects or computes scores for each node (e.g., based on output similarity, task performance, latency, etc.).

  • Submits these scores on-chain to Hypertensor.

2. Attestor

If the current node is assigned as an attestor:

  • Collects or computes scores for each node.

  • Retrieves the validator’s submitted scores for the epoch.

  • Compares both sets of scores.

  • Attest if they match exactly (e.g., 100% accuracy)

📌 Attestation ensures accountability: validators must submit correct, verifiable scores, or face slashing, rejection, or reduced reputation.


Epoch Flow Overview

  1. Epoch begins (triggered by time or block height)

  2. Each node checks its role:

    • If validator: generate and publish scores

    • If attestor: independently verify the scores

  3. Attestation submitted if scores match the validator's submitted consensus data.


Customization

Subnets can extend the Consensus class to implement their own:

  • Scoring logic (not included in template)

  • Attestation criteria

  • Coordination with on-chain governance or punishment systems

Last updated