Skip to content

Commit 2b1648e

Browse files
author
Ilan
committed
Merge branch 'develop' into zk-testing
2 parents 6d1b817 + df94d52 commit 2b1648e

File tree

75 files changed

+1923
-975
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+1923
-975
lines changed

.changeset/chatty-toes-compare.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"chainlink": patch
3+
---
4+
5+
#updated Bump chainlink-solana
6+
#updated Bump chainlink-ccip

.github/actions/build-chainlink-image/action.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ inputs:
2121
check_image_exists:
2222
description: "Check if the image exists in ECR before building"
2323
required: false
24-
default: 'false'
24+
default: "false"
2525

2626
runs:
2727
using: composite
@@ -37,7 +37,7 @@ runs:
3737
AWS_ROLE_TO_ASSUME: ${{ inputs.AWS_ROLE_TO_ASSUME }}
3838
- name: Build Image
3939
if: steps.check-image.outputs.exists != 'true'
40-
uses: smartcontractkit/.github/actions/ctf-build-image@1a26fe378d7ebdc34ab1fe31ec4a6d1c376199f8 # ctf-build-image@0.0.0
40+
uses: smartcontractkit/.github/actions/ctf-build-image@ctf-build-image/0.2.0
4141
with:
4242
cl_repo: smartcontractkit/chainlink
4343
cl_ref: ${{ inputs.git_commit_sha }}

.github/workflows/build-publish.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,11 @@ jobs:
5858
with:
5959
tag: ${{ github.ref_name }}
6060
assert: true
61+
- name: Fail if git tag is not from allowed branches
62+
uses: smartcontractkit/.github/actions/guard-tag-from-branch@01d931b0455a754d12e7143cc54a5a3521a8f6f6 # guard-tag-from-branch@0.1.3
63+
with:
64+
tag: ${{ github.ref_name }}
65+
branch-regex: '^(develop|release\/.*)'
6166

6267
build-sign-publish-chainlink:
6368
needs: [checks]

.mockery.yaml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,6 @@ packages:
4545
LogPoller:
4646
github.com/smartcontractkit/chainlink/v2/core/chains/evm/txmgr:
4747
interfaces:
48-
ChainConfig:
49-
config:
50-
mockname: Config
51-
filename: config.go
5248
EvmTxStore:
5349
github.com/smartcontractkit/chainlink/v2/core/chains/legacyevm:
5450
interfaces:

common/txmgr/mocks/utils.go

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
package mocks
2+
3+
import (
4+
"math/big"
5+
"testing"
6+
7+
"github.com/ethereum/go-ethereum/common"
8+
9+
"github.com/smartcontractkit/chainlink-evm/pkg/gas"
10+
"github.com/smartcontractkit/chainlink-evm/pkg/types"
11+
)
12+
13+
type MockEvmTxManager = TxManager[*big.Int, *types.Head, common.Address, common.Hash, common.Hash, types.Nonce, gas.EvmFee]
14+
15+
func NewMockEvmTxManager(t *testing.T) *MockEvmTxManager {
16+
return NewTxManager[*big.Int, *types.Head, common.Address, common.Hash, common.Hash, types.Nonce, gas.EvmFee](t)
17+
}

core/chains/evm/txmgr/broadcaster_benchmark_test.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,11 @@ import (
99

1010
gethCommon "github.com/ethereum/go-ethereum/common"
1111
"github.com/jmoiron/sqlx"
12+
1213
"github.com/smartcontractkit/chainlink-evm/pkg/keys"
1314
"github.com/smartcontractkit/chainlink-evm/pkg/keys/keystest"
15+
"github.com/smartcontractkit/chainlink/v2/core/chains/evm/txmgr/txmgrtest"
16+
1417
"github.com/stretchr/testify/mock"
1518
"github.com/stretchr/testify/require"
1619

@@ -25,7 +28,6 @@ import (
2528
"github.com/smartcontractkit/chainlink-evm/pkg/testutils"
2629

2730
"github.com/smartcontractkit/chainlink/v2/core/chains/evm/txmgr"
28-
"github.com/smartcontractkit/chainlink/v2/core/internal/cltest"
2931
)
3032

3133
// happy path
@@ -34,7 +36,7 @@ func BenchmarkEthBroadcaster_ProcessUnstartedEthTxs_Success(b *testing.B) {
3436
ctx := tests.Context(b)
3537

3638
ethClient := clienttest.NewClientWithDefaultChainID(b)
37-
txStore := cltest.NewTestTxStore(b, db)
39+
txStore := txmgrtest.NewTestTxStore(b, db)
3840
memKeystore := keystest.NewMemoryChainStore()
3941
ethKeyStore := keys.NewChainStore(memKeystore, ethClient.ConfiguredChainID())
4042
fromAddress := memKeystore.MustCreate(b)

core/chains/evm/txmgr/broadcaster_test.go

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ import (
2929
"github.com/smartcontractkit/chainlink-common/pkg/sqlutil"
3030
commonutils "github.com/smartcontractkit/chainlink-common/pkg/utils"
3131
"github.com/smartcontractkit/chainlink-common/pkg/utils/tests"
32+
"github.com/smartcontractkit/chainlink/v2/core/chains/evm/txmgr/txmgrtest"
3233

3334
"github.com/smartcontractkit/chainlink-framework/chains/fees"
3435
txmgrcommon "github.com/smartcontractkit/chainlink-framework/chains/txmgr"
@@ -49,7 +50,6 @@ import (
4950
"github.com/smartcontractkit/chainlink-evm/pkg/testutils"
5051
evmtypes "github.com/smartcontractkit/chainlink-evm/pkg/types"
5152
"github.com/smartcontractkit/chainlink/v2/core/chains/evm/txmgr"
52-
"github.com/smartcontractkit/chainlink/v2/core/internal/cltest"
5353
)
5454

5555
var dbListenerCfg txmgr.ListenerConfig = testListenerConfig{}
@@ -100,7 +100,7 @@ func NewTestEthBroadcaster(
100100

101101
func TestEthBroadcaster_Lifecycle(t *testing.T) {
102102
db := testutils.NewIndependentSqlxDB(t)
103-
txStore := cltest.NewTestTxStore(t, db)
103+
txStore := txmgrtest.NewTestTxStore(t, db)
104104
evmcfg := configtest.NewChainScopedConfig(t, nil)
105105
ethClient := clienttest.NewClientWithDefaultChainID(t)
106106
memKS := keystest.NewMemoryChainStore()
@@ -163,7 +163,7 @@ func TestEthBroadcaster_Lifecycle(t *testing.T) {
163163
// Failure to load next sequnce map should not fail Broadcaster startup
164164
func TestEthBroadcaster_LoadNextSequenceMapFailure_StartupSuccess(t *testing.T) {
165165
db := testutils.NewSqlxDB(t)
166-
txStore := cltest.NewTestTxStore(t, db)
166+
txStore := txmgrtest.NewTestTxStore(t, db)
167167
evmcfg := configtest.NewChainScopedConfig(t, nil)
168168
ethClient := clienttest.NewClientWithDefaultChainID(t)
169169
memKS := keystest.NewMemoryChainStore()
@@ -201,7 +201,7 @@ func TestEthBroadcaster_LoadNextSequenceMapFailure_StartupSuccess(t *testing.T)
201201
func TestEthBroadcaster_ProcessUnstartedEthTxs_Success(t *testing.T) {
202202
db := testutils.NewSqlxDB(t)
203203
ctx := t.Context()
204-
txStore := cltest.NewTestTxStore(t, db)
204+
txStore := txmgrtest.NewTestTxStore(t, db)
205205

206206
memKS := keystest.NewMemoryChainStore()
207207
fromAddress := memKS.MustCreate(t)
@@ -574,7 +574,7 @@ func TestEthBroadcaster_ProcessUnstartedEthTxs_Success(t *testing.T) {
574574
func TestEthBroadcaster_TransmitChecking(t *testing.T) {
575575
db := testutils.NewSqlxDB(t)
576576
ctx := t.Context()
577-
txStore := cltest.NewTestTxStore(t, db)
577+
txStore := txmgrtest.NewTestTxStore(t, db)
578578
memKS := keystest.NewMemoryChainStore()
579579
fromAddress := memKS.MustCreate(t)
580580
ethClient := clienttest.NewClientWithDefaultChainID(t)
@@ -657,7 +657,7 @@ func TestEthBroadcaster_TransmitChecking(t *testing.T) {
657657
func TestEthBroadcaster_ProcessUnstartedEthTxs_OptimisticLockingOnEthTx(t *testing.T) {
658658
// non-transactional DB needed because we deliberately test for FK violation
659659
db := testutils.NewIndependentSqlxDB(t)
660-
txStore := cltest.NewTestTxStore(t, db)
660+
txStore := txmgrtest.NewTestTxStore(t, db)
661661
ccfg := configtest.NewChainScopedConfig(t, nil)
662662
evmcfg := txmgr.NewEvmTxmConfig(ccfg.EVM())
663663
ethClient := clienttest.NewClientWithDefaultChainID(t)
@@ -722,7 +722,7 @@ func TestEthBroadcaster_ProcessUnstartedEthTxs_OptimisticLockingOnEthTx(t *testi
722722

723723
func TestEthBroadcaster_ProcessUnstartedEthTxs_Success_WithMultiplier(t *testing.T) {
724724
db := testutils.NewSqlxDB(t)
725-
txStore := cltest.NewTestTxStore(t, db)
725+
txStore := txmgrtest.NewTestTxStore(t, db)
726726

727727
memKS := keystest.NewMemoryChainStore()
728728
fromAddress := memKS.MustCreate(t)
@@ -774,7 +774,7 @@ func TestEthBroadcaster_ProcessUnstartedEthTxs_ResumingFromCrash(t *testing.T) {
774774

775775
t.Run("cannot be more than one transaction per address in an unfinished state", func(t *testing.T) {
776776
db := testutils.NewSqlxDB(t)
777-
txStore := cltest.NewTestTxStore(t, db)
777+
txStore := txmgrtest.NewTestTxStore(t, db)
778778
fromAddress := testutils.NewAddress()
779779

780780
firstInProgress := txmgr.Tx{
@@ -807,7 +807,7 @@ func TestEthBroadcaster_ProcessUnstartedEthTxs_ResumingFromCrash(t *testing.T) {
807807

808808
t.Run("previous run assigned nonce but never broadcast", func(t *testing.T) {
809809
db := testutils.NewSqlxDB(t)
810-
txStore := cltest.NewTestTxStore(t, db)
810+
txStore := txmgrtest.NewTestTxStore(t, db)
811811
evmcfg := configtest.NewChainScopedConfig(t, nil)
812812
memKS := keystest.NewMemoryChainStore()
813813
fromAddress := memKS.MustCreate(t)
@@ -847,7 +847,7 @@ func TestEthBroadcaster_ProcessUnstartedEthTxs_ResumingFromCrash(t *testing.T) {
847847

848848
t.Run("previous run assigned nonce and broadcast but it fatally errored before we could save", func(t *testing.T) {
849849
db := testutils.NewSqlxDB(t)
850-
txStore := cltest.NewTestTxStore(t, db)
850+
txStore := txmgrtest.NewTestTxStore(t, db)
851851
evmcfg := configtest.NewChainScopedConfig(t, nil)
852852
memKS := keystest.NewMemoryChainStore()
853853
fromAddress := memKS.MustCreate(t)
@@ -885,7 +885,7 @@ func TestEthBroadcaster_ProcessUnstartedEthTxs_ResumingFromCrash(t *testing.T) {
885885

886886
t.Run("previous run assigned nonce and broadcast and is now in mempool", func(t *testing.T) {
887887
db := testutils.NewSqlxDB(t)
888-
txStore := cltest.NewTestTxStore(t, db)
888+
txStore := txmgrtest.NewTestTxStore(t, db)
889889
evmcfg := configtest.NewChainScopedConfig(t, nil)
890890
memKS := keystest.NewMemoryChainStore()
891891
fromAddress := memKS.MustCreate(t)
@@ -922,7 +922,7 @@ func TestEthBroadcaster_ProcessUnstartedEthTxs_ResumingFromCrash(t *testing.T) {
922922

923923
t.Run("previous run assigned nonce and broadcast and now the transaction has been confirmed", func(t *testing.T) {
924924
db := testutils.NewSqlxDB(t)
925-
txStore := cltest.NewTestTxStore(t, db)
925+
txStore := txmgrtest.NewTestTxStore(t, db)
926926
evmcfg := configtest.NewChainScopedConfig(t, nil)
927927
memKS := keystest.NewMemoryChainStore()
928928
fromAddress := memKS.MustCreate(t)
@@ -960,7 +960,7 @@ func TestEthBroadcaster_ProcessUnstartedEthTxs_ResumingFromCrash(t *testing.T) {
960960
t.Run("previous run assigned nonce and then failed to reach node for some reason and node is still down", func(t *testing.T) {
961961
failedToReachNodeError := context.DeadlineExceeded
962962
db := testutils.NewSqlxDB(t)
963-
txStore := cltest.NewTestTxStore(t, db)
963+
txStore := txmgrtest.NewTestTxStore(t, db)
964964
evmcfg := configtest.NewChainScopedConfig(t, nil)
965965
memKS := keystest.NewMemoryChainStore()
966966
fromAddress := memKS.MustCreate(t)
@@ -997,7 +997,7 @@ func TestEthBroadcaster_ProcessUnstartedEthTxs_ResumingFromCrash(t *testing.T) {
997997

998998
t.Run("previous run assigned nonce and broadcast transaction then crashed and rebooted with a different configured gas price", func(t *testing.T) {
999999
db := testutils.NewSqlxDB(t)
1000-
txStore := cltest.NewTestTxStore(t, db)
1000+
txStore := txmgrtest.NewTestTxStore(t, db)
10011001

10021002
memKS := keystest.NewMemoryChainStore()
10031003
fromAddress := memKS.MustCreate(t)
@@ -1065,7 +1065,7 @@ func TestEthBroadcaster_ProcessUnstartedEthTxs_Errors(t *testing.T) {
10651065
encodedPayload := []byte{0, 1}
10661066

10671067
db := testutils.NewSqlxDB(t)
1068-
txStore := cltest.NewTestTxStore(t, db)
1068+
txStore := txmgrtest.NewTestTxStore(t, db)
10691069

10701070
memKS := keystest.NewMemoryChainStore()
10711071
fromAddress := memKS.MustCreate(t)
@@ -1692,7 +1692,7 @@ func TestEthBroadcaster_ProcessUnstartedEthTxs_GasEstimationError(t *testing.T)
16921692
encodedPayload := []byte{0, 1}
16931693

16941694
db := testutils.NewSqlxDB(t)
1695-
txStore := cltest.NewTestTxStore(t, db)
1695+
txStore := txmgrtest.NewTestTxStore(t, db)
16961696

16971697
memKS := keystest.NewMemoryChainStore()
16981698
fromAddress := memKS.MustCreate(t)
@@ -1763,7 +1763,7 @@ func TestEthBroadcaster_ProcessUnstartedEthTxs_KeystoreErrors(t *testing.T) {
17631763
localNonce := 0
17641764

17651765
db := testutils.NewSqlxDB(t)
1766-
txStore := cltest.NewTestTxStore(t, db)
1766+
txStore := txmgrtest.NewTestTxStore(t, db)
17671767

17681768
fromAddress := keystest.NewMemoryChainStore().MustCreate(t)
17691769
kst := &keystest.FakeChainStore{
@@ -1814,7 +1814,7 @@ func TestEthBroadcaster_Trigger(t *testing.T) {
18141814
// Simple sanity check to make sure it doesn't block
18151815
db := testutils.NewSqlxDB(t)
18161816

1817-
txStore := cltest.NewTestTxStore(t, db)
1817+
txStore := txmgrtest.NewTestTxStore(t, db)
18181818
evmcfg := configtest.NewChainScopedConfig(t, nil)
18191819
ethKeyStore := &keystest.FakeChainStore{}
18201820
ethClient := clienttest.NewClientWithDefaultChainID(t)
@@ -1836,7 +1836,7 @@ func TestEthBroadcaster_SyncNonce(t *testing.T) {
18361836
c.NonceAutoSync = ptr(true)
18371837
})
18381838
evmTxmCfg := txmgr.NewEvmTxmConfig(evmcfg.EVM())
1839-
txStore := cltest.NewTestTxStore(t, db)
1839+
txStore := txmgrtest.NewTestTxStore(t, db)
18401840

18411841
memKS := keystest.NewMemoryChainStore()
18421842
fromAddress := memKS.MustCreate(t)
@@ -1871,7 +1871,7 @@ func TestEthBroadcaster_NonceTracker_InProgressTx(t *testing.T) {
18711871
t.Parallel()
18721872

18731873
db := testutils.NewSqlxDB(t)
1874-
txStore := cltest.NewTestTxStore(t, db)
1874+
txStore := txmgrtest.NewTestTxStore(t, db)
18751875
memKS := keystest.NewMemoryChainStore()
18761876
fromAddress := memKS.MustCreate(t)
18771877
ethKeyStore := keys.NewChainStore(memKS, big.NewInt(0))
@@ -1910,7 +1910,7 @@ func TestEthBroadcaster_HederaBroadcastValidation(t *testing.T) {
19101910
t.Parallel()
19111911

19121912
db := testutils.NewSqlxDB(t)
1913-
txStore := cltest.NewTestTxStore(t, db)
1913+
txStore := txmgrtest.NewTestTxStore(t, db)
19141914
memKS := keystest.NewMemoryChainStore()
19151915
ethKeyStore := keys.NewChainStore(memKS, big.NewInt(0))
19161916
evmcfg := configtest.NewChainScopedConfig(t, nil)

core/chains/evm/txmgr/confirmer_benchmark_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@ import (
1313
"github.com/smartcontractkit/chainlink-evm/pkg/testutils"
1414
evmtypes "github.com/smartcontractkit/chainlink-evm/pkg/types"
1515
txmgrcommon "github.com/smartcontractkit/chainlink-framework/chains/txmgr"
16+
"github.com/smartcontractkit/chainlink/v2/core/chains/evm/txmgr/txmgrtest"
17+
1618
"github.com/stretchr/testify/mock"
1719
"github.com/stretchr/testify/require"
18-
19-
"github.com/smartcontractkit/chainlink/v2/core/internal/cltest"
2020
)
2121

2222
func BenchmarkEthConfirmer(b *testing.B) {
2323
db := testutils.NewSqlxDB(b)
24-
txStore := cltest.NewTestTxStore(b, db)
24+
txStore := txmgrtest.NewTestTxStore(b, db)
2525
ethClient := clienttest.NewClientWithDefaultChainID(b)
2626
evmcfg := configtest.NewChainScopedConfig(b, func(c *toml.EVMConfig) {
2727
c.GasEstimator.PriceMax = assets.GWei(500)

0 commit comments

Comments
 (0)