diff --git a/go.mod b/go.mod index a039572fd9..26a89c4982 100644 --- a/go.mod +++ b/go.mod @@ -22,7 +22,7 @@ require ( github.com/smartcontractkit/chainlink-common v0.6.1-0.20250407100046-dfdf9600557b github.com/smartcontractkit/chainlink-framework/capabilities v0.0.0-20250408161305-721208f43882 github.com/smartcontractkit/chainlink-framework/chains v0.0.0-20250325121830-cfa9bf24c4f5 - github.com/smartcontractkit/chainlink-framework/multinode v0.0.0-20250402142713-6529d36f91f3 + github.com/smartcontractkit/chainlink-framework/multinode v0.0.0-20250409130234-ce7ec3a90ffd github.com/stretchr/testify v1.10.0 github.com/tidwall/gjson v1.18.0 github.com/ugorji/go/codec v1.2.12 diff --git a/go.sum b/go.sum index fec9ae018c..60c6f559f3 100644 --- a/go.sum +++ b/go.sum @@ -567,8 +567,8 @@ github.com/smartcontractkit/chainlink-framework/capabilities v0.0.0-202504081613 github.com/smartcontractkit/chainlink-framework/capabilities v0.0.0-20250408161305-721208f43882/go.mod h1:NVoJQoPYr6BorpaXTusoIH1IYTySCmanQ8Q1yv3mNh4= github.com/smartcontractkit/chainlink-framework/chains v0.0.0-20250325121830-cfa9bf24c4f5 h1:3uQneNhdLsJToTKCV8/o2bsdn0e70sndSwxEiTEctgw= github.com/smartcontractkit/chainlink-framework/chains v0.0.0-20250325121830-cfa9bf24c4f5/go.mod h1:tHem58EihQh63kR2LlAOKDAs9Vbghf1dJKZRGy6LG8g= -github.com/smartcontractkit/chainlink-framework/multinode v0.0.0-20250402142713-6529d36f91f3 h1:8+2KFkPYdCK9lHMK5D/+adw02iIjEV+5Uw4s7nMNsRI= -github.com/smartcontractkit/chainlink-framework/multinode v0.0.0-20250402142713-6529d36f91f3/go.mod h1:UsezB/51EAJ9FEBGn6ad2YtssgzWEIEpp3HyRM6a6iM= +github.com/smartcontractkit/chainlink-framework/multinode v0.0.0-20250409130234-ce7ec3a90ffd h1:fbOLXL+Fa7rZZX0oPhHk7dsmpfzk97qioUkJcCeyBR8= +github.com/smartcontractkit/chainlink-framework/multinode v0.0.0-20250409130234-ce7ec3a90ffd/go.mod h1:UsezB/51EAJ9FEBGn6ad2YtssgzWEIEpp3HyRM6a6iM= github.com/smartcontractkit/libocr v0.0.0-20250328171017-609ec10a5510 h1:gm8Jli0sdkrZYnrWBngAkPSDzFDkdNCy1/Dj86kVtYk= github.com/smartcontractkit/libocr v0.0.0-20250328171017-609ec10a5510/go.mod h1:Mb7+/LC4edz7HyHxX4QkE42pSuov4AV68+AxBXAap0o= github.com/smarty/assertions v1.15.0/go.mod h1:yABtdzeQs6l1brC900WlRNwj6ZR55d7B+E8C6HtKdec= diff --git a/pkg/client/chain_client_test.go b/pkg/client/chain_client_test.go index c4ea1ec99e..d98dccef30 100644 --- a/pkg/client/chain_client_test.go +++ b/pkg/client/chain_client_test.go @@ -786,7 +786,7 @@ func TestEthClient_ErroringClient(t *testing.T) { require.Equal(t, multinode.ErrNodeError, err) id := erroringClient.ConfiguredChainID() - require.Equal(t, id, big.NewInt(0)) + require.Equal(t, id, big.NewInt(evmtypes.NullClientChainID)) _, err = erroringClient.CodeAt(ctx, common.Address{}, nil) require.Equal(t, multinode.ErrNodeError, err) diff --git a/pkg/client/clienttest/clienttest.go b/pkg/client/clienttest/clienttest.go index a3928bee98..f31d2447f7 100644 --- a/pkg/client/clienttest/clienttest.go +++ b/pkg/client/clienttest/clienttest.go @@ -8,11 +8,13 @@ import ( "github.com/ethereum/go-ethereum" "github.com/stretchr/testify/mock" + + "github.com/smartcontractkit/chainlink-evm/pkg/types" ) func NewClientWithDefaultChainID(t testing.TB) *Client { c := NewClient(t) - c.On("ConfiguredChainID").Return(big.NewInt(0)).Maybe() + c.On("ConfiguredChainID").Return(big.NewInt(types.NullClientChainID)).Maybe() return c } diff --git a/pkg/client/null_client.go b/pkg/client/null_client.go index aab77b896a..ad1873b1a7 100644 --- a/pkg/client/null_client.go +++ b/pkg/client/null_client.go @@ -26,8 +26,9 @@ func NewNullClient(cid *big.Int, lggr logger.Logger) *NullClient { } // NullClientChainID the ChainID that nullclient will return -// 0 is never used as a real chain ID so makes sense as a dummy value here -const NullClientChainID = 0 +// hardcoded chainId is never used as a real chain ID so makes sense as a dummy value here +// can't use 0 because of introduced in geth 1.15.7 contraint 0 for chain id +const NullClientChainID = evmtypes.NullClientChainID // // Client methods diff --git a/pkg/config/configtest/configtest.go b/pkg/config/configtest/configtest.go index fa74f5bf11..f55f40c7c5 100644 --- a/pkg/config/configtest/configtest.go +++ b/pkg/config/configtest/configtest.go @@ -5,11 +5,12 @@ import ( "github.com/smartcontractkit/chainlink-evm/pkg/config" "github.com/smartcontractkit/chainlink-evm/pkg/config/toml" + "github.com/smartcontractkit/chainlink-evm/pkg/types" "github.com/smartcontractkit/chainlink-evm/pkg/utils/big" ) func NewChainScopedConfig(t testing.TB, overrideFn func(c *toml.EVMConfig)) *config.ChainScoped { - chainID := big.NewI(0) + chainID := big.NewI(types.NullClientChainID) evmCfg := &toml.EVMConfig{ ChainID: chainID, Chain: toml.Defaults(chainID), diff --git a/pkg/testutils/evmtypes.go b/pkg/testutils/evmtypes.go index ecb7e8e475..8aca8721b5 100644 --- a/pkg/testutils/evmtypes.go +++ b/pkg/testutils/evmtypes.go @@ -22,7 +22,7 @@ import ( // FixtureChainID matches the chain always added by fixtures.sql // It is set to 0 since no real chain ever has this ID and allows a virtual // "test" chain ID to be used without clashes -var FixtureChainID = big.NewInt(0) +var FixtureChainID = big.NewInt(evmtypes.NullClientChainID) // SimulatedChainID is the chain ID for the go-ethereum simulated backend var SimulatedChainID = big.NewInt(1337) diff --git a/pkg/types/utils.go b/pkg/types/utils.go index 96e0a02e2c..9ca79f19aa 100644 --- a/pkg/types/utils.go +++ b/pkg/types/utils.go @@ -6,6 +6,8 @@ import ( "github.com/ethereum/go-ethereum/accounts/abi" ) +const NullClientChainID = 1399100 + func MustGetABI(json string) abi.ABI { abi, err := abi.JSON(strings.NewReader(json)) if err != nil {