CommitRevealEnabled
Error Re-added v151 → v202, v205 → v212, v216 → v216, v217 → v219, v233 → v315, v320 → v326, v334 → current 7.52This subnet requires commit-reveal for weights , but you called set_weights directly.
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
Runtime Info
- Pallet Index
- 7
- Error Index
- 52
- Error Code
- 7.52
- Runtime Version
- v393