Grandpa
Calls
noteStalled
Note that the current authority set of the GRANDPA finality gadget has stalled.
This will trigger a forced authority set change at the beginning of the next session, to be enacted delay blocks after that. The delay should be high enough to safely assume that the block signalling the forced change will not be re-orged e.g. 1000 blocks. The block production rate (which may be slowed down because of finality lagging) should be taken into account when choosing the delay. The GRANDPA voters based on the new authority will start voting on top of best_finalized_block_number for new finalized blocks. best_finalized_block_number should be the highest of the latest finalized block of all validators of the new authority set.
INFO
Note: Only callable by root.
Namespace
api.tx.grandpa.noteStalledType
function noteStalled(
delay: u32,
best_finalized_block_number: u32
)reportEquivocation
Report voter 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.
Namespace
api.tx.grandpa.reportEquivocationType
function reportEquivocation(
equivocation_proof: SpFinalityGrandpaEquivocationProof,
key_owner_proof: SpCoreVoid
)reportEquivocationUnsigned
Report voter 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 in ValidateUnsigned), as such if the block author is defined it will be defined as the equivocation reporter.
Namespace
api.tx.grandpa.reportEquivocationUnsignedType
function reportEquivocationUnsigned(
equivocation_proof: SpFinalityGrandpaEquivocationProof,
key_owner_proof: SpCoreVoid
)Storage
currentSetId
The number of changes (both in terms of keys and underlying economic responsibilities) in the "set" of Grandpa validators from genesis.
Namespace
api.query.grandpa.currentSetIdType
function currentSetId(
): u64nextForced
next block number where we can force a change.
Namespace
api.query.grandpa.nextForcedType
function nextForced(
): Option<u32>pendingChange
Pending change: (signaled at, scheduled change).
Namespace
api.query.grandpa.pendingChangeType
function pendingChange(
): Option<PalletGrandpaStoredPendingChange>setIdSession
A mapping from grandpa set ID to the index of the most recent session for which its members were responsible.
TWOX-NOTE: SetId is not under user control.
Namespace
api.query.grandpa.setIdSessionType
function setIdSession(
u64
): Option<u32>stalled
true if we are currently stalled.
Namespace
api.query.grandpa.stalledType
function stalled(
): Option<(u32,u32)>state
State of the current authority set.
Namespace
api.query.grandpa.stateType
function state(
): PalletGrandpaStoredStateEvents
NewAuthorities
New authority set has been applied.
Namespace
api.events.grandpa.NewAuthoritiesType
type NewAuthorities = {
authority_set: Vec<(SpFinalityGrandpaAppPublic,u64)>
}Paused
Current authority set has been paused.
Namespace
api.events.grandpa.PausedType
type Paused = {
}Resumed
Current authority set has been resumed.
Namespace
api.events.grandpa.ResumedType
type Resumed = {
}Errors
ChangePending
Attempt to signal GRANDPA change with one already pending.
Namespace
api.errors.grandpa.ChangePendingDuplicateOffenceReport
A given equivocation report is valid but already previously reported.
Namespace
api.errors.grandpa.DuplicateOffenceReportInvalidEquivocationProof
An equivocation proof provided as part of an equivocation report is invalid.
Namespace
api.errors.grandpa.InvalidEquivocationProofInvalidKeyOwnershipProof
A key ownership proof provided as part of an equivocation report is invalid.
Namespace
api.errors.grandpa.InvalidKeyOwnershipProofPauseFailed
Attempt to signal GRANDPA pause when the authority set isn't live (either paused or already pending pause).
Namespace
api.errors.grandpa.PauseFailedResumeFailed
Attempt to signal GRANDPA resume when the authority set isn't paused (either live or already pending resume).
Namespace
api.errors.grandpa.ResumeFailedTooSoon
Cannot signal forced change so soon after last.
Namespace
api.errors.grandpa.TooSoonConstants
maxAuthorities
Max Authorities in use
Namespace
api.consts.grandpa.maxAuthoritiesType
type maxAuthorities = u32JSON-RPC Methods
proveFinality
Prove finality for the given block number, returning the Justification for the last block in the set.
Interface
api.rpc.grandpa.proveFinality(blockNumber: BlockNumber): Option<EncodedFinalityProofs>JSON
{ "id":1, "jsonrpc":"2.0", "method":"grandpa_proveFinality", "params":[blockNumber: BlockNumber] }roundState
Returns the state of the current best round state as well as the ongoing background rounds
Interface
api.rpc.grandpa.roundState(): ReportedRoundStatesJSON
{ "id":1, "jsonrpc":"2.0", "method":"grandpa_roundState", "params":[] }subscribeJustifications
Subscribes to grandpa justifications
Interface
api.rpc.grandpa.subscribeJustifications(): JustificationNotificationJSON
{ "id":1, "jsonrpc":"2.0", "method":"grandpa_subscribeJustifications", "params":[] }