Babe pallet
Derived from live runtime metadata on TRN root (pallet index 1, captured 2026-05-02). For prose-style documentation see Babe on the curated reference side.
- Pallet index
1- Calls
- 3
- Events
- 0
- Errors
- 4
- Storage items
- 17
- Constants
- 3
Calls (extrinsics)
Babe.report_equivocation
See [
Pallet::report_equivocation].
api.tx.babe.report_equivocation(equivocation_proof: {"offender":"SpConsensusBabeAppPublic","slot":"u64","firstHeader":"SpRuntimeHeader","secondHeader":"SpRuntimeHeader"}, key_owner_proof: {"session":"u32","trieNodes":"Vec<Bytes>","validatorCount":"u32"})| Argument | Type | Doc |
|---|---|---|
equivocation_proof | {"offender":"SpConsensusBabeAppPublic","slot":"u64","firstHeader":"SpRuntimeHeader","secondHeader":"SpRuntimeHeader"} | Box<EquivocationProof<HeaderFor<T>>> |
key_owner_proof | {"session":"u32","trieNodes":"Vec<Bytes>","validatorCount":"u32"} | T::KeyOwnerProof |
Call index: 0
Babe.report_equivocation_unsigned
See [
Pallet::report_equivocation_unsigned].
api.tx.babe.report_equivocation_unsigned(equivocation_proof: {"offender":"SpConsensusBabeAppPublic","slot":"u64","firstHeader":"SpRuntimeHeader","secondHeader":"SpRuntimeHeader"}, key_owner_proof: {"session":"u32","trieNodes":"Vec<Bytes>","validatorCount":"u32"})| Argument | Type | Doc |
|---|---|---|
equivocation_proof | {"offender":"SpConsensusBabeAppPublic","slot":"u64","firstHeader":"SpRuntimeHeader","secondHeader":"SpRuntimeHeader"} | Box<EquivocationProof<HeaderFor<T>>> |
key_owner_proof | {"session":"u32","trieNodes":"Vec<Bytes>","validatorCount":"u32"} | T::KeyOwnerProof |
Call index: 1
Babe.plan_config_change
See [
Pallet::plan_config_change].
api.tx.babe.plan_config_change(config: {"_enum":{"__Unused0":"Null","V1":"{\"c\":\"(u64,u64)\",\"allowedSlots\":\"SpConsensusBabeAllowedSlots\"}"}})| Argument | Type | Doc |
|---|---|---|
config | {"_enum":{"__Unused0":"Null","V1":"{\"c\":\"(u64,u64)\",\"allowedSlots\":\"SpConsensusBabeAllowedSlots\"}"}} | NextConfigDescriptor |
Call index: 2
Errors
Babe.InvalidEquivocationProof
An equivocation proof provided as part of an equivocation report is invalid.
Babe.InvalidKeyOwnershipProof
A key ownership proof provided as part of an equivocation report is invalid.
Babe.DuplicateOffenceReport
A given equivocation report is valid but already previously reported.
Babe.InvalidConfiguration
Submitted configuration is invalid.
Storage
Babe.EpochIndex
Current epoch index.
await api.query.babe.epochIndex()Returns: u64
Modifier: Default
Babe.Authorities
Current epoch authorities.
await api.query.babe.authorities()Returns: Vec<(SpConsensusBabeAppPublic,u64)>
Modifier: Default
Babe.GenesisSlot
The slot at which the first epoch actually started. This is 0 until the first block of the chain.
await api.query.babe.genesisSlot()Returns: u64
Modifier: Default
Babe.CurrentSlot
Current slot number.
await api.query.babe.currentSlot()Returns: u64
Modifier: Default
Babe.Randomness
The epoch randomness for the current epoch. # Security This MUST NOT be used for gambling, as it can be influenced by a malicious validator in the short term. It MAY be used in many cryptographic protocols, however, so long as one remembers that this (like everything else on-chain) it is public. For example, it can be used where a number is needed that cannot have been chosen by an adversary, for purposes such as public-coin zero-knowledge proofs.
await api.query.babe.randomness()Returns: [u8;32]
Modifier: Default
Babe.PendingEpochConfigChange
Pending epoch configuration change that will be applied when the next epoch is enacted.
await api.query.babe.pendingEpochConfigChange()Returns: {"_enum":{"__Unused0":"Null","V1":"{\"c\":\"(u64,u64)\",\"allowedSlots\":\"SpConsensusBabeAllowedSlots\"}"}}
Modifier: Optional
Babe.NextRandomness
Next epoch randomness.
await api.query.babe.nextRandomness()Returns: [u8;32]
Modifier: Default
Babe.NextAuthorities
Next epoch authorities.
await api.query.babe.nextAuthorities()Returns: Vec<(SpConsensusBabeAppPublic,u64)>
Modifier: Default
Babe.SegmentIndex
Randomness under construction. We make a trade-off between storage accesses and list length. We store the under-construction randomness in segments of up to
UNDER_CONSTRUCTION_SEGMENT_LENGTH. Once a segment reaches this length, we begin the next one. We reset all segments and return to0at the beginning of every epoch.
await api.query.babe.segmentIndex()Returns: u32
Modifier: Default
Babe.UnderConstruction
TWOX-NOTE:
SegmentIndexis an increasing integer, so this is okay.
await api.query.babe.underConstruction(key1)- Key:
u32(hasher: Twox64Concat) - Returns:
Vec<[u8;32]>
Modifier: Default
Babe.Initialized
Temporary value (cleared at block finalization) which is
Someif per-block initialization has already been called for current block.
await api.query.babe.initialized()Returns: Option<SpConsensusBabeDigestsPreDigest>
Modifier: Optional
Babe.AuthorVrfRandomness
This field should always be populated during block processing unless secondary plain slots are enabled (which don't contain a VRF output). It is set in
on_finalize, before it will contain the value from the last block.
await api.query.babe.authorVrfRandomness()Returns: Option<[u8;32]>
Modifier: Default
Babe.EpochStart
The block numbers when the last and current epoch have started, respectively
N-1andN. NOTE: We track this is in order to annotate the block number when a given pool of entropy was fixed (i.e. it was known to chain observers). Since epochs are defined in slots, which may be skipped, the block numbers may not line up with the slot numbers.
await api.query.babe.epochStart()Returns: (u32,u32)
Modifier: Default
Babe.Lateness
How late the current block is compared to its parent. This entry is populated as part of block execution and is cleaned up on block finalization. Querying this storage entry outside of block execution context should always yield zero.
await api.query.babe.lateness()Returns: u32
Modifier: Default
Babe.EpochConfig
The configuration for the current epoch. Should never be
Noneas it is initialized in genesis.
await api.query.babe.epochConfig()Returns: {"c":"(u64,u64)","allowedSlots":"SpConsensusBabeAllowedSlots"}
Modifier: Optional
Babe.NextEpochConfig
The configuration for the next epoch,
Noneif the config will not change (you can fallback toEpochConfiginstead in that case).
await api.query.babe.nextEpochConfig()Returns: {"c":"(u64,u64)","allowedSlots":"SpConsensusBabeAllowedSlots"}
Modifier: Optional
Babe.SkippedEpochs
A list of the last 100 skipped epochs and the corresponding session index when the epoch was skipped. This is only used for validating equivocation proofs. An equivocation proof must contains a key-ownership proof for a given session, therefore we need a way to tie together sessions and epoch indices, i.e. we need to validate that a validator was the owner of a given key on a given session, and what the active epoch index was during that session.
await api.query.babe.skippedEpochs()Returns: Vec<(u64,u32)>
Modifier: Default
Constants
Babe.EpochDuration
The amount of time, in slots, that each epoch should last. NOTE: Currently it is not possible to change the epoch duration after the chain has started. Attempting to do so will brick block production.
Type: u64
SCALE-encoded value: 0x100e000000000000
Babe.ExpectedBlockTime
The expected average block time at which BABE should be creating blocks. Since BABE is probabilistic it is not trivial to figure out what the expected average block time should be based on the slot duration and the security parameter
c(where1 - crepresents the probability of a slot being empty).
Type: u64
SCALE-encoded value: 0xa00f000000000000
Babe.MaxAuthorities
Max number of authorities allowed
Type: u32
SCALE-encoded value: 0x00100000
wss://root.rootnet.live/archive/ws · captured 2026-05-02