From 585f7aaa7f550c58c60b02362b9952f51139e489 Mon Sep 17 00:00:00 2001 From: Silas Lenihan <32529249+silaslenihan@users.noreply.github.com> Date: Tue, 1 Oct 2024 13:57:56 -0400 Subject: [PATCH] Removed SendStrategy from ChainWriter config (#14623) --- core/capabilities/ccip/configs/evm/chain_writer.go | 4 +--- .../ccip/ocrimpls/contract_transmitter_test.go | 5 +---- core/services/relay/evm/chain_writer.go | 8 +------- core/services/relay/evm/types/types.go | 7 ++----- 4 files changed, 5 insertions(+), 19 deletions(-) diff --git a/core/capabilities/ccip/configs/evm/chain_writer.go b/core/capabilities/ccip/configs/evm/chain_writer.go index 6f8c4a1570b..9bc377ba23e 100644 --- a/core/capabilities/ccip/configs/evm/chain_writer.go +++ b/core/capabilities/ccip/configs/evm/chain_writer.go @@ -8,7 +8,6 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/smartcontractkit/chainlink-ccip/pkg/consts" - "github.com/smartcontractkit/chainlink/v2/common/txmgr" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/assets" evmtypes "github.com/smartcontractkit/chainlink/v2/core/chains/evm/types" @@ -60,8 +59,7 @@ func ChainWriterConfigRaw( }, }, }, - SendStrategy: txmgr.NewSendEveryStrategy(), - MaxGasPrice: maxGasPrice, + MaxGasPrice: maxGasPrice, } } diff --git a/core/capabilities/ccip/ocrimpls/contract_transmitter_test.go b/core/capabilities/ccip/ocrimpls/contract_transmitter_test.go index 274620926fa..21c9ad01995 100644 --- a/core/capabilities/ccip/ocrimpls/contract_transmitter_test.go +++ b/core/capabilities/ccip/ocrimpls/contract_transmitter_test.go @@ -25,8 +25,6 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/utils/mailbox" - txmgrcommon "github.com/smartcontractkit/chainlink/v2/common/txmgr" - "github.com/smartcontractkit/chainlink/v2/core/chains/evm/assets" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/client" evmconfig "github.com/smartcontractkit/chainlink/v2/core/chains/evm/config" @@ -402,8 +400,7 @@ func chainWriterConfigRaw(fromAddress common.Address, maxGasPrice *assets.Wei) e }, }, }, - SendStrategy: txmgrcommon.NewSendEveryStrategy(), - MaxGasPrice: maxGasPrice, + MaxGasPrice: maxGasPrice, } } diff --git a/core/services/relay/evm/chain_writer.go b/core/services/relay/evm/chain_writer.go index d61c17b2ae2..be5575ca3d0 100644 --- a/core/services/relay/evm/chain_writer.go +++ b/core/services/relay/evm/chain_writer.go @@ -44,15 +44,10 @@ func NewChainWriterService(logger logger.Logger, client evmclient.Client, txm ev ge: estimator, maxGasPrice: config.MaxGasPrice, - sendStrategy: txmgr.NewSendEveryStrategy(), contracts: config.Contracts, parsedContracts: &codec.ParsedTypes{EncoderDefs: map[string]types.CodecEntry{}, DecoderDefs: map[string]types.CodecEntry{}}, } - if config.SendStrategy != nil { - w.sendStrategy = config.SendStrategy - } - if err := w.parseContracts(); err != nil { return nil, fmt.Errorf("%w: failed to parse contracts", err) } @@ -74,7 +69,6 @@ type chainWriter struct { ge gas.EvmFeeEstimator maxGasPrice *assets.Wei - sendStrategy txmgrtypes.TxStrategy contracts map[string]*types.ContractConfig parsedContracts *codec.ParsedTypes @@ -135,7 +129,7 @@ func (w *chainWriter) SubmitTransaction(ctx context.Context, contract, method st FeeLimit: gasLimit, Meta: txMeta, IdempotencyKey: &transactionID, - Strategy: w.sendStrategy, + Strategy: txmgr.NewSendEveryStrategy(), Checker: checker, Value: *v, } diff --git a/core/services/relay/evm/types/types.go b/core/services/relay/evm/types/types.go index c1f814c5965..1a824f3d162 100644 --- a/core/services/relay/evm/types/types.go +++ b/core/services/relay/evm/types/types.go @@ -13,8 +13,6 @@ import ( ocrtypes "github.com/smartcontractkit/libocr/offchainreporting2plus/types" - txmgrtypes "github.com/smartcontractkit/chainlink/v2/common/txmgr/types" - "github.com/smartcontractkit/chainlink-common/pkg/codec" "github.com/smartcontractkit/chainlink-common/pkg/services" "github.com/smartcontractkit/chainlink-common/pkg/types" @@ -26,9 +24,8 @@ import ( ) type ChainWriterConfig struct { - Contracts map[string]*ContractConfig - SendStrategy txmgrtypes.TxStrategy - MaxGasPrice *assets.Wei + Contracts map[string]*ContractConfig + MaxGasPrice *assets.Wei } type ContractConfig struct {