Skip to content

Commit

Permalink
[BCFR-1048] - Logic to solve ocassional nonce gap issues (#14984)
Browse files Browse the repository at this point in the history
* nonce gap handling

* add changeset

* refactor tests

* add comment explaining situation

* go sec no lint

* fix flake

* fix flakes

* fix flake

* use mock anything
  • Loading branch information
Farber98 authored Nov 4, 2024
1 parent c3f8926 commit 1738332
Show file tree
Hide file tree
Showing 10 changed files with 70 additions and 55 deletions.
5 changes: 5 additions & 0 deletions .changeset/short-gifts-eat.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"chainlink": patch
---

use last mined nonce instead of pending nonce to recover from occasional nonce gap issues within nonce tracker. #internal
40 changes: 20 additions & 20 deletions core/chains/evm/txmgr/broadcaster_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ func TestEthBroadcaster_Lifecycle(t *testing.T) {
estimator := gasmocks.NewEvmFeeEstimator(t)
txBuilder := txmgr.NewEvmTxAttemptBuilder(*ethClient.ConfiguredChainID(), evmcfg.EVM().GasEstimator(), ethKeyStore, estimator)
txmClient := txmgr.NewEvmTxmClient(ethClient, nil)
ethClient.On("PendingNonceAt", mock.Anything, mock.Anything).Return(uint64(0), nil)
ethClient.On("NonceAt", mock.Anything, mock.Anything, mock.Anything).Return(uint64(0), nil).Twice()
eb := txmgr.NewEvmBroadcaster(
txStore,
txmClient,
Expand Down Expand Up @@ -149,7 +149,7 @@ func TestEthBroadcaster_LoadNextSequenceMapFailure_StartupSuccess(t *testing.T)
cltest.MustInsertRandomKeyReturningState(t, ethKeyStore)
estimator := gasmocks.NewEvmFeeEstimator(t)
txBuilder := txmgr.NewEvmTxAttemptBuilder(*ethClient.ConfiguredChainID(), evmcfg.EVM().GasEstimator(), ethKeyStore, estimator)
ethClient.On("PendingNonceAt", mock.Anything, mock.Anything).Return(uint64(0), errors.New("Getting on-chain nonce failed"))
ethClient.On("NonceAt", mock.Anything, mock.Anything, mock.Anything).Return(uint64(0), errors.New("Getting on-chain nonce failed")).Once()
txmClient := txmgr.NewEvmTxmClient(ethClient, nil)
eb := txmgr.NewEvmBroadcaster(
txStore,
Expand Down Expand Up @@ -185,8 +185,8 @@ func TestEthBroadcaster_ProcessUnstartedEthTxs_Success(t *testing.T) {
evmcfg := evmtest.NewChainScopedConfig(t, cfg)
checkerFactory := &txmgr.CheckerFactory{Client: ethClient}

ethClient.On("PendingNonceAt", mock.Anything, fromAddress).Return(uint64(0), nil).Once()
ethClient.On("PendingNonceAt", mock.Anything, otherAddress).Return(uint64(0), nil).Once()
ethClient.On("NonceAt", mock.Anything, fromAddress, mock.Anything).Return(uint64(0), nil).Once()
ethClient.On("NonceAt", mock.Anything, otherAddress, mock.Anything).Return(uint64(0), nil).Once()
lggr := logger.Test(t)
nonceTracker := txmgr.NewNonceTracker(lggr, txStore, txmgr.NewEvmTxmClient(ethClient, nil))
eb := NewTestEthBroadcaster(t, txStore, ethClient, ethKeyStore, cfg, evmcfg, checkerFactory, false, nonceTracker)
Expand Down Expand Up @@ -387,7 +387,7 @@ func TestEthBroadcaster_ProcessUnstartedEthTxs_Success(t *testing.T) {
c.EVM[0].GasEstimator.PriceMax = assets.NewWeiI(rnd + 2)
})
evmcfg = evmtest.NewChainScopedConfig(t, cfg)
ethClient.On("PendingNonceAt", mock.Anything, otherAddress).Return(uint64(1), nil).Once()
ethClient.On("NonceAt", mock.Anything, otherAddress, mock.Anything).Return(uint64(1), nil).Once()
nonceTracker = txmgr.NewNonceTracker(lggr, txStore, txmgr.NewEvmTxmClient(ethClient, nil))
eb = NewTestEthBroadcaster(t, txStore, ethClient, ethKeyStore, cfg, evmcfg, checkerFactory, false, nonceTracker)

Expand Down Expand Up @@ -556,7 +556,7 @@ func TestEthBroadcaster_TransmitChecking(t *testing.T) {
ethClient := testutils.NewEthClientMockWithDefaultChain(t)
evmcfg := evmtest.NewChainScopedConfig(t, cfg)
checkerFactory := &testCheckerFactory{}
ethClient.On("PendingNonceAt", mock.Anything, fromAddress).Return(uint64(0), nil).Once()
ethClient.On("NonceAt", mock.Anything, fromAddress, mock.Anything).Return(uint64(0), nil).Once()
nonceTracker := txmgr.NewNonceTracker(logger.Test(t), txStore, txmgr.NewEvmTxmClient(ethClient, nil))
eb := NewTestEthBroadcaster(t, txStore, ethClient, ethKeyStore, cfg, evmcfg, checkerFactory, false, nonceTracker)

Expand Down Expand Up @@ -648,7 +648,7 @@ func TestEthBroadcaster_ProcessUnstartedEthTxs_OptimisticLockingOnEthTx(t *testi
close(chStartEstimate)
<-chBlock
}).Once()
ethClient.On("PendingNonceAt", mock.Anything, fromAddress).Return(uint64(0), nil)
ethClient.On("NonceAt", mock.Anything, fromAddress, mock.Anything).Return(uint64(0), nil).Once()
txmClient := txmgr.NewEvmTxmClient(ethClient, nil)
eb := txmgr.NewEvmBroadcaster(
txStore,
Expand Down Expand Up @@ -706,7 +706,7 @@ func TestEthBroadcaster_ProcessUnstartedEthTxs_Success_WithMultiplier(t *testing
evmcfg := evmtest.NewChainScopedConfig(t, cfg)

ethClient := testutils.NewEthClientMockWithDefaultChain(t)
ethClient.On("PendingNonceAt", mock.Anything, fromAddress).Return(uint64(0), nil).Once()
ethClient.On("NonceAt", mock.Anything, fromAddress, mock.Anything).Return(uint64(0), nil).Once()
nonceTracker := txmgr.NewNonceTracker(logger.Test(t), txStore, txmgr.NewEvmTxmClient(ethClient, nil))
eb := NewTestEthBroadcaster(t, txStore, ethClient, ethKeyStore, cfg, evmcfg, &testCheckerFactory{}, false, nonceTracker)

Expand Down Expand Up @@ -788,7 +788,7 @@ func TestEthBroadcaster_ProcessUnstartedEthTxs_ResumingFromCrash(t *testing.T) {
_, fromAddress := cltest.RandomKey{Nonce: nextNonce.Int64()}.MustInsertWithState(t, ethKeyStore)

ethClient := testutils.NewEthClientMockWithDefaultChain(t)
ethClient.On("PendingNonceAt", mock.Anything, fromAddress).Return(uint64(0), nil).Once()
ethClient.On("NonceAt", mock.Anything, fromAddress, mock.Anything).Return(uint64(0), nil).Once()
nonceTracker := txmgr.NewNonceTracker(logger.Test(t), txStore, txmgr.NewEvmTxmClient(ethClient, nil))
eb := NewTestEthBroadcaster(t, txStore, ethClient, ethKeyStore, cfg, evmcfg, &testCheckerFactory{}, false, nonceTracker)

Expand Down Expand Up @@ -827,7 +827,7 @@ func TestEthBroadcaster_ProcessUnstartedEthTxs_ResumingFromCrash(t *testing.T) {
_, fromAddress := cltest.RandomKey{Nonce: nextNonce.Int64()}.MustInsertWithState(t, ethKeyStore)

ethClient := testutils.NewEthClientMockWithDefaultChain(t)
ethClient.On("PendingNonceAt", mock.Anything, fromAddress).Return(uint64(0), nil).Once()
ethClient.On("NonceAt", mock.Anything, fromAddress, mock.Anything).Return(uint64(0), nil).Once()
nonceTracker := txmgr.NewNonceTracker(logger.Test(t), txStore, txmgr.NewEvmTxmClient(ethClient, nil))
eb := NewTestEthBroadcaster(t, txStore, ethClient, ethKeyStore, cfg, evmcfg, &testCheckerFactory{}, false, nonceTracker)

Expand Down Expand Up @@ -864,7 +864,7 @@ func TestEthBroadcaster_ProcessUnstartedEthTxs_ResumingFromCrash(t *testing.T) {
_, fromAddress := cltest.RandomKey{Nonce: nextNonce.Int64()}.MustInsertWithState(t, ethKeyStore)

ethClient := testutils.NewEthClientMockWithDefaultChain(t)
ethClient.On("PendingNonceAt", mock.Anything, fromAddress).Return(uint64(0), nil).Once()
ethClient.On("NonceAt", mock.Anything, fromAddress, mock.Anything).Return(uint64(0), nil).Once()
nonceTracker := txmgr.NewNonceTracker(logger.Test(t), txStore, txmgr.NewEvmTxmClient(ethClient, nil))
eb := NewTestEthBroadcaster(t, txStore, ethClient, ethKeyStore, cfg, evmcfg, &testCheckerFactory{}, false, nonceTracker)

Expand Down Expand Up @@ -900,7 +900,7 @@ func TestEthBroadcaster_ProcessUnstartedEthTxs_ResumingFromCrash(t *testing.T) {
_, fromAddress := cltest.RandomKey{Nonce: nextNonce.Int64()}.MustInsertWithState(t, ethKeyStore)

ethClient := testutils.NewEthClientMockWithDefaultChain(t)
ethClient.On("PendingNonceAt", mock.Anything, fromAddress).Return(uint64(0), nil).Once()
ethClient.On("NonceAt", mock.Anything, fromAddress, mock.Anything).Return(uint64(0), nil).Once()
nonceTracker := txmgr.NewNonceTracker(logger.Test(t), txStore, txmgr.NewEvmTxmClient(ethClient, nil))
eb := NewTestEthBroadcaster(t, txStore, ethClient, ethKeyStore, cfg, evmcfg, &testCheckerFactory{}, false, nonceTracker)

Expand Down Expand Up @@ -938,7 +938,7 @@ func TestEthBroadcaster_ProcessUnstartedEthTxs_ResumingFromCrash(t *testing.T) {
_, fromAddress := cltest.RandomKey{Nonce: nextNonce.Int64()}.MustInsertWithState(t, ethKeyStore)

ethClient := testutils.NewEthClientMockWithDefaultChain(t)
ethClient.On("PendingNonceAt", mock.Anything, fromAddress).Return(uint64(0), nil).Once()
ethClient.On("NonceAt", mock.Anything, fromAddress, mock.Anything).Return(uint64(0), nil).Once()
nonceTracker := txmgr.NewNonceTracker(logger.Test(t), txStore, txmgr.NewEvmTxmClient(ethClient, nil))
eb := NewTestEthBroadcaster(t, txStore, ethClient, ethKeyStore, cfg, evmcfg, &testCheckerFactory{}, false, nonceTracker)

Expand Down Expand Up @@ -980,7 +980,7 @@ func TestEthBroadcaster_ProcessUnstartedEthTxs_ResumingFromCrash(t *testing.T) {
evmcfg := evmtest.NewChainScopedConfig(t, cfg)

ethClient := testutils.NewEthClientMockWithDefaultChain(t)
ethClient.On("PendingNonceAt", mock.Anything, fromAddress).Return(uint64(0), nil).Once()
ethClient.On("NonceAt", mock.Anything, fromAddress, mock.Anything).Return(uint64(0), nil).Once()
nonceTracker := txmgr.NewNonceTracker(logger.Test(t), txStore, txmgr.NewEvmTxmClient(ethClient, nil))
eb := NewTestEthBroadcaster(t, txStore, ethClient, ethKeyStore, cfg, evmcfg, &testCheckerFactory{}, false, nonceTracker)

Expand Down Expand Up @@ -1044,7 +1044,7 @@ func TestEthBroadcaster_ProcessUnstartedEthTxs_Errors(t *testing.T) {

evmcfg := evmtest.NewChainScopedConfig(t, cfg)
ethClient := testutils.NewEthClientMockWithDefaultChain(t)
ethClient.On("PendingNonceAt", mock.Anything, fromAddress).Return(uint64(0), nil).Once()
ethClient.On("NonceAt", mock.Anything, fromAddress, mock.Anything).Return(uint64(0), nil).Once()
lggr := logger.Test(t)
txmClient := txmgr.NewEvmTxmClient(ethClient, nil)
nonceTracker := txmgr.NewNonceTracker(lggr, txStore, txmClient)
Expand Down Expand Up @@ -1597,7 +1597,7 @@ func TestEthBroadcaster_ProcessUnstartedEthTxs_Errors(t *testing.T) {
c.EVM[0].GasEstimator.BumpPercent = ptr[uint16](0)
}))
localNextNonce := getLocalNextNonce(t, nonceTracker, fromAddress)
ethClient.On("PendingNonceAt", mock.Anything, fromAddress).Return(localNextNonce, nil).Once()
ethClient.On("NonceAt", mock.Anything, fromAddress, mock.Anything).Return(localNextNonce, nil).Once()
eb2 := NewTestEthBroadcaster(t, txStore, ethClient, ethKeyStore, cfg, evmcfg2, &testCheckerFactory{}, false, nonceTracker)
mustCreateUnstartedTx(t, txStore, fromAddress, toAddress, encodedPayload, gasLimit, value, testutils.FixtureChainID)
underpricedError := "transaction underpriced"
Expand Down Expand Up @@ -1629,7 +1629,7 @@ func TestEthBroadcaster_ProcessUnstartedEthTxs_Errors(t *testing.T) {
c.EVM[0].GasEstimator.TipCapDefault = gasTipCapDefault
}))
localNextNonce := getLocalNextNonce(t, nonceTracker, fromAddress)
ethClient.On("PendingNonceAt", mock.Anything, fromAddress).Return(localNextNonce, nil).Once()
ethClient.On("NonceAt", mock.Anything, fromAddress, mock.Anything).Return(localNextNonce, nil).Once()
eb2 := NewTestEthBroadcaster(t, txStore, ethClient, ethKeyStore, cfg, evmcfg2, &testCheckerFactory{}, false, nonceTracker)

// Second was underpriced but above minimum
Expand Down Expand Up @@ -1672,7 +1672,7 @@ func TestEthBroadcaster_ProcessUnstartedEthTxs_GasEstimationError(t *testing.T)

config := evmtest.NewChainScopedConfig(t, cfg)
ethClient := testutils.NewEthClientMockWithDefaultChain(t)
ethClient.On("PendingNonceAt", mock.Anything, fromAddress).Return(uint64(0), nil).Once()
ethClient.On("NonceAt", mock.Anything, fromAddress, mock.Anything).Return(uint64(0), nil).Once()
lggr := logger.Test(t)
txmClient := txmgr.NewEvmTxmClient(ethClient, nil)
nonceTracker := txmgr.NewNonceTracker(lggr, txStore, txmClient)
Expand Down Expand Up @@ -1741,7 +1741,7 @@ func TestEthBroadcaster_ProcessUnstartedEthTxs_KeystoreErrors(t *testing.T) {
kst := ksmocks.NewEth(t)
addresses := []gethCommon.Address{fromAddress}
kst.On("EnabledAddressesForChain", mock.Anything, testutils.FixtureChainID).Return(addresses, nil).Once()
ethClient.On("PendingNonceAt", mock.Anything, fromAddress).Return(uint64(0), nil).Once()
ethClient.On("NonceAt", mock.Anything, fromAddress, mock.Anything).Return(uint64(0), nil).Once()
lggr := logger.Test(t)
nonceTracker := txmgr.NewNonceTracker(lggr, txStore, txmgr.NewEvmTxmClient(ethClient, nil))
eb := NewTestEthBroadcaster(t, txStore, ethClient, kst, cfg, evmcfg, &testCheckerFactory{}, false, nonceTracker)
Expand Down Expand Up @@ -1829,7 +1829,7 @@ func TestEthBroadcaster_SyncNonce(t *testing.T) {
kst := ksmocks.NewEth(t)
addresses := []gethCommon.Address{fromAddress}
kst.On("EnabledAddressesForChain", mock.Anything, testutils.FixtureChainID).Return(addresses, nil).Once()
ethClient.On("PendingNonceAt", mock.Anything, fromAddress).Return(uint64(0), nil).Once()
ethClient.On("NonceAt", mock.Anything, fromAddress, mock.Anything).Return(uint64(0), nil).Once()
txmClient := txmgr.NewEvmTxmClient(ethClient, nil)
eb := txmgr.NewEvmBroadcaster(txStore, txmClient, evmTxmCfg, txmgr.NewEvmTxmFeeConfig(ge), evmcfg.EVM().Transactions(), cfg.Database().Listener(), kst, txBuilder, lggr, checkerFactory, false, "")
err := eb.Start(ctx)
Expand Down
11 changes: 8 additions & 3 deletions core/chains/evm/txmgr/nonce_tracker.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ type NonceTrackerTxStore interface {
type NonceTrackerClient interface {
ConfiguredChainID() *big.Int
PendingSequenceAt(context.Context, common.Address) (evmtypes.Nonce, error)
SequenceAt(ctx context.Context, addr common.Address, blockNum *big.Int) (evmtypes.Nonce, error)
}

type nonceTracker struct {
Expand Down Expand Up @@ -69,9 +70,13 @@ func (s *nonceTracker) getSequenceForAddr(ctx context.Context, address common.Ad
seq++
return seq, nil
}
// Look for nonce on-chain if no tx found for address in TxStore or if error occurred
// Returns the nonce that should be used for the next transaction so no need to increment
nonce, err := s.client.PendingSequenceAt(ctx, address)
// Look for nonce on-chain if no tx found for address in TxStore or if error occurred.
// We use the mined transaction count (SequenceAt) to determine the next nonce to use instead of the pending transaction count (PendingSequenceAt).
// This allows the TXM to broadcast and track transactions for nonces starting from the last mined transaction preventing the perpetuation of a potential nonce gap.
// NOTE: Any transactions already in the mempool would be attempted to be overwritten but an older transaction can get included before being overwritten.
// Such could be the case if there was a nonce gap that gets filled unblocking the transactions.
// If that occurs, there could be short term noise in the logs surfacing that a transaction expired without ever getting a receipt.
nonce, err := s.client.SequenceAt(ctx, address, nil)
if err == nil {
return nonce, nil
}
Expand Down
12 changes: 6 additions & 6 deletions core/chains/evm/txmgr/nonce_tracker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ func TestNonceTracker_LoadSequenceMap(t *testing.T) {

randNonce1 := testutils.NewRandomPositiveInt64()
randNonce2 := testutils.NewRandomPositiveInt64()
client.On("PendingNonceAt", mock.Anything, addr1).Return(uint64(randNonce1), nil).Once()
client.On("PendingNonceAt", mock.Anything, addr2).Return(uint64(randNonce2), nil).Once()
client.On("NonceAt", mock.Anything, addr1, mock.Anything).Return(uint64(randNonce1), nil).Once() //nolint:gosec // Disable G115: randNonce1 always positive
client.On("NonceAt", mock.Anything, addr2, mock.Anything).Return(uint64(randNonce2), nil).Once() //nolint:gosec // Disable G115: randNonce2 always positive

nonceTracker.LoadNextSequences(ctx, enabledAddresses)
seq, err := nonceTracker.GetNextSequence(ctx, addr1)
Expand Down Expand Up @@ -205,7 +205,7 @@ func TestNonceTracker_GetNextSequence(t *testing.T) {
t.Run("fails to get sequence if address is enabled, doesn't exist in map, and getSequenceForAddr fails", func(t *testing.T) {
enabledAddresses := []common.Address{addr}
txStore.On("FindLatestSequence", mock.Anything, addr, chainID).Return(types.Nonce(0), errors.New("no rows")).Twice()
client.On("PendingNonceAt", mock.Anything, addr).Return(uint64(0), errors.New("RPC unavailable")).Twice()
client.On("NonceAt", mock.Anything, addr, mock.Anything).Return(uint64(0), errors.New("RPC unavailable")).Twice()
nonceTracker.LoadNextSequences(ctx, enabledAddresses)

_, err := nonceTracker.GetNextSequence(ctx, addr)
Expand All @@ -217,7 +217,7 @@ func TestNonceTracker_GetNextSequence(t *testing.T) {
txStoreNonce := 4
enabledAddresses := []common.Address{addr}
txStore.On("FindLatestSequence", mock.Anything, addr, chainID).Return(types.Nonce(0), errors.New("no rows")).Once()
client.On("PendingNonceAt", mock.Anything, addr).Return(uint64(0), errors.New("RPC unavailable")).Once()
client.On("NonceAt", mock.Anything, addr, mock.Anything).Return(uint64(0), errors.New("RPC unavailable")).Once()
nonceTracker.LoadNextSequences(ctx, enabledAddresses)

txStore.On("FindLatestSequence", mock.Anything, addr, chainID).Return(types.Nonce(txStoreNonce), nil).Once()
Expand Down Expand Up @@ -272,8 +272,8 @@ func Test_SetNonceAfterInit(t *testing.T) {
addr := common.HexToAddress("0xd5e099c71b797516c10ed0f0d895f429c2781142")
enabledAddresses := []common.Address{addr}
randNonce := testutils.NewRandomPositiveInt64()
client.On("PendingNonceAt", mock.Anything, addr).Return(uint64(0), errors.New("failed to retrieve nonce at startup")).Once()
client.On("PendingNonceAt", mock.Anything, addr).Return(uint64(randNonce), nil).Once()
client.On("NonceAt", mock.Anything, addr, mock.Anything).Return(uint64(0), errors.New("failed to retrieve nonce at startup")).Once()
client.On("NonceAt", mock.Anything, addr, mock.Anything).Return(uint64(randNonce), nil).Once() //nolint:gosec // Disable G115: randNonce always positive
nonceTracker.LoadNextSequences(ctx, enabledAddresses)

nonce, err := nonceTracker.GetNextSequence(ctx, addr)
Expand Down
10 changes: 5 additions & 5 deletions core/cmd/eth_keys_commands_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ func TestShell_ListETHKeys(t *testing.T) {
ethClient := newEthMock(t)
ethClient.On("BalanceAt", mock.Anything, mock.Anything, mock.Anything).Return(big.NewInt(42), nil)
ethClient.On("LINKBalance", mock.Anything, mock.Anything, mock.Anything).Return(commonassets.NewLinkFromJuels(13), nil)
ethClient.On("PendingNonceAt", mock.Anything, mock.Anything).Return(uint64(0), nil)
ethClient.On("NonceAt", mock.Anything, mock.Anything, mock.Anything).Return(uint64(0), nil).Once()
app := startNewApplicationV2(t, func(c *chainlink.Config, s *chainlink.Secrets) {
c.EVM[0].Enabled = ptr(true)
c.EVM[0].NonceAutoSync = ptr(false)
Expand All @@ -118,7 +118,7 @@ func TestShell_ListETHKeys_Error(t *testing.T) {
ethClient := newEthMock(t)
ethClient.On("BalanceAt", mock.Anything, mock.Anything, mock.Anything).Return(nil, errors.New("fake error"))
ethClient.On("LINKBalance", mock.Anything, mock.Anything, mock.Anything).Return(nil, errors.New("fake error"))
ethClient.On("PendingNonceAt", mock.Anything, mock.Anything).Return(uint64(0), nil)
ethClient.On("NonceAt", mock.Anything, mock.Anything, mock.Anything).Return(uint64(0), nil).Once()
app := startNewApplicationV2(t, func(c *chainlink.Config, s *chainlink.Secrets) {
c.EVM[0].Enabled = ptr(true)
c.EVM[0].NonceAutoSync = ptr(false)
Expand Down Expand Up @@ -172,7 +172,7 @@ func TestShell_CreateETHKey(t *testing.T) {
ethClient := newEthMock(t)
ethClient.On("BalanceAt", mock.Anything, mock.Anything, mock.Anything).Return(big.NewInt(42), nil)
ethClient.On("LINKBalance", mock.Anything, mock.Anything, mock.Anything).Return(commonassets.NewLinkFromJuels(42), nil)
ethClient.On("PendingNonceAt", mock.Anything, mock.Anything).Return(uint64(0), nil)
ethClient.On("NonceAt", mock.Anything, mock.Anything, mock.Anything).Return(uint64(0), nil).Once()

app := startNewApplicationV2(t, func(c *chainlink.Config, s *chainlink.Secrets) {
c.EVM[0].Enabled = ptr(true)
Expand Down Expand Up @@ -247,7 +247,7 @@ func TestShell_ImportExportETHKey_NoChains(t *testing.T) {
ethClient := newEthMock(t)
ethClient.On("BalanceAt", mock.Anything, mock.Anything, mock.Anything).Return(big.NewInt(42), nil)
ethClient.On("LINKBalance", mock.Anything, mock.Anything, mock.Anything).Return(commonassets.NewLinkFromJuels(42), nil)
ethClient.On("PendingNonceAt", mock.Anything, mock.Anything).Return(uint64(0), nil)
ethClient.On("NonceAt", mock.Anything, mock.Anything, mock.Anything).Return(uint64(0), nil).Once()
app := startNewApplicationV2(t, func(c *chainlink.Config, s *chainlink.Secrets) {
c.EVM[0].Enabled = ptr(true)
c.EVM[0].NonceAutoSync = ptr(false)
Expand Down Expand Up @@ -351,7 +351,7 @@ func TestShell_ImportExportETHKey_WithChains(t *testing.T) {
t.Cleanup(func() { deleteKeyExportFile(t) })

ethClient := newEthMock(t)
ethClient.On("PendingNonceAt", mock.Anything, mock.Anything).Return(uint64(0), nil)
ethClient.On("NonceAt", mock.Anything, mock.Anything, mock.Anything).Return(uint64(0), nil).Once()
app := startNewApplicationV2(t, func(c *chainlink.Config, s *chainlink.Secrets) {
c.EVM[0].Enabled = ptr(true)
c.EVM[0].NonceAutoSync = ptr(false)
Expand Down
Loading

0 comments on commit 1738332

Please sign in to comment.