NextUnsignedAt
Storage Plain v216 → currentThe block number when the next unsigned pulse transaction will be accepted.
Explore chainThe Big Picture
Unsigned transactions are 'free' - no one pays fees. To prevent abuse, the chain only accepts one per block. This storage tracks when the next one is allowed. Offchain workers should check this before submitting to avoid wasted effort.
Why This Matters
If your offchain worker's pulse submissions keep failing, check NextUnsignedAt. If current block < NextUnsignedAt, your unsigned transaction will be rejected. Wait until that block.
Example Scenario
Query NextUnsignedAt() returns 7000100. Current block is 7000099. Your unsigned pulse submission will be rejected - wait one more block. At block 7000100, submit and it succeeds.
Common Questions
- Why rate limit unsigned transactions?
- Without limits, anyone could spam free transactions. One per block ensures the chain isn't flooded while still allowing regular pulse submission.
- What if I need to submit signed instead?
- Signed transactions aren't rate-limited this way (they pay fees). If offchain worker timing is problematic, signed submission is an alternative.
Use Cases
- Time offchain worker pulse submissions correctly
- Debug why pulse submissions are being rejected
- Understand rate limiting for unsigned transactions
From Chain Metadata
Defines the block when next unsigned transaction will be accepted. To prevent spam of unsigned (and unpaid!) transactions on the network, we only allow one transaction per block. This storage entry defines when new transaction is going to be accepted.
Purpose & Usage
Purpose
Rate limiting for unsigned pulse submissions to prevent spam.
Common Query Patterns
- Check before submitting unsigned pulses
- Plan offchain worker timing
- Debug pulse submission rate limiting
Notes
- Only one unsigned pulse transaction per block allowed
- Value updates after each successful unsigned submission
- Prevents spam of free (unsigned) transactions
Stored Value
value (u32)
Relationships
Modified By
Related Events
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 });
// Query NextUnsignedAt storage (no keys - plain value)
const result = await api.query
[stringCamelCase("Drand")]
[stringCamelCase("NextUnsignedAt")]();
console.log("NextUnsignedAt:", result.toHuman());Runtime Info
View Source- Pallet
- Drand
- Storage Kind
- Plain
- First Version
- v216
- Current Version
- v393