Queried by: minersdevelopers
The Big Picture
PoW solutions can only be used once. This storage tracks used solutions to prevent replay attacks on PoW registration.
Use Cases
- Check if PoW solution is fresh
- Debug PoW registration
- Build PoW tooling
Purpose & Usage
Purpose
Prevent replay of PoW solutions.
Common Query Patterns
- Query by work hash
Query Keys
| # | Name | Type | Description |
|---|---|---|---|
| 1 | workHash raw: key1 | Vec<u8> Vec | key1 (Vec<u8>) |
Stored Value
Code Examples
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);
// Query UsedWork storage
const key1 = Binary.fromOpaque(new Uint8Array(0));
const result = await api.query.SubtensorModule.UsedWork.getValue(key1);
console.log("UsedWork:", result);Version History
v101 block 1 Added
v149 block 3,014,339 Internal re-bind
v151 block 3,157,274 Internal re-bind Current
Runtime Info
View Source- Pallet
- SubtensorModule
- Storage Kind
- Map
- First Version
- v101
- Current Version
- v411