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.UserOpHandlerFunc
- func (r *Reputation) IncOpsIncluded() modules.BatchHandlerFunc
- func (r *Reputation) IncOpsSeen() modules.UserOpHandlerFunc
- func (r *Reputation) Override(entries []*ReputationOverride) error
- func (r *Reputation) ValidateOpLimit() modules.UserOpHandlerFunc
- 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 UserOperation.
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 userOps by entity status.
func (*Reputation) CheckStatus ¶
func (r *Reputation) CheckStatus() modules.UserOpHandlerFunc
CheckStatus returns a UserOpHandler that is used by the Client to determine if the userOp 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.UserOpHandlerFunc
IncOpsSeen returns a UserOpHandler 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.UserOpHandlerFunc
ValidateOpLimit returns a UserOpHandler that is used by the Client to determine if the userOp 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 UserOperation coming into the mempool.