set_beacon_config

Call v216 → current #1

Updates the Drand beacon configuration used for pulse verification.

View calls on chain

Click items to navigate. Pan and zoom to explore.

Used by: validatorsdevelopers

The Big Picture

The beacon configuration contains everything needed to verify Drand pulses: public keys, genesis time, period, and chain hash. This call updates that configuration - typically a rare governance action when Drand itself migrates or upgrades. Getting this wrong means the chain can't verify new pulses, so it's a critical infrastructure operation.

Why This Matters

Without correct beacon configuration, the chain can't verify Drand signatures. This call is how the chain learns about the Drand network it should trust. It's like updating a certificate authority - wrong config means no valid randomness.

Example Scenario

Drand migrates to a new genesis configuration (e.g., new committee members). Governance prepares a BeaconConfigurationPayload with the new public key, genesis time, and period. Root calls set_beacon_config(config, signature). BeaconConfigChanged fires. New pulses must now match the updated configuration.

Common Questions

What happens to pulses during a configuration change?
Coordinate carefully - pulses submitted just before/after must match their respective configurations. Typically done during low-activity periods or with offchain worker pause.
Can anyone fetch the Drand configuration?
Yes - Drand publishes configuration at https://api.drand.sh/chain_info. The hard part is getting it into the chain through governance.

Use Cases

  • Initialize Drand integration on new chains
  • Update to new Drand network configuration after beacon migration
  • Switch between Drand networks (mainnet, testnet)

From Chain Metadata

allows the root user to set the beacon configuration generally this would be called from an offchain worker context. there is no verification of configurations, so be careful with this. * `origin`: the root user * `config`: the beacon configuration

Part of: Distributed Randomness

Input Parameters

#NameTypeDescription
0
config_payload
BeaconConfigurationPayload config_payload (BeaconConfigurationPayload)
1
signature
Option signature (Option)

Permissions

Origin
Unknown
Required Role

Permission data inferred from metadata. May be incomplete.

Requirements

  • Caller has root/sudo privileges
  • Configuration payload is valid
  • Typically called from offchain worker context or governance

Effects

Events Emitted

Storage Modified

Postconditions

  • BeaconConfig storage updated with new configuration
  • BeaconConfigChanged event emitted
  • Future pulse verifications use new configuration

Side Effects

  • Pulses verified against old config may fail after change
  • Offchain workers must fetch and submit with correct timing

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 set_beacon_config call
const config_payload = 0 as any /* BeaconConfigurationPayload */;
const signature = 0 as any /* Option */;

const call = api.tx[stringCamelCase("Drand")][stringCamelCase("set_beacon_config")](
  config_payload,
  signature
);

Runtime Info

View Source
Pallet Index
26
Call Index
1
First Version
v216
Current Version
v393