Documentation ¶
Index ¶
- func CalculateReliabilityScore(stat *schema.Stat) error
- type Enforcer
- type ScoreMaintainer
- type SimpleEnforcer
- func (e *SimpleEnforcer) ChallengeStates(_ context.Context) error
- func (e *SimpleEnforcer) MaintainReliabilityScore(ctx context.Context) error
- func (e *SimpleEnforcer) RetrieveQualifiedNodes(ctx context.Context, key string) ([]*model.NodeEndpointCache, error)
- func (e *SimpleEnforcer) VerifyPartialResponses(ctx context.Context, epochID uint64, responses []*model.DataResponse)
- func (e *SimpleEnforcer) VerifyResponses(ctx context.Context, responses []*model.DataResponse) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CalculateReliabilityScore ¶ added in v0.4.13
CalculateReliabilityScore calculates the Reliability Score σ of a given Node. σ is used to determine the probability of a Node receiving a request on DSL.
Types ¶
type Enforcer ¶
type Enforcer interface { VerifyResponses(ctx context.Context, responses []*model.DataResponse) error VerifyPartialResponses(ctx context.Context, epochID uint64, responses []*model.DataResponse) MaintainReliabilityScore(ctx context.Context) error ChallengeStates(ctx context.Context) error RetrieveQualifiedNodes(ctx context.Context, key string) ([]*model.NodeEndpointCache, error) }
type ScoreMaintainer ¶ added in v0.4.13
type ScoreMaintainer struct {
// contains filtered or unexported fields
}
ScoreMaintainer is a structure used to maintain a sorted set and a quick lookup map. It uses Redis to keep a sorted set based on node scores, and a map in memory for fast access to each node endpoint's cached data. This structure helps in quickly and efficiently updating and retrieving scores and statuses of nodes in distributed systems.
type SimpleEnforcer ¶
type SimpleEnforcer struct {
// contains filtered or unexported fields
}
func NewSimpleEnforcer ¶
func (*SimpleEnforcer) ChallengeStates ¶
func (e *SimpleEnforcer) ChallengeStates(_ context.Context) error
func (*SimpleEnforcer) MaintainReliabilityScore ¶
func (e *SimpleEnforcer) MaintainReliabilityScore(ctx context.Context) error
MaintainReliabilityScore maintains the Reliability Score σ for all Nodes. σ is used to determine the probability of a Node receiving a request on DSL.
func (*SimpleEnforcer) RetrieveQualifiedNodes ¶ added in v0.4.13
func (e *SimpleEnforcer) RetrieveQualifiedNodes(ctx context.Context, key string) ([]*model.NodeEndpointCache, error)
RetrieveQualifiedNodes retrieves the qualified Nodes from the sorted set.
func (*SimpleEnforcer) VerifyPartialResponses ¶
func (e *SimpleEnforcer) VerifyPartialResponses(ctx context.Context, epochID uint64, responses []*model.DataResponse)
VerifyPartialResponses performs a partial verification of the responses from the Nodes.
func (*SimpleEnforcer) VerifyResponses ¶
func (e *SimpleEnforcer) VerifyResponses(ctx context.Context, responses []*model.DataResponse) error
VerifyResponses verifies the responses from the Nodes.