commit_timelocked_mechanism_weights

Call v320 → current #118

Commits mechanism weights with timelock.

View calls on chain

Click items to navigate. Pan and zoom to explore.

Used by: validatorsdeveloperssubnet owners

The Big Picture

Combines mechanism weights (subnet-specific consensus) with timelocking (synchronized reveals). This is the most constrained weight submission: weights must conform to the mechanism, and reveals are enforced to occur simultaneously. Used by subnets with high-value stakes or particularly sensitive consensus requirements.

Why This Matters

When a subnet uses a custom mechanism AND needs synchronized reveals, this is the only valid commit call. It provides maximum protection against weight manipulation and timing attacks, at the cost of more constrained submission timing.

Example Scenario

Subnet 77 uses mechanism weights with timelocked reveals at round 500. Evaluate miners according to the mechanism, prepare commitment. Call commit_timelocked_mechanism_weights(netuid=77, commit_hash=hash, reveal_round=500). Wait until round 500, then reveal with the appropriate reveal call.

Common Questions

How does this differ from commit_timelocked_weights?
commit_timelocked_weights is for standard weight consensus. This variant is for mechanism-specific consensus. Use whichever the subnet requires.
What's the reveal call for timelocked mechanism weights?
Typically reveal_mechanism_weights during the valid round. Check subnet documentation for the exact reveal procedure and timing.

Use Cases

  • Mechanism weight submission with synchronized reveals
  • High-security subnets requiring both mechanism weights and timelocking
  • Advanced consensus protocols with multiple protection layers

From Chain Metadata

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

Input Parameters

#NameTypeDescription
0
netuid
u16 NetUidnetuid: Subnet ID (u16, 0-65535)
1
mecid
u8 MechIdmecid: Mechanism identifier
2
commit
BoundedVec BoundedVec<u8, ConstU32<MAX_CRV3_COMMIT_SIZE_BYTES>>commit (BoundedVec)
3
reveal_round
u64 reveal_round (u64)
4
commit_reveal_version
u16 commit_reveal_version (u16)

Permissions

Origin
Signed
Required Role

Permission data inferred from metadata. May be incomplete.

Requirements

  • Timelocked mechanism enabled on subnet
  • Valid round and commit hash
  • Validator registered with sufficient stake

Effects

Postconditions

  • Timelocked mechanism commit stored
  • Commit locked until specified round

Side Effects

  • Synchronized reveal with other validators
  • Feeds into mechanism-specific consensus when revealed

Possible Errors

Code Examples

// ----------------------------------------------------------------------
// HEADS UP: 1 arg below has a complex type with no usable default.
// Look for `undefined as any` and replace it with real value
// before running — the snippet compiles, but will fail at runtime as-is.
// ----------------------------------------------------------------------
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);

// Build commit_timelocked_mechanism_weights call (typed, named args)
const netuid = 1;
const mecid = 0;
const commit = undefined as any /* BoundedVec — replace with real value */;
const reveal_round = 0n;
const commit_reveal_version = 0;

const tx = api.tx.SubtensorModule.commit_timelocked_mechanism_weights({
  netuid,
  mecid,
  commit,
  reveal_round,
  commit_reveal_version,
});

On-Chain Activity

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

Primary protocol calls

#22 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
118
First Version
v320
Current Version
v411