OldestStoredRound

Storage Plain v301 → current

The oldest Drand round number retained in storage .

Explore chain
Queried by: developersanalytics

The Big Picture

Storage isn't infinite - old pulses are eventually pruned. This tells you the oldest retained round. Queries for rounds below this may return empty/default. If you need long-term history, archive off-chain or accept the availability window.

Why This Matters

Before querying historical randomness, check OldestStoredRound. If your target round is below this, the data may not exist. Plan applications around this availability window.

Example Scenario

Query OldestStoredRound() returns 12000000. LastStoredRound is 12345678. You can query any round from 12000000 to 12345678. Round 11999999? May return empty - it's below the retention floor.

Common Questions

How is this value determined?
Set by governance or automatic pruning logic. It balances storage costs against historical data needs. Check set_oldest_stored_round calls for changes.
What if I need older data?
Archive it off-chain before it's pruned. Drand itself has public archives, or you can run your own indexer to capture pulses as they're submitted.

Use Cases

  • Determine valid range for historical randomness queries
  • Build applications aware of data availability windows
  • Plan archival strategies for long-term randomness history

From Chain Metadata

oldest stored round

Purpose & Usage

Purpose

Define the historical data boundary - rounds below this may be unavailable.

Common Query Patterns

  • Query to understand available randomness range
  • Check before querying historical pulses
  • Plan data retention strategies
Part of: Distributed Randomness

Stored Value

Value in RAO (÷10⁹ for TAO)

RAO -> TAO (/ 10^9)

Relationships

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 OldestStoredRound storage (no keys - plain value)
const result = await api.query
  [stringCamelCase("Drand")]
  [stringCamelCase("OldestStoredRound")]();
console.log("OldestStoredRound:", result.toHuman());

Runtime Info

View Source
Pallet
Drand
Storage Kind
Plain
First Version
v301
Current Version
v393