#include <babe_block_validator.hpp>
Validation of blocks in BABE system. Based on the algorithm described here: https://research.web3.foundation/en/latest/polkadot/BABE/Babe/#2-normal-phase
Definition at line 36 of file babe_block_validator.hpp.
Enumerator |
---|
NO_AUTHORITIES |
|
INVALID_SIGNATURE |
|
INVALID_VRF |
|
TWO_BLOCKS_IN_SLOT |
|
SECONDARY_SLOT_ASSIGNMENTS_DISABLED |
|
Definition at line 55 of file babe_block_validator.hpp.
kagome::consensus::BabeBlockValidator::~BabeBlockValidator |
( |
| ) |
|
|
overridedefault |
Create an instance of BabeBlockValidator
- Parameters
-
block_tree | to be used by this instance |
tx_queue | to validate the extrinsics |
hasher | to take hashes |
vrf_provider | for VRF-specific operations |
configuration | Babe configuration from genesis |
Definition at line 41 of file babe_block_validator.cpp.
Validate the block header
- Parameters
-
block | to be validated |
authority_id | authority that sent this block |
threshold | is vrf threshold for this epoch |
config | is babe config for this epoch |
- Returns
- nothing or validation error
Implements kagome::consensus::BlockValidator.
Definition at line 60 of file babe_block_validator.cpp.
Verify that block is signed by valid signature
- Parameters
-
header | Header to be checked |
babe_header | BabeBlockHeader corresponding to (fetched from) header |
seal | Seal corresponding to (fetched from) header |
public_key | public key that corresponds to the authority by authority index |
- Returns
- true if signature is valid, false otherwise
Definition at line 123 of file babe_block_validator.cpp.
Verify that vrf value contained in babe_header is less than threshold and was generated by the creator of the block
- Parameters
-
babe_header | BabeBlockHeader corresponding to (fetched from) header |
public_key | Public key of creator of the block |
threshold | threshold value for that epoch |
randomness | randomness for that epoch |
- Returns
- true if vrf is valid, false otherwise
Definition at line 143 of file babe_block_validator.cpp.
std::shared_ptr<crypto::Hasher> kagome::consensus::BabeBlockValidator::hasher_ |
|
private |
log::Logger kagome::consensus::BabeBlockValidator::log_ |
|
private |
The documentation for this class was generated from the following files: