Kagome
Polkadot Runtime Engine in C++17
kagome::authority::AuthorityManager Class Referenceabstract

#include <authority_manager.hpp>

Inheritance diagram for kagome::authority::AuthorityManager:
Collaboration diagram for kagome::authority::AuthorityManager:

Public Member Functions

virtual ~AuthorityManager ()=default
 
virtual outcome::result< void > recalculateStoredState (primitives::BlockNumber last_finalized_number)=0
 
virtual primitives::BlockInfo base () const =0
 
virtual std::optional< std::shared_ptr< const primitives::AuthoritySet > > authorities (const primitives::BlockInfo &block, IsBlockFinalized finalized) const =0
 Returns authorities according specified block. More...
 
virtual outcome::result< void > applyScheduledChange (const primitives::BlockInfo &block, const primitives::AuthorityList &authorities, primitives::BlockNumber activate_at)=0
 Schedule an authority set change after the given delay of N blocks, after next one would be finalized by the finality consensus engine. More...
 
virtual outcome::result< void > applyForcedChange (const primitives::BlockInfo &block, const primitives::AuthorityList &authorities, primitives::BlockNumber delay_start, size_t delay)=0
 Force an authority set change after the given delay of N blocks, after next one would be imported block which has been validated by the block production consensus engine. More...
 
virtual outcome::result< void > applyOnDisabled (const primitives::BlockInfo &block, uint64_t authority_index)=0
 An index of the individual authority in the current authority list that should be immediately disabled until the next authority set change. When an authority gets disabled, the node should stop performing any authority functionality from that authority, including authoring blocks and casting GRANDPA votes for finalization. Similarly, other nodes should ignore all messages from the indicated authority which pertain to their authority role. Once an authority set change after the given delay of N blocks, is an imported block which has been validated by the block production consensus engine. More...
 
virtual outcome::result< void > applyPause (const primitives::BlockInfo &block, primitives::BlockNumber activate_at)=0
 A signal to pause the current authority set after the given delay, is a block finalized by the finality consensus engine. After finalizing block, the authorities should stop voting. More...
 
virtual outcome::result< void > applyResume (const primitives::BlockInfo &block, primitives::BlockNumber activate_at)=0
 A signal to resume the current authority set after the given delay, is an imported block and validated by the block production consensus engine. After authoring the block B 0 , the authorities should resume voting. More...
 
virtual void prune (const primitives::BlockInfo &block)=0
 Prunes data which was needed only till {. More...
 

Detailed Description

Definition at line 28 of file authority_manager.hpp.

Constructor & Destructor Documentation

virtual kagome::authority::AuthorityManager::~AuthorityManager ( )
virtualdefault

Member Function Documentation

virtual outcome::result<void> kagome::authority::AuthorityManager::applyForcedChange ( const primitives::BlockInfo block,
const primitives::AuthorityList authorities,
primitives::BlockNumber  delay_start,
size_t  delay 
)
pure virtual

Force an authority set change after the given delay of N blocks, after next one would be imported block which has been validated by the block production consensus engine.

Parameters
blockthe block where a digest with this change was discovered
authoritiesnew authority set
delay_startblock at which the delay before this change is applied starts
delaythe chain length until the delay is over

Implemented in kagome::authority::AuthorityManagerImpl.

virtual outcome::result<void> kagome::authority::AuthorityManager::applyOnDisabled ( const primitives::BlockInfo block,
uint64_t  authority_index 
)
pure virtual

An index of the individual authority in the current authority list that should be immediately disabled until the next authority set change. When an authority gets disabled, the node should stop performing any authority functionality from that authority, including authoring blocks and casting GRANDPA votes for finalization. Similarly, other nodes should ignore all messages from the indicated authority which pertain to their authority role. Once an authority set change after the given delay of N blocks, is an imported block which has been validated by the block production consensus engine.

Parameters
blockthe block where a digest with this change was discovered
authority_indexis index of one authority in current authority set

Implemented in kagome::authority::AuthorityManagerImpl.

virtual outcome::result<void> kagome::authority::AuthorityManager::applyPause ( const primitives::BlockInfo block,
primitives::BlockNumber  activate_at 
)
pure virtual

A signal to pause the current authority set after the given delay, is a block finalized by the finality consensus engine. After finalizing block, the authorities should stop voting.

Parameters
blockthe block where a digest with this change was discovered
activateAtis number of block when changes will applied

Implemented in kagome::authority::AuthorityManagerImpl.

virtual outcome::result<void> kagome::authority::AuthorityManager::applyResume ( const primitives::BlockInfo block,
primitives::BlockNumber  activate_at 
)
pure virtual

A signal to resume the current authority set after the given delay, is an imported block and validated by the block production consensus engine. After authoring the block B 0 , the authorities should resume voting.

Parameters
blockthe block where a digest with this change was discovered
activateAtis number of block when changes will applied

Implemented in kagome::authority::AuthorityManagerImpl.

virtual outcome::result<void> kagome::authority::AuthorityManager::applyScheduledChange ( const primitives::BlockInfo block,
const primitives::AuthorityList authorities,
primitives::BlockNumber  activate_at 
)
pure virtual

Schedule an authority set change after the given delay of N blocks, after next one would be finalized by the finality consensus engine.

Parameters
blockthe block where a digest with this change was discovered
authoritiesis authority set for renewal
activateAtis number of block when changes will applied

Implemented in kagome::authority::AuthorityManagerImpl.

virtual std::optional<std::shared_ptr<const primitives::AuthoritySet> > kagome::authority::AuthorityManager::authorities ( const primitives::BlockInfo block,
IsBlockFinalized  finalized 
) const
pure virtual

Returns authorities according specified block.

Parameters
blockfor which authority set is requested
finalized- true if we consider that the provided block is finalized
Returns
outcome authority set

Implemented in kagome::authority::AuthorityManagerImpl.

virtual primitives::BlockInfo kagome::authority::AuthorityManager::base ( ) const
pure virtual
Returns
block associated with the root of scheduled changes tree

Implemented in kagome::authority::AuthorityManagerImpl.

virtual void kagome::authority::AuthorityManager::prune ( const primitives::BlockInfo block)
pure virtual

Prunes data which was needed only till {.

Parameters
block}and won't be used anymore

Implemented in kagome::authority::AuthorityManagerImpl.

virtual outcome::result<void> kagome::authority::AuthorityManager::recalculateStoredState ( primitives::BlockNumber  last_finalized_number)
pure virtual

Recalculate the authority change graph starting from genesis and up to the last finalized block. The result shall be stored in the provided storage. This operation may take a considerable amount of time.

Returns
nothing on success, error otherwise

Implemented in kagome::authority::AuthorityManagerImpl.


The documentation for this class was generated from the following file: