Documentation ¶
Overview ¶
Package eligibility defines fixed size oracle used for node testing
Index ¶
- type FixedRolacle
- func (fo *FixedRolacle) CalcEligibility(ctx context.Context, layer types.LayerID, round uint32, committeeSize int, ...) (uint16, error)
- func (fo *FixedRolacle) Export(id types.Hash32, committeeSize int) map[types.NodeID]struct{}
- func (fo *FixedRolacle) IsIdentityActiveOnConsensusView(ctx context.Context, edID types.NodeID, layer types.LayerID) (bool, error)
- func (fo *FixedRolacle) Proof(ctx context.Context, nonce types.VRFPostIndex, layer types.LayerID, ...) ([]byte, error)
- func (fo *FixedRolacle) Register(isHonest bool, client types.NodeID)
- func (fo *FixedRolacle) Unregister(isHonest bool, client types.NodeID)
- func (fo *FixedRolacle) Validate(context.Context, types.LayerID, uint32, int, types.NodeID, []byte, uint16) (bool, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FixedRolacle ¶
type FixedRolacle struct {
// contains filtered or unexported fields
}
FixedRolacle is an eligibility simulator with pre-determined honest and faulty participants.
func (*FixedRolacle) CalcEligibility ¶ added in v1.0.0
func (fo *FixedRolacle) CalcEligibility(ctx context.Context, layer types.LayerID, round uint32, committeeSize int, id types.NodeID, nonce types.VRFPostIndex, sig []byte) (uint16, error)
CalcEligibility returns 1 if the miner is eligible in given layer, and 0 otherwise.
func (*FixedRolacle) Export ¶
Export creates a map with the eligible participants for id and committee size.
func (*FixedRolacle) IsIdentityActiveOnConsensusView ¶
func (fo *FixedRolacle) IsIdentityActiveOnConsensusView(ctx context.Context, edID types.NodeID, layer types.LayerID) (bool, error)
IsIdentityActiveOnConsensusView is use to satisfy the API, currently always returns true.
func (*FixedRolacle) Proof ¶
func (fo *FixedRolacle) Proof(ctx context.Context, nonce types.VRFPostIndex, layer types.LayerID, round uint32) ([]byte, error)
Proof generates a proof for the round. used to satisfy interface.
func (*FixedRolacle) Register ¶
func (fo *FixedRolacle) Register(isHonest bool, client types.NodeID)
Register adds a participant to the eligibility map. can be honest or faulty.
func (*FixedRolacle) Unregister ¶
func (fo *FixedRolacle) Unregister(isHonest bool, client types.NodeID)
Unregister removes a participant from the eligibility map. can be honest or faulty. TODO: just remove from both instead of specifying.