commit_timelocked_weights

Call v301 → current #113

Commits weights with a specific reveal round.

View calls on chain

Click items to navigate. Pan and zoom to explore.

Used by: validatorsdeveloperssubnet owners

The Big Picture

Standard commit-reveal has a problem: validators reveal in different blocks, so early revealers' weights are visible before late revealers commit. Timelocked commits fix this - everyone commits with the same reveal round, and reveals only become valid at that round. This ensures truly simultaneous weight publication.

Why This Matters

In sensitive subnets, even small timing advantages matter. Timelocking ensures no validator can strategically delay their reveal to see others' weights first. Everyone commits to a future round, and the chain enforces simultaneous reveals.

Example Scenario

Subnet 50 uses timelocked commits with round 1000 as the next reveal. Compute your weights, call commit_timelocked_weights(netuid=50, commit_hash=hash, reveal_round=1000). Your commit is stored but cannot be revealed until round 1000. When round 1000 arrives, all validators can reveal simultaneously.

Common Questions

Who decides the reveal round?
Usually the protocol, based on subnet parameters. All validators use the same round for a given epoch. Check subnet docs for round timing.
What happens if I commit with the wrong round?
Depends on implementation - the commit may be rejected or stored for a future round. Always use the current expected reveal round.
Can I change my weights after committing?
No - once committed, you're locked in until reveal. This is the point: preventing weight changes based on new information.

Use Cases

  • Synchronized weight reveals across all validators
  • Prevent any validator from seeing others' weights first
  • Fair consensus where all weights appear simultaneously
  • Advanced anti-manipulation for high-stakes subnets

From Chain Metadata

- Used to commit timelock encrypted commit-reveal weight values to later be revealed.

Input Parameters

#NameTypeDescription
0
netuid
u16 Subnet/network identifier (0-65535)
1
commit
BoundedVec commit (BoundedVec)
2
reveal_round
u64 reveal_round (u64)
3
commit_reveal_version
u16 commit_reveal_version (u16)

Permissions

Origin
Signed
Required Role

Permission data inferred from metadata. May be incomplete.

Requirements

  • Timelocked commits enabled on subnet
  • Valid reveal round specified
  • Validator registered with sufficient stake

Effects

Postconditions

  • Commit stored with reveal round
  • Commit locked until specified round

Side Effects

  • Cannot reveal until specified round
  • All validators reveal simultaneously in the round

Possible Errors

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 });

// Build commit_timelocked_weights call
const netuid = 1;
const commit = 0 as any /* BoundedVec */;
const reveal_round = 0;
const commit_reveal_version = 0;

const call = api.tx[stringCamelCase("SubtensorModule")][stringCamelCase("commit_timelocked_weights")](
  netuid,
  commit,
  reveal_round,
  commit_reveal_version
);

On-Chain Activity

Usage Frequency
●●●●●○ Core 1M–10M extrinsics

Primary protocol calls

#10 most used call

Success Rate Reliable

80–95% of submissions succeed

As of block 7,429,232

Runtime Info

View Source
Pallet Index
7
Call Index
113
First Version
v301
Current Version
v393