Commitment

Event v140 → current #0

Emitted when an account sets a commitment for a subnet .

View events on chain
Useful for: validatorsminersdevelopersanalytics

The Big Picture

Commitments store subnet-specific metadata for participants. This event fires whenever that metadata is created or updated, signaling that an account has published new discoverable information like serving endpoints or public keys.

Why This Matters

When a miner or validator updates their commitment, their discovery information changes. Applications that cache this data (like validator directories or miner discovery services) need to know when to refresh.

Example Scenario

A miner updates their axon endpoint after moving to a new server. set_commitment fires, emitting this event with (netuid=3, who=miner_account). Discovery services can now query the new CommitmentOf to get the updated endpoint.

Common Questions

How do I get the actual commitment data?
This event signals a change occurred. Query CommitmentOf(netuid, who) to retrieve the full commitment data.
Can I track all commitments on a subnet?
Yes, subscribe to this event filtered by netuid to track all commitment activity on a specific subnet.

Use Cases

  • Track when participants update their metadata
  • Build directories of subnet participants
  • Monitor commitment activity for specific accounts
  • Index commitment data for discovery services

How to Use This Event

  • Subscribe to track commitment changes for specific accounts
  • Index all commitments to build participant directories
  • Monitor for serving endpoint updates from validators/miners
  • Trigger cache invalidation when commitments change
Part of: On-Chain Commitments

Triggers

Emitted by

Preconditions

  • Account is registered on the subnet
  • Commitment data within size limits

Effects

Postconditions

  • Commitment stored in CommitmentOf storage
  • LastCommitment block updated

Side Effects

  • Previous commitment (if any) is replaced
  • UsedSpaceOf updated for rate limiting

Event Data

#NameTypeDescription
0
netuid
u16 Subnet ID where commitment was made
1
who
→ account
AccountId Account that set the commitment (hex -> SS58)

Code Examples

import { ApiPromise, WsProvider } from "@polkadot/api";
import { stringCamelCase } from "@polkadot/util";

const provider = new WsProvider("wss://entrypoint-finney.opentensor.ai:443");
const api = await ApiPromise.create({ provider });

// Subscribe to Commitment events
api.query.system.events((events) => {
  events
    .filter(({ event }) =>
      event.section === stringCamelCase("Commitments") &&
      event.method === "Commitment"
    )
    .forEach(({ event }) => {
      console.log("Commitment:", event.data.toHuman());
    });
});

On-Chain Activity

Emission Frequency
●●●●○○ Significant 1M–5M emissions

Major features with millions of emissions

#12 most emitted event

As of block 7,429,232

Runtime Info

View Source
Pallet Index
18
Event Index
0
First Version
v140
Current Version
v393