CommitRevealEnabled

Error v151 → v202, v205 → v212, v216 → v216, v217 → v219, v233 → v315, v320 → v326, v334 → v393, v401 → current 7.53

This subnet requires commit-reveal for weights , but you called set_weights directly.

Encountered by: validatorsdevelopers

Why This Error Exists

Commit-reveal prevents front-running and weight copying. Without it, validators could watch the mempool and copy others' weights before they're confirmed. With commit-reveal, you first submit a hash (commitment), then later reveal the actual weights. This ensures everyone commits before anyone can see others' choices.

Deep Dive

CommitRevealWeightsEnabled is a per-subnet boolean. When true, direct set_weights calls are rejected. Instead: 1) Call commit_weights with hash(weights, salt), 2) Wait for commit period to end (WeightCommitRevealInterval blocks), 3) Call reveal_weights with actual weights and salt. The hash must match for reveal to succeed.

Debugging Example

You call set_weights(netuid=18, uids=[...], weights=[...]). Error: CommitRevealEnabled. Query CommitRevealWeightsEnabled(18) - returns true. This subnet uses commit-reveal. Solution: Generate a salt, compute hash = keccak256(weights || salt), call commit_weights(netuid=18, hash), wait for reveal period, then call reveal_weights(netuid=18, weights, salt).

Prevention Tips

  • Check CommitRevealWeightsEnabled(netuid) before setting weights
  • Implement commit-reveal logic in your validator software
  • Store your salt securely - you need it for the reveal phase

From Chain Metadata

Attempting to call set_weights when commit/reveal is enabled

What This Means

This subnet requires commit-reveal for weights, but you called set_weights directly.

Common Causes

  • Subnet has commit-reveal enabled
  • Must use commit_weights then reveal_weights

How to Fix

  • Use commit_weights to commit a hash of your weights
  • Then use reveal_weights after the commit period
  • Check CommitRevealWeightsEnabled for subnet setting

Storage to Check

Thrown By

Version History

v151 block 3,157,274 Added
v205 block 4,209,446 Shape modified
v216 block 4,510,996 Shape modified
v217 block 4,590,522 Shape modified
v233 block 4,920,350 Shape modified
v320 block 6,523,566 Shape modified
v334 block 6,811,690 Shape modified
v401 block 8,036,576 Shape modified Current

Runtime Info

Pallet Index
7
Error Index
53
Error Code
7.53
Runtime Version
v411