EnteredUntil

Storage Plain v154 → current

The block number until which safe-mode remains active.

Explore chain
Queried by: validatorsdevelopersanalytics

The Big Picture

This is the primary indicator of safe-mode status. When set (Some(block)), the network is in protected mode until that block. When None, normal operations are allowed.

Why This Matters

Before submitting transactions that might fail during safe-mode, check this storage. If safe-mode is active, inform users that certain operations are temporarily unavailable.

Example Scenario

Query EnteredUntil() returns Some(1000500). Current block is 1000300. Safe-mode is active for another 200 blocks (~40 minutes at 12s blocks).

Common Questions

Can safe-mode end before EnteredUntil?
Yes, governance can force_exit early. Subscribe to Exited events for real-time notification.

Use Cases

  • Check if network is in safe-mode before attempting operations
  • Display countdown to safe-mode end in dashboards
  • Coordinate incident response timing

From Chain Metadata

Contains the last block number that the safe-mode will remain entered in. Set to `None` when safe-mode is exited. Safe-mode is automatically exited when the current block number exceeds this value.

Purpose & Usage

Purpose

Tracks the end block for the current safe-mode period. Set when entering, updated when extending, cleared when exiting. Safe-mode auto-exits when current block exceeds this value.

Common Query Patterns

  • Query to check if safe-mode is active (Some = active, None = inactive)
  • Calculate remaining blocks in safe-mode
  • Estimate when normal operations will resume

Stored Value

value (u32)

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

Runtime Info

Pallet
SafeMode
Storage Kind
Plain
First Version
v154
Current Version
v393