paymaster

package
v0.6.16 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 30, 2023 License: GPL-3.0 Imports: 9 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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.

  1. ok: Paymasters is allowed
  2. throttled: No new ops from the Paymaster is allowed if one already exists. And it can only stays in the pool for 10 blocks
  3. 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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL