Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BlockEligibilityValidator ¶
type BlockEligibilityValidator struct {
// contains filtered or unexported fields
}
BlockEligibilityValidator holds all the dependencies for validating block eligibility.
func NewBlockEligibilityValidator ¶
func NewBlockEligibilityValidator(committeeSize, genesisActiveSetSize uint32, layersPerEpoch uint16, activationDb activationDB, beaconProvider *EpochBeaconProvider, validateVRF VRFValidationFunction, log log.Log) *BlockEligibilityValidator
NewBlockEligibilityValidator returns a new BlockEligibilityValidator.
func (BlockEligibilityValidator) BlockSignedAndEligible ¶
func (v BlockEligibilityValidator) BlockSignedAndEligible(block *types.Block) (bool, error)
BlockSignedAndEligible checks that a given block is signed and eligible. It returns true with no error or false and an error that explains why validation failed.
type EpochBeaconProvider ¶
type EpochBeaconProvider struct{}
EpochBeaconProvider holds all the dependencies for generating an epoch beacon. There are currently none.
type MinerBlockOracle ¶
type MinerBlockOracle struct {
// contains filtered or unexported fields
}
MinerBlockOracle is the oracle that provides block eligibility proofs for the miner.
func NewMinerBlockOracle ¶
func NewMinerBlockOracle(committeeSize uint32, genesisActiveSetSize uint32, layersPerEpoch uint16, atxDB activationDB, beaconProvider *EpochBeaconProvider, vrfSigner signer, nodeID types.NodeID, isSynced func() bool, log log.Log) *MinerBlockOracle
NewMinerBlockOracle returns a new MinerBlockOracle.
func (*MinerBlockOracle) BlockEligible ¶
func (bo *MinerBlockOracle) BlockEligible(layerID types.LayerID) (types.ATXID, []types.BlockEligibilityProof, error)
BlockEligible returns the ATXID and list of block eligibility proofs for the given layer. It caches proofs for a single epoch and only refreshes the cache if eligibility is queried for a different epoch.
func (*MinerBlockOracle) GetEligibleLayers ¶
func (bo *MinerBlockOracle) GetEligibleLayers() []types.LayerID
GetEligibleLayers returns a list of layers in which the miner is eligible for at least one block. The list is returned in arbitrary order.
type VRFValidationFunction ¶
VRFValidationFunction is the VRF validation function.