Entered

Event v154 → current #0

Emitted when safe-mode is entered, pausing certain network operations.

View events on chain
Useful for: validatorsdevelopersanalytics

The Big Picture

Safe-mode is Bittensor's emergency brake. When this event fires, the network has entered a protected state where certain critical operations are paused. This happens during security incidents or when vulnerabilities are being exploited. The 'until' field tells you when safe-mode will auto-exit if not extended or force-exited earlier.

Why This Matters

When safe-mode activates, your dApp may be affected. Knowing immediately lets you inform users and pause dependent operations. The 'until' field helps you estimate downtime duration.

Example Scenario

You run a staking dashboard. When Entered fires with until=1000500, you display a banner: 'Network in safe-mode until block 1000500. Some operations temporarily disabled.'

Common Questions

How long does safe-mode typically last?
Depends on EnterDuration constant and any extensions. Check the 'until' field for the expected end block. It can end earlier via force_exit.
What operations are affected?
Depends on runtime configuration. Typically includes value transfers, registrations, and other critical operations. Check runtime docs for specifics.

Use Cases

  • Monitor for network emergency events
  • Alert systems when safe-mode activates
  • Track safe-mode history and patterns
  • Coordinate incident response

How to Use This Event

  • Subscribe to all Entered events for network-wide alerting
  • Track the 'until' block to know when normal operations resume
  • Correlate with other security events for incident analysis

From Chain Metadata

The safe-mode was entered until inclusively this block.

Triggers

Emitted by

Preconditions

  • Safe-mode was not already entered
  • Either: caller provided deposit (permissionless) or caller is ForceEnterOrigin

Effects

Storage Modified

Postconditions

  • Safe-mode is active until the specified block
  • EnteredUntil storage is set
  • Certain network operations are blocked

Side Effects

  • If permissionless entry, deposit is reserved from caller
  • Network throughput may be reduced

Event Data

#NameTypeDescription
0
until
u32 Block number when safe-mode will auto-exit

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 });

// Subscribe to Entered events
api.query.system.events((events) => {
  events
    .filter(({ event }) =>
      event.section === stringCamelCase("SafeMode") &&
      event.method === "Entered"
    )
    .forEach(({ event }) => {
      console.log("Entered:", event.data.toHuman());
    });
});

Runtime Info

Pallet Index
20
Event Index
0
First Version
v154
Current Version
v393