Documentation ¶
Index ¶
- Constants
- Variables
- func DbEthTxAttemptStateToTxAttemptState(state string) txmgrtypes.TxAttemptState
- func DbEthTxAttemptToEthTxAttempt(dbEthTxAttempt DbEthTxAttempt, evmAttempt *TxAttempt)
- func DbEthTxToEthTx(dbEthTx DbEthTx, evmEthTx *Tx)
- func DbReceiptFromEvmReceipt(evmReceipt *evmtypes.Receipt) dbReceipt
- func DbReceiptToEvmReceipt(receipt *dbReceipt) *evmtypes.Receipt
- func GetGethSignedTx(signedRawTx []byte) (*types.Transaction, error)
- func NewEvmTxAttemptBuilder(chainID big.Int, feeConfig evmTxAttemptBuilderFeeConfig, ...) *evmTxAttemptBuilder
- func NewEvmTxmClient(c evmclient.Client) *evmTxmClient
- func NewEvmTxmConfig(c ChainConfig) *evmTxmConfig
- func NewEvmTxmFeeConfig(c FeeConfig) *evmTxmFeeConfig
- func NewTxStore(db *sqlx.DB, lggr logger.Logger, cfg pg.QConfig) *evmTxStore
- type Broadcaster
- type ChainConfig
- type ChainReceipt
- type CheckerFactory
- type Confirmer
- type DatabaseConfig
- type DbEthTx
- type DbEthTxAttempt
- type EvmBroadcasterConfig
- type EvmConfirmerConfig
- type EvmReaperConfig
- type EvmResenderConfig
- type EvmTxStore
- type EvmTxmConfig
- type EvmTxmFeeConfig
- type FeeConfig
- type FwdMgr
- type KeyStore
- type ListenerConfig
- type NonceSyncer
- type NullTxManager
- type Reaper
- type Receipt
- type ReceiptPlus
- type Resender
- type SimulateChecker
- type TestEvmTxStore
- type TransactionClient
- type TransactionStore
- type TransmitChecker
- type TransmitCheckerFactory
- type TransmitCheckerSpec
- type Tx
- type TxAttempt
- type TxAttemptBuilder
- type TxAttemptSigner
- type TxManager
- type TxMeta
- type TxRequest
- type TxStore
- type TxStoreWebApi
- type Txm
- type TxmClient
- type VRFV1Checker
- type VRFV2Checker
Constants ¶
const ( // TransmitCheckerTypeSimulate is a checker that simulates the transaction before executing on // chain. TransmitCheckerTypeSimulate = txmgrtypes.TransmitCheckerType("simulate") // TransmitCheckerTypeVRFV1 is a checker that will not submit VRF V1 fulfillment requests that // have already been fulfilled. This could happen if the request was fulfilled by another node. TransmitCheckerTypeVRFV1 = txmgrtypes.TransmitCheckerType("vrf_v1") // TransmitCheckerTypeVRFV2 is a checker that will not submit VRF V2 fulfillment requests that // have already been fulfilled. This could happen if the request was fulfilled by another node. TransmitCheckerTypeVRFV2 = txmgrtypes.TransmitCheckerType("vrf_v2") // TransmitCheckerTypeVRFV2Plus is a checker that will not submit VRF V2 plus fulfillment requests that // have already been fulfilled. This could happen if the request was fulfilled by another node. TransmitCheckerTypeVRFV2Plus = txmgrtypes.TransmitCheckerType("vrf_v2plus") )
Variables ¶
var ( ErrKeyNotUpdated = errors.New("evmTxStore: Key not updated") ErrInvalidQOpt = errors.New("evmTxStore: Invalid QOpt") // ErrCouldNotGetReceipt is the error string we save if we reach our finality depth for a confirmed transaction without ever getting a receipt // This most likely happened because an external wallet used the account for this nonce ErrCouldNotGetReceipt = "could not get receipt" )
Functions ¶
func DbEthTxAttemptStateToTxAttemptState ¶ added in v2.4.0
func DbEthTxAttemptStateToTxAttemptState(state string) txmgrtypes.TxAttemptState
func DbEthTxAttemptToEthTxAttempt ¶ added in v2.1.0
func DbEthTxAttemptToEthTxAttempt(dbEthTxAttempt DbEthTxAttempt, evmAttempt *TxAttempt)
func DbEthTxToEthTx ¶ added in v2.1.0
func DbReceiptFromEvmReceipt ¶ added in v2.1.0
func DbReceiptToEvmReceipt ¶ added in v2.1.0
func GetGethSignedTx ¶ added in v2.2.0
func GetGethSignedTx(signedRawTx []byte) (*types.Transaction, error)
GetGethSignedTx decodes the SignedRawTx into a types.Transaction struct
func NewEvmTxAttemptBuilder ¶
func NewEvmTxAttemptBuilder(chainID big.Int, feeConfig evmTxAttemptBuilderFeeConfig, keystore TxAttemptSigner[common.Address], estimator gas.EvmFeeEstimator) *evmTxAttemptBuilder
func NewEvmTxmClient ¶ added in v2.2.0
func NewEvmTxmConfig ¶ added in v2.1.0
func NewEvmTxmConfig(c ChainConfig) *evmTxmConfig
func NewEvmTxmFeeConfig ¶ added in v2.3.0
func NewEvmTxmFeeConfig(c FeeConfig) *evmTxmFeeConfig
Types ¶
type Broadcaster ¶ added in v2.2.0
type Broadcaster = txmgr.Broadcaster[*big.Int, *evmtypes.Head, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee]
Type aliases for EVM
func NewEvmBroadcaster ¶ added in v2.2.0
func NewEvmBroadcaster( txStore TransactionStore, client TransactionClient, chainConfig txmgrtypes.BroadcasterChainConfig, feeConfig txmgrtypes.BroadcasterFeeConfig, txConfig txmgrtypes.BroadcasterTransactionsConfig, listenerConfig txmgrtypes.BroadcasterListenerConfig, keystore KeyStore, eventBroadcaster pg.EventBroadcaster, txAttemptBuilder TxAttemptBuilder, nonceSyncer NonceSyncer, logger logger.Logger, checkerFactory TransmitCheckerFactory, autoSyncNonce bool, ) *Broadcaster
NewEvmBroadcaster returns a new concrete EvmBroadcaster
type ChainConfig ¶ added in v2.3.0
type ChainConfig interface { ChainType() coreconfig.ChainType FinalityDepth() uint32 FinalityTagEnabled() bool NonceAutoSync() bool RPCDefaultBatchSize() uint32 }
ChainConfig encompasses config used by txmgr package Unless otherwise specified, these should support changing at runtime
type ChainReceipt ¶ added in v2.3.0
type ChainReceipt = txmgrtypes.ChainReceipt[common.Hash, common.Hash]
Type aliases for EVM
type CheckerFactory ¶
CheckerFactory is a real implementation of TransmitCheckerFactory.
func (*CheckerFactory) BuildChecker ¶
func (c *CheckerFactory) BuildChecker(spec TransmitCheckerSpec) (TransmitChecker, error)
BuildChecker satisfies the TransmitCheckerFactory interface.
type Confirmer ¶ added in v2.2.0
type Confirmer = txmgr.Confirmer[*big.Int, *evmtypes.Head, common.Address, common.Hash, common.Hash, *evmtypes.Receipt, evmtypes.Nonce, gas.EvmFee]
Type aliases for EVM
func NewEvmConfirmer ¶ added in v2.2.0
func NewEvmConfirmer( txStore TxStore, client TxmClient, chainConfig txmgrtypes.ConfirmerChainConfig, feeConfig txmgrtypes.ConfirmerFeeConfig, txConfig txmgrtypes.ConfirmerTransactionsConfig, dbConfig txmgrtypes.ConfirmerDatabaseConfig, keystore KeyStore, txAttemptBuilder TxAttemptBuilder, lggr logger.Logger, ) *Confirmer
NewEvmConfirmer instantiates a new EVM confirmer
type DatabaseConfig ¶ added in v2.3.0
type DbEthTx ¶ added in v2.1.0
type DbEthTx struct { ID int64 IdempotencyKey *string Nonce *int64 FromAddress common.Address ToAddress common.Address EncodedPayload []byte Value assets.Eth // GasLimit on the EthTx is always the conceptual gas limit, which is not // necessarily the same as the on-chain encoded value (i.e. Optimism) GasLimit uint32 Error nullv4.String // BroadcastAt is updated every time an attempt for this eth_tx is re-sent // In almost all cases it will be within a second or so of the actual send time. BroadcastAt *time.Time // InitialBroadcastAt is recorded once, the first ever time this eth_tx is sent CreatedAt time.Time State txmgrtypes.TxState // Marshalled EvmTxMeta // Used for additional context around transactions which you want to log // at send time. Meta *datatypes.JSON Subject uuid.NullUUID PipelineTaskRunID uuid.NullUUID MinConfirmations null.Uint32 EVMChainID utils.Big // TransmitChecker defines the check that should be performed before a transaction is submitted on // chain. TransmitChecker *datatypes.JSON InitialBroadcastAt *time.Time }
Directly maps to columns of database table "evm.txes". This is exported, as tests and other external code still directly reads DB using this schema.
func DbEthTxFromEthTx ¶ added in v2.1.0
type DbEthTxAttempt ¶ added in v2.1.0
type DbEthTxAttempt struct { ID int64 EthTxID int64 GasPrice *assets.Wei SignedRawTx []byte Hash common.Hash BroadcastBeforeBlockNum *int64 State string CreatedAt time.Time ChainSpecificGasLimit uint32 TxType int GasTipCap *assets.Wei GasFeeCap *assets.Wei }
Directly maps to columns of database table "evm.tx_attempts". This is exported, as tests and other external code still directly reads DB using this schema.
func DbEthTxAttemptFromEthTxAttempt ¶ added in v2.1.0
func DbEthTxAttemptFromEthTxAttempt(ethTxAttempt *TxAttempt) DbEthTxAttempt
type EvmBroadcasterConfig ¶ added in v2.1.0
type EvmBroadcasterConfig txmgrtypes.BroadcasterChainConfig
type EvmConfirmerConfig ¶ added in v2.1.0
type EvmConfirmerConfig txmgrtypes.ConfirmerChainConfig
type EvmReaperConfig ¶ added in v2.1.0
type EvmReaperConfig txmgrtypes.ReaperChainConfig
type EvmResenderConfig ¶ added in v2.1.0
type EvmResenderConfig txmgrtypes.ResenderChainConfig
type EvmTxStore ¶ added in v2.1.0
type EvmTxStore interface { // redeclare TxStore for mockery txmgrtypes.TxStore[common.Address, *big.Int, common.Hash, common.Hash, *evmtypes.Receipt, evmtypes.Nonce, gas.EvmFee] TxStoreWebApi }
EvmTxStore combines the txmgr tx store interface and the interface needed for the the API to read from the tx DB
type EvmTxmConfig ¶ added in v2.1.0
type EvmTxmConfig txmgrtypes.TransactionManagerChainConfig
type EvmTxmFeeConfig ¶ added in v2.3.0
type EvmTxmFeeConfig txmgrtypes.TransactionManagerFeeConfig
type FwdMgr ¶ added in v2.3.0
type FwdMgr = txmgrtypes.ForwarderManager[common.Address]
Type aliases for EVM
type ListenerConfig ¶ added in v2.3.0
type NonceSyncer ¶
Type aliases for EVM
func NewNonceSyncer ¶
func NewNonceSyncer( txStore EvmTxStore, lggr logger.Logger, ethClient evmclient.Client, kst KeyStore, ) NonceSyncer
NewNonceSyncer returns a new syncer
type NullTxManager ¶
type NullTxManager = txmgr.NullTxManager[*big.Int, *evmtypes.Head, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee]
Type aliases for EVM
type Reaper ¶
Type aliases for EVM
func NewEvmReaper ¶ added in v2.2.0
func NewEvmReaper(lggr logger.Logger, store txmgrtypes.TxHistoryReaper[*big.Int], config EvmReaperConfig, txConfig txmgrtypes.ReaperTransactionsConfig, chainID *big.Int) *Reaper
NewEvmReaper instantiates a new EVM-specific reaper object
type Receipt ¶ added in v2.3.0
type Receipt = dbReceipt // EvmReceipt is the exported DB table model for receipts
Type aliases for EVM
type ReceiptPlus ¶ added in v2.3.0
type ReceiptPlus = txmgrtypes.ReceiptPlus[*evmtypes.Receipt]
Type aliases for EVM
type Resender ¶ added in v2.2.0
type Resender = txmgr.Resender[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee]
Type aliases for EVM
func NewEvmResender ¶ added in v2.2.0
func NewEvmResender( lggr logger.Logger, txStore TransactionStore, client TransactionClient, ks KeyStore, pollInterval time.Duration, config EvmResenderConfig, txConfig txmgrtypes.ResenderTransactionsConfig, ) *Resender
NewEvnResender creates a new concrete EvmResender
type SimulateChecker ¶
SimulateChecker simulates transactions, producing an error if they revert on chain.
type TestEvmTxStore ¶ added in v2.3.0
type TestEvmTxStore interface { EvmTxStore // methods only used for testing purposes InsertReceipt(receipt *evmtypes.Receipt) (int64, error) InsertTx(etx *Tx) error FindTxAttemptsByTxIDs(ids []int64) ([]TxAttempt, error) InsertTxAttempt(attempt *TxAttempt) error LoadTxesAttempts(etxs []*Tx, qopts ...pg.QOpt) error }
type TransactionClient ¶ added in v2.3.0
type TransactionClient = txmgrtypes.TransactionClient[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee]
Type aliases for EVM
type TransactionStore ¶ added in v2.3.0
type TransactionStore = txmgrtypes.TransactionStore[common.Address, *big.Int, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee]
Type aliases for EVM
type TransmitChecker ¶
type TransmitChecker = txmgr.TransmitChecker[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee]
var ( // NoChecker is a TransmitChecker that always determines a transaction should be submitted. NoChecker TransmitChecker = noChecker{} )
type TransmitCheckerFactory ¶
type TransmitCheckerFactory = txmgr.TransmitCheckerFactory[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee]
Type aliases for EVM
type TransmitCheckerSpec ¶
type TransmitCheckerSpec = txmgrtypes.TransmitCheckerSpec[common.Address]
type Tx ¶ added in v2.3.0
type Tx = txmgrtypes.Tx[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee]
Type aliases for EVM
type TxAttempt ¶ added in v2.3.0
type TxAttempt = txmgrtypes.TxAttempt[*big.Int, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee]
Type aliases for EVM
type TxAttemptBuilder ¶ added in v2.3.0
type TxAttemptBuilder = txmgrtypes.TxAttemptBuilder[*big.Int, *evmtypes.Head, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee]
Type aliases for EVM
type TxAttemptSigner ¶
type TxAttemptSigner[ADDR commontypes.Hashable] interface { SignTx(fromAddress ADDR, tx *types.Transaction, chainID *big.Int) (*types.Transaction, error) }
type TxManager ¶
type TxManager = txmgr.TxManager[*big.Int, *evmtypes.Head, common.Address, common.Hash, common.Hash, evmtypes.Nonce, gas.EvmFee]
Type aliases for EVM
func NewTxm ¶
func NewTxm( db *sqlx.DB, chainConfig ChainConfig, fCfg FeeConfig, txConfig config.Transactions, dbConfig DatabaseConfig, listenerConfig ListenerConfig, client evmclient.Client, lggr logger.Logger, logPoller logpoller.LogPoller, keyStore keystore.Eth, eventBroadcaster pg.EventBroadcaster, estimator gas.EvmFeeEstimator, ) (txm TxManager, err error, )
NewTxm constructs the necessary dependencies for the EvmTxm (broadcaster, confirmer, etc) and returns a new EvmTxManager
type TxStore ¶ added in v2.3.0
type TxStore = txmgrtypes.TxStore[common.Address, *big.Int, common.Hash, common.Hash, *evmtypes.Receipt, evmtypes.Nonce, gas.EvmFee]
Type aliases for EVM
type TxStoreWebApi ¶ added in v2.3.0
type TxStoreWebApi interface { FindTxAttemptConfirmedByTxIDs(ids []int64) ([]TxAttempt, error) FindTxByHash(hash common.Hash) (*Tx, error) Transactions(offset, limit int) ([]Tx, int, error) TxAttempts(offset, limit int) ([]TxAttempt, int, error) TransactionsWithAttempts(offset, limit int) ([]Tx, int, error) FindTxAttempt(hash common.Hash) (*TxAttempt, error) FindTxWithAttempts(etxID int64) (etx Tx, err error) }
TxStoreWebApi encapsulates the methods that are not used by the txmgr and only used by the various web controllers and readers
type Txm ¶
type Txm = txmgr.Txm[*big.Int, *evmtypes.Head, common.Address, common.Hash, common.Hash, *evmtypes.Receipt, evmtypes.Nonce, gas.EvmFee]
Type aliases for EVM
func NewEvmTxm ¶ added in v2.3.0
func NewEvmTxm( chainId *big.Int, cfg txmgrtypes.TransactionManagerChainConfig, txCfg txmgrtypes.TransactionManagerTransactionsConfig, keyStore KeyStore, lggr logger.Logger, checkerFactory TransmitCheckerFactory, fwdMgr FwdMgr, txAttemptBuilder TxAttemptBuilder, txStore TxStore, nonceSyncer NonceSyncer, broadcaster *Broadcaster, confirmer *Confirmer, resender *Resender, ) *Txm
NewEvmTxm creates a new concrete EvmTxm
type TxmClient ¶ added in v2.3.0
type TxmClient = txmgrtypes.TxmClient[*big.Int, common.Address, common.Hash, common.Hash, *evmtypes.Receipt, evmtypes.Nonce, gas.EvmFee]
Type aliases for EVM
type VRFV1Checker ¶
type VRFV1Checker struct { // Callbacks checks whether a VRF V1 request has already been fulfilled on the VRFCoordinator // Solidity contract Callbacks func(opts *bind.CallOpts, reqID [32]byte) (v1.Callbacks, error) Client evmclient.Client }
VRFV1Checker is an implementation of TransmitChecker that checks whether a VRF V1 fulfillment has already been fulfilled.
type VRFV2Checker ¶
type VRFV2Checker struct { // GetCommitment checks whether a VRF V2 request has been fulfilled on the VRFCoordinatorV2 // Solidity contract. GetCommitment func(opts *bind.CallOpts, requestID *big.Int) ([32]byte, error) // HeadByNumber fetches the head given the number. If nil is provided, // the latest header is fetched. HeadByNumber func(ctx context.Context, n *big.Int) (*types.Head, error) // RequestBlockNumber is the block number of the VRFV2 request. RequestBlockNumber *big.Int }
VRFV2Checker is an implementation of TransmitChecker that checks whether a VRF V2 fulfillment has already been fulfilled.