Calls
planConfigChange
Plan an epoch config change. The epoch config change is recorded and will be enacted on the next call toenact_epoch_change
. The config will be activated one epoch after. Multiple calls to this method will replace any existing planned config change that had not been enacted yet.
Namespace
reportEquivocation
Report authority equivocation/misbehavior. This method will verify the equivocation proof and validate the given key ownership proof against the extracted offender. If both are valid, the offence will be reported. NamespacereportEquivocationUnsigned
Report authority equivocation/misbehavior. This method will verify the equivocation proof and validate the given key ownership proof against the extracted offender. If both are valid, the offence will be reported. This extrinsic must be called unsigned and it is expected that only block authors will call it (validated inValidateUnsigned
), as such if the block author is defined it will be defined as the equivocation reporter.
Namespace
Storage
authorities
Current epoch authorities. NamespaceauthorVrfRandomness
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 inon_finalize
, before it will contain the value from the last block.
Namespace
currentSlot
Current slot number. NamespaceepochConfig
The configuration for the current epoch. Should never beNone
as it is initialized in genesis.
Namespace
epochIndex
Current epoch index. NamespaceepochStart
The block numbers when the last and current epoch have started, respectivelyN-1
and N
. 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.
Namespace
genesisSlot
The slot at which the first epoch actually started. This is 0 until the first block of the chain. Namespaceinitialized
Temporary value (cleared at block finalization) which isSome
if per-block initialization has already been called for current block.
Namespace
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. NamespacenextAuthorities
Next epoch authorities. NamespacenextEpochConfig
The configuration for the next epoch,None
if the config will not change (you can fallback to EpochConfig
instead in that case).
Namespace
nextRandomness
Next epoch randomness. NamespacependingEpochConfigChange
Pending epoch configuration change that will be applied when the next epoch is enacted. Namespacerandomness
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. NamespacesegmentIndex
Randomness under construction. We make a trade-off between storage accesses and list length. We store the under-construction randomness in segments of up toUNDER_CONSTRUCTION_SEGMENT_LENGTH
.
Once a segment reaches this length, we begin the next one. We reset all segments and return to 0
at the beginning of every epoch.
Namespace
underConstruction
TWOX-NOTE:SegmentIndex
is an increasing integer, so this is okay.
Namespace
DuplicateOffenceReport
A given equivocation report is valid but already previously reported. NamespaceInvalidConfiguration
Submitted configuration is invalid. NamespaceInvalidEquivocationProof
An equivocation proof provided as part of an equivocation report is invalid. NamespaceInvalidKeyOwnershipProof
A key ownership proof provided as part of an equivocation report is invalid. NamespaceConstants
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. NamespaceexpectedBlockTime
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 parameterc
(where 1 - c
represents the probability of a slot being empty).
Namespace