commit_crv3_mechanism_weights

Call v320 → v424, v432 → current #117

Commits weights using CRV3 (commit-reveal v3) mechanism .

View calls on chain

Click items to navigate. Pan and zoom to explore.

Used by: validatorsdeveloperssubnet owners

The Big Picture

CRV3 (Commit-Reveal Version 3) is an enhanced commit-reveal protocol with additional protections against weight manipulation and copying. Subnets that enable CRV3 require validators to use this call instead of standard commit_weights. The protocol may include additional cryptographic commitments, timing constraints, or verification steps.

Why This Matters

Standard commit-reveal prevents seeing weights before reveal. CRV3 adds more protections - potentially against timing attacks, partial information leakage, or coordinated manipulation. If your subnet uses CRV3, you must use this call to participate in consensus.

Example Scenario

Subnet 42 has enabled CRV3 for enhanced security. After evaluating miners, prepare a CRV3-compatible commitment (format depends on implementation). Call commit_crv3_mechanism_weights(netuid=42, commit=crv3_hash). The chain stores your CRV3 commit. Follow subnet documentation for reveal timing and procedure.

Common Questions

What's different about CRV3?
Implementation-specific, but typically: stronger cryptographic commitments, different timing windows, additional verification layers. Check subnet documentation for details.
Can I use regular commit_weights on a CRV3 subnet?
No - if the subnet requires CRV3, standard commits will be rejected. Use the mechanism-specific call required by the subnet.
How do I know if a subnet uses CRV3?
Check the subnet's parameters (CommitRevealMechanism or similar). Subnet documentation should specify which commit-reveal variant is required.

Use Cases

  • Participate in subnets using CRV3 consensus mechanism
  • Submit weights with enhanced anti-copying protections
  • Advanced validators optimizing for CRV3-specific features
  • Subnets requiring higher security weight submission

From Chain Metadata

Used to commit encrypted commit-reveal v3 weight values to later be revealed for mechanisms.

Part of: Weight ManagementCommit-Reveal Weights (CRV3)

Migration Notes

v424 v432 Breaking

netuid changed from u16 to NetUid; mecid changed from u8 to MechId

Update decoders: SCALE encoding is positional, so any signature change (added, removed, or type-changed fields, or storage shape changes) shifts byte offsets and existing decoders will misparse this item. Re-derive types from the new metadata.

Input Parameters

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

Permissions

Origin
Signed
Required Role

Permission data inferred from metadata. May be incomplete.

Requirements

  • CRV3 enabled on subnet
  • Validator registered with sufficient stake
  • Valid CRV3 commitment format

Effects

Events Emitted

Postconditions

  • CRV3 commit stored
  • Mechanism-specific metadata recorded

Side Effects

  • Uses enhanced commit-reveal protocol
  • May have different timing requirements than standard commit-reveal

Possible Errors

Code Examples

// ----------------------------------------------------------------------
// HEADS UP: 2 args below have a complex type with no usable default.
// Look for `undefined as any` and replace them with real values
// 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_crv3_mechanism_weights call (typed, named args)
const netuid = 1;
const mecid = undefined as any /* MechId — replace with real value */;
const commit = undefined as any /* BoundedVec — replace with real value */;
const reveal_round = 0n;

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

Version History

v320 block 6,523,566 4 args
v432 block 8,636,190 4 args Current

Runtime Info

View Source
Pallet Index
7
Call Index
117
First Version
v320
Current Version
v472