Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Txmv2 enablement #15286

Merged
merged 153 commits into from
Jan 20, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
153 commits
Select commit Hold shift + click to select a range
10e27f7
TXMv2 alpha version
dimriou Oct 11, 2024
174c605
TXM fixes
dimriou Oct 14, 2024
9764be1
Merge branch 'develop' into txmv2
dimriou Oct 14, 2024
adecb3c
Fix
dimriou Oct 14, 2024
79c5a20
Merge branch 'develop' into txmv2
dimriou Oct 21, 2024
b92c3e4
Update orchestrator
dimriou Oct 21, 2024
9821731
Merge branch 'develop' into txmv2
dimriou Oct 21, 2024
610228f
Add builder
dimriou Oct 22, 2024
cc49673
Merge branch 'develop' into txmv2
dimriou Oct 23, 2024
117d8f1
Add txmv2 tests
dimriou Oct 23, 2024
501326c
Merge branch 'develop' into txmv2
dimriou Oct 29, 2024
bfdb9a4
Update retry logic
dimriou Oct 29, 2024
1c18bd7
Add backoff mechanism
dimriou Oct 29, 2024
93889ae
Add multi address support
dimriou Nov 1, 2024
a83d89b
Merge branch 'develop' into txmv2
dimriou Nov 1, 2024
3375df3
Add backoff mechanism for broadcasting and backfilling
dimriou Nov 1, 2024
d596e70
Merge branch 'develop' into txmv2
dimriou Nov 1, 2024
50fd300
Minor fix
dimriou Nov 1, 2024
f004bc4
Add check to dummy keystore
dimriou Nov 1, 2024
2e97d64
Fix inmemory store logging per address
dimriou Nov 2, 2024
80c70e1
Remove unnecessary const
dimriou Nov 4, 2024
f97eeaa
Stuck tx detector alpha
dimriou Nov 5, 2024
7e7d697
Update stuck tx detection
dimriou Nov 5, 2024
5556d84
Merge branch 'develop' into txmv2
dimriou Nov 7, 2024
b6c26f9
Merge branch 'txmv2' into txmv2_stuck_tx_detection
dimriou Nov 7, 2024
2dcdbab
Merge branch 'develop' into txmv2
dimriou Nov 7, 2024
80b09ed
Merge branch 'txmv2' into txmv2_stuck_tx_detection
dimriou Nov 7, 2024
9eeb6fe
Add stuck_tx_detection and dual broadcast client
dimriou Nov 8, 2024
25f54be
Merge branch 'develop' into txmv2
dimriou Nov 8, 2024
f9af9e1
Add support for TXMv2
dimriou Nov 12, 2024
5704dba
Merge branch 'develop' into txmv2
dimriou Nov 12, 2024
0bfe011
Fix txm to work with enabled addresses from keystore
dimriou Nov 12, 2024
f428bdc
Merge branch 'txmv2' into txmv2_stuck_tx_detection
dimriou Nov 12, 2024
45beb8e
Fix orchestrator's monitoring call
dimriou Nov 12, 2024
8786bc5
Fix AttemptBuilder
dimriou Nov 12, 2024
331a45d
Enable DualBroadcast client
dimriou Nov 12, 2024
8f51afe
Enable dual broadcast
dimriou Nov 13, 2024
6121fdf
AttemptBuilder fixes
dimriou Nov 13, 2024
f62a9c1
Merge branch 'develop' into txmv2
dimriou Nov 13, 2024
52b4bfb
Merge branch 'txmv2' into txmv2_stuck_tx_detection
dimriou Nov 13, 2024
14fc5de
Merge branch 'txmv2_stuck_tx_detection' into txmv2_enablement
dimriou Nov 13, 2024
9d7c5a0
Add AttemptBuilder service exception
dimriou Nov 13, 2024
7831151
Add AttemptBuilder close
dimriou Nov 13, 2024
b62a5ee
Merge branch 'txmv2' into txmv2_stuck_tx_detection
dimriou Nov 13, 2024
ce3fe11
Merge branch 'txmv2_stuck_tx_detection' into txmv2_enablement
dimriou Nov 13, 2024
fc33337
Minor updates
dimriou Nov 13, 2024
eaa8e74
Merge branch 'txmv2' into txmv2_stuck_tx_detection
dimriou Nov 13, 2024
87497a0
Switch DualBroadcast params to pointers
dimriou Nov 13, 2024
257fcf4
Merge branch 'txmv2_stuck_tx_detection' into txmv2_enablement
dimriou Nov 13, 2024
015f1bf
Update DualBroadcast types to pointers
dimriou Nov 13, 2024
fc11ca1
Make purgable attempts empty
dimriou Nov 15, 2024
5f5541c
Merge branch 'develop' into txmv2
dimriou Nov 15, 2024
906a8be
Merge branch 'txmv2' into txmv2_stuck_tx_detection
dimriou Nov 15, 2024
e6e8b09
Merge branch 'txmv2_stuck_tx_detection' into txmv2_enablement
dimriou Nov 15, 2024
cb38104
Merge branch 'develop' into txmv2
dimriou Nov 15, 2024
cb9c321
Merge branch 'txmv2' into txmv2_stuck_tx_detection
dimriou Nov 15, 2024
2f196a5
Merge branch 'txmv2_stuck_tx_detection' into txmv2_enablement
dimriou Nov 15, 2024
d2dc53b
Fix Idempotency in Store Manager
dimriou Nov 15, 2024
c56bb81
Merge branch 'txmv2' into txmv2_stuck_tx_detection
dimriou Nov 15, 2024
750b96a
Merge branch 'txmv2_stuck_tx_detection' into txmv2_enablement
dimriou Nov 15, 2024
9abccc7
Update trigger
dimriou Nov 19, 2024
c2c1c4f
Fix lint
dimriou Nov 19, 2024
18fac77
Merge branch 'develop' into txmv2
dimriou Nov 19, 2024
3edfc00
Merge branch 'txmv2' into txmv2_stuck_tx_detection
dimriou Nov 19, 2024
22f2795
Merge branch 'txmv2_stuck_tx_detection' into txmv2_enablement
dimriou Nov 19, 2024
a04b458
Add context to client
dimriou Nov 19, 2024
0d7b1c4
Merge branch 'txmv2_stuck_tx_detection' into txmv2_enablement
dimriou Nov 19, 2024
3250b19
Merge branch 'develop' into txmv2
dimriou Nov 19, 2024
54a59d4
Merge branch 'txmv2' into txmv2_stuck_tx_detection
dimriou Nov 19, 2024
409ac1a
Merge branch 'txmv2_stuck_tx_detection' into txmv2_enablement
dimriou Nov 19, 2024
8044bef
Fix more lint
dimriou Nov 19, 2024
946d2cb
Merge branch 'txmv2' into txmv2_stuck_tx_detection
dimriou Nov 19, 2024
6828e38
Merge branch 'txmv2_stuck_tx_detection' into txmv2_enablement
dimriou Nov 19, 2024
5032336
Fix lint
dimriou Nov 19, 2024
31e9e83
Merge branch 'txmv2' into txmv2_stuck_tx_detection
dimriou Nov 19, 2024
b16643d
Fix lint
dimriou Nov 19, 2024
3ba3a31
Merge branch 'txmv2_stuck_tx_detection' into txmv2_enablement
dimriou Nov 19, 2024
feb243a
Fix lint
dimriou Nov 19, 2024
e3bb10b
Merge branch 'txmv2' into txmv2_stuck_tx_detection
dimriou Nov 19, 2024
338f2da
Fix DualBroadcast client
dimriou Nov 19, 2024
82a5469
Merge branch 'txmv2_stuck_tx_detection' into txmv2_enablement
dimriou Nov 19, 2024
8a4e25f
More lint fixes
dimriou Nov 19, 2024
717868e
Merge branch 'txmv2' into txmv2_stuck_tx_detection
dimriou Nov 19, 2024
83d15ab
More lint fixes
dimriou Nov 19, 2024
7636236
Merge branch 'txmv2_stuck_tx_detection' into txmv2_enablement
dimriou Nov 19, 2024
ee67544
Fix lint
dimriou Nov 20, 2024
d119a13
Merge branch 'develop' into txmv2
dimriou Nov 20, 2024
7454696
Merge branch 'txmv2' into txmv2_stuck_tx_detection
dimriou Nov 20, 2024
c05c875
Fix lint
dimriou Nov 20, 2024
6e717e7
Merge branch 'txmv2_stuck_tx_detection' into txmv2_enablement
dimriou Nov 20, 2024
0f707a1
Fix lint final
dimriou Nov 20, 2024
3829f87
Merge branch 'txmv2' into txmv2_stuck_tx_detection
dimriou Nov 20, 2024
d167c46
Merge branch 'txmv2_stuck_tx_detection' into txmv2_enablement
dimriou Nov 20, 2024
291bbc0
Fix races
dimriou Nov 20, 2024
6c4f710
Merge branch 'txmv2' into txmv2_stuck_tx_detection
dimriou Nov 20, 2024
ed45103
Merge branch 'txmv2_stuck_tx_detection' into txmv2_enablement
dimriou Nov 20, 2024
d45090b
Update logs
dimriou Nov 25, 2024
942a400
Merge branch 'txmv2' into txmv2_stuck_tx_detection
dimriou Nov 25, 2024
f3e39e3
Merge branch 'txmv2_stuck_tx_detection' into txmv2_enablement
dimriou Nov 25, 2024
43ed971
Fix lint
dimriou Nov 25, 2024
cb15055
Merge branch 'txmv2' into txmv2_stuck_tx_detection
dimriou Nov 25, 2024
e4f1649
Merge branch 'txmv2_stuck_tx_detection' into txmv2_enablement
dimriou Nov 25, 2024
21ff676
Start documentation
dimriou Nov 25, 2024
6036910
Merge branch 'develop' into txmv2
dimriou Nov 25, 2024
887e199
Update DummyKeystore Add method
dimriou Nov 27, 2024
e331d81
Merge branch 'develop' into txmv2
dimriou Nov 27, 2024
cecb0e1
Txmv2 stuck tx detection (#15436)
dimriou Nov 27, 2024
91e35ea
Make nonce nullable
dimriou Nov 27, 2024
15ff37a
Merge branch 'txmv2' into txmv2_enablement
dimriou Nov 27, 2024
78e0690
Update configs
dimriou Nov 27, 2024
2c551f6
Merge branch 'txmv2' into txmv2_enablement
dimriou Nov 27, 2024
272ba06
Add prom metrics
dimriou Nov 28, 2024
79895a7
Add prom metrics
dimriou Nov 28, 2024
4df641a
Merge branch 'txmv2' into txmv2_enablement
dimriou Nov 28, 2024
7b0a1d1
Add transaction confirmation metric
dimriou Dec 2, 2024
5f55245
Improve logs
dimriou Dec 2, 2024
bb18095
Merge branch 'txmv2' into txmv2_enablement
dimriou Dec 2, 2024
6bc27a2
Add Abandon support
dimriou Dec 2, 2024
926bf67
Address feedback
dimriou Dec 3, 2024
5fdc190
Merge branch 'txmv2' into txmv2_enablement
dimriou Dec 4, 2024
a4eacaa
Update tests
dimriou Dec 4, 2024
ecfdfb9
Fix orchestrator log
dimriou Dec 4, 2024
1c4cc3e
Merge branch 'txmv2' into txmv2_enablement
dimriou Dec 4, 2024
0ff44e9
Fix Nonce log
dimriou Dec 4, 2024
f61a10c
Merge branch 'txmv2' into txmv2_enablement
dimriou Dec 4, 2024
cecb7f6
Improvements
dimriou Dec 4, 2024
e6ab384
Merge branch 'txmv2' into txmv2_enablement
dimriou Dec 4, 2024
103f0d8
Update tests
dimriou Dec 4, 2024
0fb3bcc
Merge branch 'txmv2' into txmv2_enablement
dimriou Dec 5, 2024
cc0b9eb
Add fixes
dimriou Dec 6, 2024
6a17e0a
Improvements
dimriou Dec 6, 2024
8d870fb
Improve logs
dimriou Dec 9, 2024
a2f1544
Move initialization of nonce
dimriou Dec 10, 2024
5b023a4
Add Beholder metrics
dimriou Dec 10, 2024
86ce03a
Improve InMemoryStorage
dimriou Dec 12, 2024
5b73b73
Support different priceMax per key
dimriou Dec 12, 2024
08f4851
Upgrades
dimriou Dec 13, 2024
ec1be22
Merge branch 'txmv2' into txmv2_enablement
dimriou Dec 13, 2024
ccf8be7
Fix config tests
dimriou Dec 13, 2024
7fb2e3a
Merge branch 'develop' into txmv2
dimriou Dec 13, 2024
8cb5d9c
Merge branch 'txmv2' into txmv2_enablement
dimriou Dec 13, 2024
98d0b53
Fix docs
dimriou Dec 14, 2024
9774fcd
Merge branch 'txmv2' into txmv2_enablement
dimriou Dec 14, 2024
2fb029e
Fix config test lint
dimriou Dec 16, 2024
fed8aad
Merge branch 'txmv2' into txmv2_enablement
dimriou Dec 16, 2024
6160f8f
Update configs
dimriou Jan 3, 2025
d5c4a40
Reuse transaction states
dimriou Jan 7, 2025
b0f620a
Merge branch 'develop' into txmv2
dimriou Jan 7, 2025
03d5973
Fix docs
dimriou Jan 7, 2025
ab62c24
Deprecate DualBroadcastDetection
dimriou Jan 9, 2025
df39b08
Add health report
dimriou Jan 10, 2025
4d02034
Merge branch 'txmv2' into txmv2_enablement
dimriou Jan 10, 2025
5756524
Merge branch 'develop' into txmv2_enablement
dimriou Jan 20, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 38 additions & 1 deletion common/txmgr/txmgr.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,20 @@ type TxManager[
GetTransactionStatus(ctx context.Context, transactionID string) (state commontypes.TransactionStatus, err error)
}

type TxmV2Wrapper[
CHAIN_ID types.ID,
HEAD types.Head[BLOCK_HASH],
ADDR types.Hashable,
TX_HASH types.Hashable,
BLOCK_HASH types.Hashable,
SEQ types.Sequence,
FEE fees.Fee,
] interface {
services.Service
CreateTransaction(ctx context.Context, txRequest txmgrtypes.TxRequest[ADDR, TX_HASH]) (etx txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], err error)
Reset(addr ADDR, abandon bool) error
}

type reset struct {
// f is the function to execute between stopping/starting the
// Broadcaster and Confirmer
Expand Down Expand Up @@ -112,6 +126,7 @@ type Txm[
fwdMgr txmgrtypes.ForwarderManager[ADDR]
txAttemptBuilder txmgrtypes.TxAttemptBuilder[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]
newErrorClassifier NewErrorClassifier
txmv2wrapper TxmV2Wrapper[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]
}

func (b *Txm[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) RegisterResumeCallback(fn ResumeCallback) {
Expand Down Expand Up @@ -147,6 +162,7 @@ func NewTxm[
tracker *Tracker[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, R, SEQ, FEE],
finalizer txmgrtypes.Finalizer[BLOCK_HASH, HEAD],
newErrorClassifierFunc NewErrorClassifier,
txmv2wrapper TxmV2Wrapper[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE],
) *Txm[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, R, SEQ, FEE] {
b := Txm[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, R, SEQ, FEE]{
logger: logger.Sugared(lggr),
Expand All @@ -169,6 +185,7 @@ func NewTxm[
tracker: tracker,
newErrorClassifier: newErrorClassifierFunc,
finalizer: finalizer,
txmv2wrapper: txmv2wrapper,
}

if txCfg.ResendAfterThreshold() <= 0 {
Expand Down Expand Up @@ -207,6 +224,12 @@ func (b *Txm[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) Start(ctx
return fmt.Errorf("Txm: Finalizer failed to start: %w", err)
}

if b.txmv2wrapper != nil {
if err := ms.Start(ctx, b.txmv2wrapper); err != nil {
return fmt.Errorf("Txm: Txmv2 failed to start: %w", err)
}
}

b.logger.Info("Txm starting runLoop")
b.wg.Add(1)
go b.runLoop()
Expand Down Expand Up @@ -237,6 +260,11 @@ func (b *Txm[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) Reset(addr
f := func() {
if abandon {
err = b.abandon(addr)
if b.txmv2wrapper != nil {
if err2 := b.txmv2wrapper.Reset(addr, abandon); err2 != nil {
b.logger.Error("failed to abandon transactions for dual broadcast", "err", err2)
}
}
}
}

Expand Down Expand Up @@ -460,6 +488,12 @@ func (b *Txm[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) runLoop()
if err != nil && (!errors.Is(err, services.ErrAlreadyStopped) || !errors.Is(err, services.ErrCannotStopUnstarted)) {
b.logger.Errorw(fmt.Sprintf("Failed to Close Finalizer: %v", err), "err", err)
}
if b.txmv2wrapper != nil {
err = b.txmv2wrapper.Close()
if err != nil && (!errors.Is(err, services.ErrAlreadyStopped) || !errors.Is(err, services.ErrCannotStopUnstarted)) {
b.logger.Errorw(fmt.Sprintf("Failed to Close Finalizer: %v", err), "err", err)
}
}
return
case <-keysChanged:
// This check prevents the weird edge-case where you can select
Expand Down Expand Up @@ -513,11 +547,14 @@ func (b *Txm[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) Trigger(ad
func (b *Txm[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) CreateTransaction(ctx context.Context, txRequest txmgrtypes.TxRequest[ADDR, TX_HASH]) (tx txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], err error) {
// Check for existing Tx with IdempotencyKey. If found, return the Tx and do nothing
// Skipping CreateTransaction to avoid double send
if b.txmv2wrapper != nil && txRequest.Meta != nil && txRequest.Meta.DualBroadcast != nil && *txRequest.Meta.DualBroadcast {
return b.txmv2wrapper.CreateTransaction(ctx, txRequest)
}
if txRequest.IdempotencyKey != nil {
var existingTx *txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]
existingTx, err = b.txStore.FindTxWithIdempotencyKey(ctx, *txRequest.IdempotencyKey, b.chainID)
if err != nil {
return tx, fmt.Errorf("Failed to search for transaction with IdempotencyKey: %w", err)
return tx, fmt.Errorf("failed to search for transaction with IdempotencyKey: %w", err)
}
if existingTx != nil {
b.logger.Infow("Found a Tx with IdempotencyKey. Returning existing Tx without creating a new one.", "IdempotencyKey", *txRequest.IdempotencyKey)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,8 @@ func makeTestEvmTxm(
lp,
keyStore,
estimator,
ht)
ht,
nil)
require.NoError(t, err, "can't create tx manager")

_, unsub := broadcaster.Subscribe(txm)
Expand Down
2 changes: 1 addition & 1 deletion core/chains/evm/txm/docs/TRANSACTION_MANAGER_V2.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@
- `txm_num_broadcasted_transactions`: total number of successful broadcasted transactions.
- `txm_num_confirmed_transactions`: total number of confirmed transactions. Note that this can happen multiple times per transaction in the case of re-orgs.
- `txm_num_nonce_gaps`: total number of nonce gaps created that the transaction manager had to fill.
- `txm_time_until_tx_confirmed`: The amount of time elapsed from a transaction being broadcast to being included in a block.
- `txm_time_until_tx_confirmed`: The amount of time elapsed from a transaction being broadcast to being included in a block.
6 changes: 4 additions & 2 deletions core/chains/evm/txmgr/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ func NewTxm(
keyStore keystore.Eth,
estimator gas.EvmFeeEstimator,
headTracker latestAndFinalizedBlockHeadTracker,
txmv2wrapper TxManager,
) (txm TxManager,
err error,
) {
Expand Down Expand Up @@ -70,7 +71,7 @@ func NewTxm(
if txConfig.ResendAfterThreshold() > 0 {
evmResender = NewEvmResender(lggr, txStore, txmClient, evmTracker, keyStore, txmgr.DefaultResenderPollInterval, chainConfig, txConfig)
}
txm = NewEvmTxm(chainID, txmCfg, txConfig, keyStore, lggr, checker, fwdMgr, txAttemptBuilder, txStore, evmBroadcaster, evmConfirmer, evmResender, evmTracker, evmFinalizer)
txm = NewEvmTxm(chainID, txmCfg, txConfig, keyStore, lggr, checker, fwdMgr, txAttemptBuilder, txStore, evmBroadcaster, evmConfirmer, evmResender, evmTracker, evmFinalizer, txmv2wrapper)
return txm, nil
}

Expand All @@ -90,8 +91,9 @@ func NewEvmTxm(
resender *Resender,
tracker *Tracker,
finalizer Finalizer,
txmv2wrapper TxManager,
) *Txm {
return txmgr.NewTxm(chainId, cfg, txCfg, keyStore, lggr, checkerFactory, fwdMgr, txAttemptBuilder, txStore, broadcaster, confirmer, resender, tracker, finalizer, client.NewTxError)
return txmgr.NewTxm(chainId, cfg, txCfg, keyStore, lggr, checkerFactory, fwdMgr, txAttemptBuilder, txStore, broadcaster, confirmer, resender, tracker, finalizer, client.NewTxError, txmv2wrapper)
}

func NewTxmV2(
Expand Down
2 changes: 1 addition & 1 deletion core/chains/evm/txmgr/evm_tx_store_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1286,7 +1286,7 @@ func TestORM_UpdateTxUnstartedToInProgress(t *testing.T) {
evmTxmCfg := txmgr.NewEvmTxmConfig(ccfg.EVM())
ec := evmtest.NewEthClientMockWithDefaultChain(t)
txMgr := txmgr.NewEvmTxm(ec.ConfiguredChainID(), evmTxmCfg, ccfg.EVM().Transactions(), nil, logger.Test(t), nil, nil,
nil, txStore, nil, nil, nil, nil, nil)
nil, txStore, nil, nil, nil, nil, nil, nil)
err := txMgr.XXXTestAbandon(fromAddress) // mark transaction as abandoned
require.NoError(t, err)

Expand Down
3 changes: 2 additions & 1 deletion core/chains/evm/txmgr/txmgr_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@ func makeTestEvmTxm(
lp,
keyStore,
estimator,
ht)
ht,
nil)
}

func TestTxm_SendNativeToken_DoesNotSendToZero(t *testing.T) {
Expand Down
36 changes: 20 additions & 16 deletions core/chains/legacyevm/evm_txm.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,9 @@ func newEvmTxm(
)

if opts.GenTxManager == nil {
var txmv2 txmgr.TxManager
if cfg.Transactions().TransactionManagerV2().Enabled() {
txm, err = txmgr.NewTxmV2(
txmv2, err = txmgr.NewTxmV2(
ds,
cfg,
txmgr.NewEvmTxmFeeConfig(cfg.GasEstimator()),
Expand All @@ -53,22 +54,25 @@ func newEvmTxm(
opts.KeyStore,
estimator,
)
} else {
txm, err = txmgr.NewTxm(
ds,
cfg,
txmgr.NewEvmTxmFeeConfig(cfg.GasEstimator()),
cfg.Transactions(),
cfg.NodePool().Errors(),
databaseConfig,
listenerConfig,
client,
lggr,
logPoller,
opts.KeyStore,
estimator,
headTracker)
if cfg.Transactions().TransactionManagerV2().DualBroadcast() != nil && *cfg.Transactions().TransactionManagerV2().DualBroadcast() {
return txmv2, err
}
}
txm, err = txmgr.NewTxm(
ds,
cfg,
txmgr.NewEvmTxmFeeConfig(cfg.GasEstimator()),
cfg.Transactions(),
cfg.NodePool().Errors(),
databaseConfig,
listenerConfig,
client,
lggr,
logPoller,
opts.KeyStore,
estimator,
headTracker,
txmv2)
} else {
txm = opts.GenTxManager(chainID)
}
Expand Down
3 changes: 2 additions & 1 deletion core/services/headreporter/prometheus_reporter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,8 @@ func newLegacyChainContainer(t *testing.T, db *sqlx.DB) legacyevm.LegacyChainCon
lp,
keyStore,
estimator,
ht)
ht,
nil)
require.NoError(t, err)

cfg := configtest.NewGeneralConfig(t, nil)
Expand Down
2 changes: 1 addition & 1 deletion core/services/vrf/delegate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ func buildVrfUni(t *testing.T, db *sqlx.DB, cfg chainlink.GeneralConfig) vrfUniv
btORM := bridges.NewORM(db)
ks := keystore.NewInMemory(db, utils.FastScryptParams, lggr)
_, dbConfig, evmConfig := txmgr.MakeTestConfigs(t)
txm, err := txmgr.NewTxm(db, evmConfig, evmConfig.GasEstimator(), evmConfig.Transactions(), nil, dbConfig, dbConfig.Listener(), ec, logger.TestLogger(t), nil, ks.Eth(), nil, nil)
txm, err := txmgr.NewTxm(db, evmConfig, evmConfig.GasEstimator(), evmConfig.Transactions(), nil, dbConfig, dbConfig.Listener(), ec, logger.TestLogger(t), nil, ks.Eth(), nil, nil, nil)
orm := headtracker.NewORM(*testutils.FixtureChainID, db)
require.NoError(t, orm.IdempotentInsertHead(testutils.Context(t), cltest.Head(51)))
jrm := job.NewORM(db, prm, btORM, ks, lggr)
Expand Down
2 changes: 1 addition & 1 deletion core/services/vrf/v2/integration_v2_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ func makeTestTxm(t *testing.T, txStore txmgr.TestEvmTxStore, keyStore keystore.M
_, _, evmConfig := txmgr.MakeTestConfigs(t)
txmConfig := txmgr.NewEvmTxmConfig(evmConfig)
txm := txmgr.NewEvmTxm(ec.ConfiguredChainID(), txmConfig, evmConfig.Transactions(), keyStore.Eth(), logger.TestLogger(t), nil, nil,
nil, txStore, nil, nil, nil, nil, nil)
nil, txStore, nil, nil, nil, nil, nil, nil)

return txm
}
Expand Down
2 changes: 1 addition & 1 deletion core/services/vrf/v2/listener_v2_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ func makeTestTxm(t *testing.T, txStore txmgr.TestEvmTxStore, keyStore keystore.M
ec := evmtest.NewEthClientMockWithDefaultChain(t)
txmConfig := txmgr.NewEvmTxmConfig(evmConfig)
txm := txmgr.NewEvmTxm(ec.ConfiguredChainID(), txmConfig, evmConfig.Transactions(), keyStore.Eth(), logger.TestLogger(t), nil, nil,
nil, txStore, nil, nil, nil, nil, nil)
nil, txStore, nil, nil, nil, nil, nil, nil)

return txm
}
Expand Down
Loading