Documentation ¶
Index ¶
- type Oracle
- func (o *Oracle) CalcEligibility(ctx context.Context, layer types.LayerID, round uint32, committeeSize int, ...) (uint16, error)
- func (o *Oracle) IsIdentityActiveOnConsensusView(ctx context.Context, edID string, layer types.LayerID) (bool, error)
- func (o *Oracle) Proof(ctx context.Context, layer types.LayerID, round uint32) ([]byte, error)
- func (o *Oracle) Validate(ctx context.Context, layer types.LayerID, round uint32, committeeSize int, ...) (bool, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Oracle ¶
Oracle is the hare eligibility oracle.
func New ¶
func New( beacons system.BeaconGetter, atxdb atxProvider, meshdb meshProvider, vrfVerifier verifierFunc, vrfSigner *signing.VRFSigner, layersPerEpoch uint32, cfg config.Config, logger log.Log, ) *Oracle
New returns a new eligibility oracle instance.
func (*Oracle) CalcEligibility ¶ added in v1.0.0
func (o *Oracle) CalcEligibility(ctx context.Context, layer types.LayerID, round uint32, committeeSize int, id types.NodeID, vrfSig []byte, ) (uint16, error)
CalcEligibility calculates the number of eligibilities of ID on the given Layer where msg is the VRF message, sig is the role proof and assuming commSize as the expected committee size.
func (*Oracle) IsIdentityActiveOnConsensusView ¶
func (o *Oracle) IsIdentityActiveOnConsensusView(ctx context.Context, edID string, layer types.LayerID) (bool, error)
IsIdentityActiveOnConsensusView returns true if the provided identity is active on the consensus view derived from the specified layer, false otherwise.
func (*Oracle) Validate ¶ added in v1.0.0
func (o *Oracle) Validate(ctx context.Context, layer types.LayerID, round uint32, committeeSize int, id types.NodeID, sig []byte, eligibilityCount uint16) (bool, error)
Validate validates the number of eligibilities of ID on the given Layer where msg is the VRF message, sig is the role proof and assuming commSize as the expected committee size.
Click to show internal directories.
Click to hide internal directories.