schedule_grandpa_change

Call v217 → current #59

Schedules a GRANDPA authority change to take effect after specified blocks.

View calls on chain

Click items to navigate. Pan and zoom to explore.

Used by: subnet owners

The Big Picture

Unlike immediate authority swaps, this schedules changes for a future block, giving validators time to prepare. GRANDPA handles finality, so this affects when blocks become irreversible.

Use Cases

  • Planned validator set updates
  • Network upgrades
  • Coordinated authority transitions

From Chain Metadata

A public interface for `pallet_grandpa::Pallet::schedule_grandpa_change`. Schedule a change in the authorities. The change will be applied at the end of execution of the block `in_blocks` after the current block. This value may be 0, in which case the change is applied at the end of the current block. If the `forced` parameter is defined, this indicates that the current set has been synchronously determined to be offline and that after `in_blocks` the given change should be applied. The given block number indicates the median last finalized block number and it should be used as the canon block when starting the new grandpa voter. No change should be signaled while any change is pending. Returns an error if a change is already pending.

Input Parameters

#NameTypeDescription
0
next_authorities
Vec<(Public, u64)> Vecnext_authorities (Vec<(Public, u64)>)
1
in_blocks
u32 in_blocks (u32)
2
forced
Option forced (Option)

Permissions

Origin
Root
Required Role

Permission data inferred from metadata. May be incomplete.

Requirements

  • Caller is root account
  • Valid authorities provided
  • Block delay is reasonable

Effects

Postconditions

  • GRANDPA change scheduled
  • Change activates after specified blocks

Side Effects

  • Finality mechanism will update at scheduled block
  • Validators should prepare for transition

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

// Build schedule_grandpa_change call
const next_authorities = 0;
const in_blocks = 0;
const forced = 0 as any /* Option */;

const call = api.tx[stringCamelCase("AdminUtils")][stringCamelCase("schedule_grandpa_change")](
  next_authorities,
  in_blocks,
  forced
);

Runtime Info

View Source
Pallet Index
19
Call Index
59
First Version
v217
Current Version
v393