WeightsBatchRevealed
Event Re-added v205 → v212, v216 → v247, v252 → v265, v273 → v277, v290 → v315, v320 → v326, v334 → v367, v372 → v377, v385 → current #85Emitted when multiple weight commits are revealed in a batch.
View events on chainThe Big Picture
Validators operating on multiple subnets can batch their weight reveals into a single transaction instead of revealing on each subnet separately. This saves transaction fees and simplifies operations. The event confirms all included reveals succeeded as a batch - either all apply or none do (atomic).
Why This Matters
If you validate on multiple subnets using commit-reveal, batch revealing saves significant fees and operational complexity. Instead of N transactions for N subnets, you do one. This event confirms your batch reveal worked across all included subnets.
Example Scenario
You validate on subnets 1, 3, and 7, all using commit-reveal. You committed weights on all three. Instead of three separate reveals, you batch them. WeightsBatchRevealed fires once, confirming all three subnets received their weight updates in a single transaction.
Common Questions
- What if one reveal in the batch fails?
- Batch operations are typically atomic - if one fails, none apply. Check for BatchCompletedWithErrors events that indicate partial failures.
- Can I mix different subnets in one batch reveal?
- Yes, that's the point. Batch any pending reveals into one transaction regardless of subnet.
- How do I batch my reveals?
- Use the batch_reveal_weights extrinsic (or similar) instead of individual reveal_weights calls. Check documentation for exact function signatures.
Use Cases
- Batch reveal weights across multiple subnets efficiently
- Track multi-subnet validator activity
- Monitor batch reveal patterns
- Optimize validator transaction costs
How to Use This Event
- → Monitor your batch reveals for success confirmation
- → Track validator efficiency in multi-subnet operations
- → Build batch optimization tools for validators
From Chain Metadata
Weights have been successfully batch revealed. **who**: The account ID of the user revealing the weights. **netuid**: The network identifier. **revealed_hashes**: A vector of hashes representing each revealed weight set.
Triggers
Emitted by
Preconditions
- Validator has multiple pending commits
- All reveal hashes match their commits
- Within reveal time window
May fail with
Effects
Storage Modified
Postconditions
- Multiple weight sets applied
- All revealed commits cleared
Side Effects
- More efficient than individual reveals
Event Data
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 });
// Subscribe to WeightsBatchRevealed events
api.query.system.events((events) => {
events
.filter(({ event }) =>
event.section === stringCamelCase("SubtensorModule") &&
event.method === "WeightsBatchRevealed"
)
.forEach(({ event }) => {
console.log("WeightsBatchRevealed:", event.data.toHuman());
});
});Version History
Runtime Info
View Source- Pallet Index
- 7
- Event Index
- 85
- First Version
- v205
- Current Version
- v393