BetaIndexSweep

Storage Plain v450 → current

In-progress state of the paged beta-index sweep; present only mid-pass.

Explore chain
Queried by: developersanalytics

The Big Picture

Computing the index means visiting every fund, and doing that inline in a user call would make some unlucky transaction pay for the whole walk. The paged sweep spreads the work across blocks in the background, and this storage is its checkpoint.

Why This Matters

Only relevant if you are watching index mechanics: it tells you a refresh is in progress and where the walk currently stands.

Example Scenario

You poll BetaIndexSnapshot and its block has not moved. BetaIndexSweep exists with a non-empty cursor, so a pass is mid-flight and the next levels publish when it completes.

Use Cases

  • Explain why BetaIndexSnapshot has not advanced yet
  • Monitor sweep cadence on chains with many funds

From Chain Metadata

ITEM --> in-progress paged beta-index sweep (see [`BetaIndexSweepOf`]). Present only mid-pass. `advance_beta_index_sweep` processes one strictly bounded page per block and clears this on completion.

Purpose & Usage

Purpose

Carries the resume cursor and the partial NAV-weighted sums of price relatives while the sweep walks funds one bounded page per block.

Common Query Patterns

  • Existence check: present means a pass is mid-flight, absent means idle

Notes

  • Cleared on completion, when the previous snapshot levels are multiplied by the aggregate relatives and published to BetaIndexSnapshot
  • One strictly bounded page advances per block, so a large fund count never bloats any single block

Stored Value

value (BetaIndexSweepOf)

Default Value

None (absent keys return no value)

Optional storage: querying a key that has never been written returns no value (None) — do not assume a zero default.

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 BetaIndexSweep storage (no keys - plain value)
const result = await api.query.SubtensorModule.BetaIndexSweep.getValue();
console.log("BetaIndexSweep:", result);

On-Chain Activity

Write Frequency
●●●○○○ Low 10K–100K est. writes

10K to 100K writes

#208 most written storage item

Write Source Runtime Hook

Modified by runtime hooks (e.g., epoch transitions), not directly by user extrinsics

As of block 9,385,000

Runtime Info

View Source
Pallet
SubtensorModule
Storage Kind
Plain
First Version
v450
Current Version
v490