|
Kagome
Polkadot Runtime Engine in C++17
|
#include <babe_lottery.hpp>
Public Member Functions | |
| virtual | ~BabeLottery ()=default |
| virtual void | changeEpoch (const EpochDescriptor &epoch, const Randomness &randomness, const Threshold &threshold, const crypto::Sr25519Keypair &keypair)=0 |
| virtual EpochDescriptor | getEpoch () const =0 |
| virtual std::optional< crypto::VRFOutput > | getSlotLeadership (primitives::BabeSlotNumber slot) const =0 |
| virtual crypto::VRFOutput | slotVrfSignature (primitives::BabeSlotNumber slot) const =0 |
| virtual std::optional< primitives::AuthorityIndex > | secondarySlotAuthor (primitives::BabeSlotNumber slot, primitives::AuthorityListSize authorities_count, const Randomness &randomness) const =0 |
Interface for acquiring leadership information for the current Babe epoch. It is expected to be used as follows:
Definition at line 30 of file babe_lottery.hpp.
|
virtualdefault |
|
pure virtual |
Set new epoch and corresponding randomness, threshold and keypair values
| epoch | is an information about epoch where we calculate leadership |
| randomness | is an epoch random byte sequence |
| threshold | is a maximum value that is considered valid by vrf |
| keypair | is a current babe sign pair |
Implemented in kagome::consensus::BabeLotteryImpl.
|
pure virtual |
Return lottery current epoch
Implemented in kagome::consensus::BabeLotteryImpl.
|
pure virtual |
Compute leadership for the slot
| slot | is a slot number |
Implemented in kagome::consensus::BabeLotteryImpl.
|
pure virtual |
Compute the expected author for secondary slot
| slot | - slot to have secondary block produced |
| authorities_count | - quantity of authorities in current epoch |
| randomness | - current randomness |
Implemented in kagome::consensus::BabeLotteryImpl.
|
pure virtual |
Computes VRF proof for the slot regardless threshold. Used when secondary VRF slots are enabled
| slot | is a slot number |
Implemented in kagome::consensus::BabeLotteryImpl.