Documentation ¶
Overview ¶
Package entities implements modules for reputation scoring and throttling/banning of entities as specified in EIP-4337.
Index ¶
- type Reputation
- func (r *Reputation) CheckStatus() modules.AiOpHandlerFunc
- func (r *Reputation) IncOpsIncluded() modules.BatchHandlerFunc
- func (r *Reputation) IncOpsSeen() modules.AiOpHandlerFunc
- func (r *Reputation) Override(entries []*ReputationOverride) error
- func (r *Reputation) ValidateOpLimit() modules.AiOpHandlerFunc
- type ReputationConstants
- type ReputationOverride
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Reputation ¶
type Reputation struct {
// contains filtered or unexported fields
}
Reputation provides Client and Bundler modules to track the reputation of every entity seen in a AiOperation.
func New ¶
func New(db *badger.DB, eth *ethclient.Client, repConst *ReputationConstants) *Reputation
New returns an instance of a Reputation object to track and appropriately process aiOps by entity status.
func (*Reputation) CheckStatus ¶
func (r *Reputation) CheckStatus() modules.AiOpHandlerFunc
CheckStatus returns a AiOpHandler that is used by the Client to determine if the aiOp is allowed based on the entities status.
- ok: entity is allowed
- throttled: No new ops from the entity is allowed if one already exists. And it can only stays in the pool for 10 blocks
- banned: No ops from the entity is allowed
func (*Reputation) IncOpsIncluded ¶
func (r *Reputation) IncOpsIncluded() modules.BatchHandlerFunc
IncOpsIncluded returns a BatchHandler used by the Bundler to increment opsIncluded counters for all relevant entities in the batch. This module should be used last once batches have been sent.
func (*Reputation) IncOpsSeen ¶
func (r *Reputation) IncOpsSeen() modules.AiOpHandlerFunc
IncOpsSeen returns a AiOpHandler that is used by the Client to increment the opsSeen counter for all included entities.
func (*Reputation) Override ¶
func (r *Reputation) Override(entries []*ReputationOverride) error
func (*Reputation) ValidateOpLimit ¶
func (r *Reputation) ValidateOpLimit() modules.AiOpHandlerFunc
ValidateOpLimit returns a AiOpHandler that is used by the Client to determine if the aiOp is allowed based on the entities stake and the number of pending ops in the mempool.
type ReputationConstants ¶
type ReputationConstants struct { MinUnstakeDelay int MinStakeValue int64 SameSenderMempoolCount int SameUnstakedEntityMempoolCount int ThrottledEntityMempoolCount int ThrottledEntityLiveBlocks int ThrottledEntityBundleCount int MinInclusionRateDenominator int ThrottlingSlack int BanSlack int }
ReputationConstants are a collection of values for determining the appropriate status of a AiOperation coming into the mempool.