Documentation
¶
Index ¶
- Constants
- func CheckSenderWhitelist(db *badger.DB, whitelistedAddresses []common.Address, logger logr.Logger, ...) (modules.BatchHandlerFunc, func() error)
- func SimulateTxWithTenderly(cfg *conf.Values, chainCliet *ethclient.Client, logger logr.Logger, ...) modules.BatchHandlerFunc
- type OpHashes
- type Relayer
Constants ¶
const (
DefaultWaitTimeout = 72 * time.Second
)
Variables ¶
This section is empty.
Functions ¶
func CheckSenderWhitelist ¶
func CheckSenderWhitelist(db *badger.DB, whitelistedAddresses []common.Address, logger logr.Logger, txHashes *xsync.MapOf[string, OpHashes], entrypointAddr common.Address, chainID *big.Int) (modules.BatchHandlerFunc, func() error)
CheckSenderWhitelist is an handler that checks to limit on-chain userops to a set of addresses. These addresses must be initialized on start up and they must be a comma seperated list ERC4337_BUNDLER_ADDRESS_WHITELIST=0xAddress1,0xAddress2 If not provided, this middleware will always act as a no-op
It also returns a function that acts as a clean up operation We do not want to persist whitelisted addresses between restarts They must always come fresh from the env variable
Types ¶
type Relayer ¶
type Relayer struct {
// contains filtered or unexported fields
}
Relayer provides a module that can relay batches with a regular EOA. Relaying batches to the EntryPoint through a regular transaction comes with several important notes:
- The bundler will NOT be operating as a block builder.
- This opens the bundler up to frontrunning.
This module only works in the case of a private mempool and will not work in the P2P case where ops are propagated through the network and it is impossible to prevent collisions from multiple bundlers trying to relay the same ops.
func New ¶
func New( ep common.Address, eoa *signer.EOA, eth *ethclient.Client, chainID *big.Int, beneficiary common.Address, l logr.Logger, ) *Relayer
New initializes a new EOA relayer for sending batches to the EntryPoint.
func (*Relayer) GetOpHashes ¶
func (*Relayer) SendUserOperation ¶
func (r *Relayer) SendUserOperation() modules.BatchHandlerFunc
SendUserOperation returns a BatchHandler that is used by the Bundler to send batches in a regular EOA transaction.
func (*Relayer) SetWaitTimeout ¶
SetWaitTimeout sets the total time to wait for a transaction to be included. When a timeout is reached, the BatchHandler will throw an error if the transaction has not been included or has been included but with a failed status.
The default value is 30 seconds. Setting the value to 0 will skip waiting for a transaction to be included.