Documentation ¶
Overview ¶
Package paymaster implements modules for reputation scoring and throttling/banning for paymasters as specified in EIP-4337.
Index ¶
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 status of every Paymaster seen in a UserOperation.
func New ¶
func New(db *badger.DB) *Reputation
New returns an instance of a Reputation object to track and appropriately process userOps by paymaster 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 paymaster status.
- ok: Paymasters is allowed
- throttled: No new ops from the Paymaster is allowed if one already exists. And it can only stays in the pool for 10 blocks
- banned: No ops from the Paymaster 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 paymasters 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 check if a userOp has a paymaster and increments its opsSeen counter.