From 6a356f031e5169e35fc241bb95c8a9002234fcca Mon Sep 17 00:00:00 2001 From: vreff <104409744+vreff@users.noreply.github.com> Date: Tue, 2 Sep 2025 17:34:24 -0400 Subject: [PATCH 1/7] Update FixtureChainID, bump go-ethereum --- go.mod | 10 +++++--- go.sum | 37 ++++++++++++++++++++++++----- pkg/client/chain_client_test.go | 2 +- pkg/client/clienttest/clienttest.go | 3 ++- pkg/client/null_client.go | 2 +- pkg/config/configtest/configtest.go | 3 ++- pkg/testutils/evmtypes.go | 2 +- pkg/types/utils.go | 2 ++ 8 files changed, 47 insertions(+), 14 deletions(-) diff --git a/go.mod b/go.mod index 7c1fd5f8d2..27c7e01704 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/smartcontractkit/chainlink-evm go 1.24.4 require ( - github.com/ethereum/go-ethereum v1.15.3 + github.com/ethereum/go-ethereum v1.16.2 github.com/google/uuid v1.6.0 github.com/gorilla/websocket v1.5.3 github.com/jackc/pgconn v1.14.3 @@ -66,15 +66,17 @@ require ( github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect github.com/consensys/gnark-crypto v0.18.0 // indirect github.com/cpuguy83/go-md2man/v2 v2.0.5 // indirect + github.com/crate-crypto/go-eth-kzg v1.3.0 // indirect github.com/crate-crypto/go-ipa v0.0.0-20240724233137-53bbb0ceb27a // indirect - github.com/crate-crypto/go-kzg-4844 v1.1.0 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/deckarep/golang-set/v2 v2.6.0 // indirect github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 // indirect - github.com/ethereum/c-kzg-4844 v1.0.3 // indirect + github.com/emicklei/dot v1.6.2 // indirect + github.com/ethereum/c-kzg-4844/v2 v2.1.0 // indirect github.com/ethereum/go-verkle v0.2.2 // indirect github.com/fatih/color v1.18.0 // indirect github.com/fbsobreira/gotron-sdk v0.0.0-00010101000000-000000000000 // indirect + github.com/ferranbt/fastssz v0.1.4 // indirect github.com/fsnotify/fsnotify v1.8.0 // indirect github.com/fxamacker/cbor/v2 v2.5.0 // indirect github.com/gabriel-vasile/mimetype v1.4.8 // indirect @@ -125,6 +127,7 @@ require ( github.com/mattn/go-colorable v0.1.14 // indirect github.com/mattn/go-isatty v0.0.20 // indirect github.com/mattn/go-runewidth v0.0.16 // indirect + github.com/minio/sha256-simd v1.0.0 // indirect github.com/mitchellh/mapstructure v1.5.1-0.20220423185008-bf980b35cac4 // indirect github.com/mitchellh/pointerstructure v1.2.0 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect @@ -196,6 +199,7 @@ require ( google.golang.org/genproto/googleapis/rpc v0.0.0-20250519155744-55703ea1f237 // indirect google.golang.org/grpc v1.73.0 // indirect gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect + gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index eef4f66c44..f16d79e189 100644 --- a/go.sum +++ b/go.sum @@ -121,10 +121,10 @@ github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSV github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/cpuguy83/go-md2man/v2 v2.0.5 h1:ZtcqGrnekaHpVLArFSe4HK5DoKx1T0rq2DwVB0alcyc= github.com/cpuguy83/go-md2man/v2 v2.0.5/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= +github.com/crate-crypto/go-eth-kzg v1.3.0 h1:05GrhASN9kDAidaFJOda6A4BEvgvuXbazXg/0E3OOdI= +github.com/crate-crypto/go-eth-kzg v1.3.0/go.mod h1:J9/u5sWfznSObptgfa92Jq8rTswn6ahQWEuiLHOjCUI= github.com/crate-crypto/go-ipa v0.0.0-20240724233137-53bbb0ceb27a h1:W8mUrRp6NOVl3J+MYp5kPMoUZPp7aOYHtaua31lwRHg= github.com/crate-crypto/go-ipa v0.0.0-20240724233137-53bbb0ceb27a/go.mod h1:sTwzHBvIzm2RfVCGNEBZgRyjwK40bVoun3ZnGOCafNM= -github.com/crate-crypto/go-kzg-4844 v1.1.0 h1:EN/u9k2TF6OWSHrCCDBBU6GLNMq88OspHHlMnHfoyU4= -github.com/crate-crypto/go-kzg-4844 v1.1.0/go.mod h1:JolLjpSff1tCCJKaJx4psrlEdlXuJEC996PL3tTAFks= github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -137,6 +137,10 @@ github.com/decred/dcrd/crypto/blake256 v1.0.1 h1:7PltbUIQB7u/FfZ39+DGa/ShuMyJ5il github.com/decred/dcrd/crypto/blake256 v1.0.1/go.mod h1:2OfgNZ5wDpcsFmHmCK5gZTPcCXqlm2ArzUIkw9czNJo= github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 h1:rpfIENRNNilwHwZeG5+P150SMrnNEcHYvcCuK6dPZSg= github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0/go.mod h1:v57UDF4pDQJcEfFUCRop3lJL149eHGSe9Jvczhzjo/0= +github.com/deepmap/oapi-codegen v1.8.2 h1:SegyeYGcdi0jLLrpbCMoJxnUUn8GBXHsvr4rbzjuhfU= +github.com/deepmap/oapi-codegen v1.8.2/go.mod h1:YLgSKSDv/bZQB7N4ws6luhozi3cEdRktEqrX88CvjIw= +github.com/emicklei/dot v1.6.2 h1:08GN+DD79cy/tzN6uLCT84+2Wk9u+wvqP+Hkx/dIR8A= +github.com/emicklei/dot v1.6.2/go.mod h1:DeV7GvQtIw4h2u73RKBkkFdvVAz0D9fzeJrgPW6gy/s= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= @@ -144,16 +148,18 @@ github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5y github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/ethereum/c-kzg-4844 v1.0.3 h1:IEnbOHwjixW2cTvKRUlAAUOeleV7nNM/umJR+qy4WDs= -github.com/ethereum/c-kzg-4844 v1.0.3/go.mod h1:VewdlzQmpT5QSrVhbBuGoCdFJkpaJlO1aQputP83wc0= -github.com/ethereum/go-ethereum v1.15.3 h1:OeTWAq6r8iR89bfJDjmmOemE74ywArl9DUViFsVj3Y8= -github.com/ethereum/go-ethereum v1.15.3/go.mod h1:jMXlpZXfSar1mGs/5sB0aEpEnPsiE1Jn6/3anlueqz8= +github.com/ethereum/c-kzg-4844/v2 v2.1.0 h1:gQropX9YFBhl3g4HYhwE70zq3IHFRgbbNPw0Shwzf5w= +github.com/ethereum/c-kzg-4844/v2 v2.1.0/go.mod h1:TC48kOKjJKPbN7C++qIgt0TJzZ70QznYR7Ob+WXl57E= +github.com/ethereum/go-ethereum v1.16.2 h1:VDHqj86DaQiMpnMgc7l0rwZTg0FRmlz74yupSG5SnzI= +github.com/ethereum/go-ethereum v1.16.2/go.mod h1:X5CIOyo8SuK1Q5GnaEizQVLHT/DfsiGWuNeVdQcEMNA= github.com/ethereum/go-verkle v0.2.2 h1:I2W0WjnrFUIzzVPwm8ykY+7pL2d4VhlsePn4j7cnFk8= github.com/ethereum/go-verkle v0.2.2/go.mod h1:M3b90YRnzqKyyzBEWJGqj8Qff4IDeXnzFw0P9bFw3uk= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= github.com/fatih/color v1.18.0 h1:S8gINlzdQ840/4pfAwic/ZE0djQEH3wM94VfqLTZcOM= github.com/fatih/color v1.18.0/go.mod h1:4FelSpRwEGDpQ12mAdzqdOukCy4u8WUtOY6lkT/6HfU= +github.com/ferranbt/fastssz v0.1.4 h1:OCDB+dYDEQDvAgtAGnTSidK1Pe2tW3nFV40XyMkTeDY= +github.com/ferranbt/fastssz v0.1.4/go.mod h1:Ea3+oeoRGGLGm5shYAeDgu6PGUlcvQhE2fILyD9+tGg= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= @@ -163,6 +169,8 @@ github.com/fxamacker/cbor/v2 v2.5.0 h1:oHsG0V/Q6E/wqTS2O1Cozzsy69nqCiguo5Q1a1ADi github.com/fxamacker/cbor/v2 v2.5.0/go.mod h1:TA1xS00nchWmaBnEIxPSE5oHLuJBAVvqrtAnWBwBCVo= github.com/gabriel-vasile/mimetype v1.4.8 h1:FfZ3gj38NjllZIeJAmMhr+qKL8Wu+nOoI3GqacKw1NM= github.com/gabriel-vasile/mimetype v1.4.8/go.mod h1:ByKUIKGjh1ODkGM1asKUbQZOLGrPjydw3hYPU2YU9t8= +github.com/gballet/go-libpcsclite v0.0.0-20191108122812-4678299bea08 h1:f6D9Hr8xV8uYKlyuj8XIruxlh9WjVjdh1gIicAS7ays= +github.com/gballet/go-libpcsclite v0.0.0-20191108122812-4678299bea08/go.mod h1:x7DCsMOv1taUwEWCzT4cmDeAkigA5/QCwUodaVOe8Ww= github.com/getsentry/sentry-go v0.27.0 h1:Pv98CIbtB3LkMWmXi4Joa5OOcwbmnX88sF5qbK3r3Ps= github.com/getsentry/sentry-go v0.27.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= @@ -294,6 +302,8 @@ github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORR github.com/gopherjs/gopherjs v1.17.2/go.mod h1:pRRIvn/QzFLrKfvEz3qUuEhtE/zLCWfreZ6J5gM2i+k= github.com/gorilla/websocket v1.5.3 h1:saDtZ6Pbx/0u+bgYQ3q96pZgCzfhKXGPqt7kZ72aNNg= github.com/gorilla/websocket v1.5.3/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= +github.com/graph-gophers/graphql-go v1.3.0 h1:Eb9x/q6MFpCLz7jBCiP/WTxjSDrYLR1QY41SORZyNJ0= +github.com/graph-gophers/graphql-go v1.3.0/go.mod h1:9CQHMSxwO4MprSdzoIEobiHpoLtHm77vfxsvsIN5Vuc= github.com/grpc-ecosystem/go-grpc-middleware/providers/prometheus v1.0.1 h1:qnpSQwGEnkcRpTqNOIR6bJbR0gAorgP9CSALpRcKoAA= github.com/grpc-ecosystem/go-grpc-middleware/providers/prometheus v1.0.1/go.mod h1:lXGCsh6c22WGtjr+qGHj1otzZpV/1kwTMAqkwZsnWRU= github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.1.0 h1:pRhl55Yx1eC7BZ1N+BBWwnKaMyD8uC+34TLdndZMAKk= @@ -341,6 +351,12 @@ github.com/huin/goupnp v1.3.0/go.mod h1:gnGPsThkYa7bFi/KWmEysQRf48l2dvR5bxr2OFck github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= +github.com/influxdata/influxdb-client-go/v2 v2.4.0 h1:HGBfZYStlx3Kqvsv1h2pJixbCl/jhnFtxpKFAv9Tu5k= +github.com/influxdata/influxdb-client-go/v2 v2.4.0/go.mod h1:vLNHdxTJkIf2mSLvGrpj8TCcISApPoXkaxP8g9uRlW8= +github.com/influxdata/influxdb1-client v0.0.0-20220302092344-a9ab5670611c h1:qSHzRbhzK8RdXOsAdfDgO49TtqC1oZ+acxPrkfTxcCs= +github.com/influxdata/influxdb1-client v0.0.0-20220302092344-a9ab5670611c/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo= +github.com/influxdata/line-protocol v0.0.0-20210311194329-9aa0e372d097 h1:vilfsDSy7TDxedi9gyBkMvAirat/oRcL0lFdJBf6tdM= +github.com/influxdata/line-protocol v0.0.0-20210311194329-9aa0e372d097/go.mod h1:xaLFMmpvUxqXtVkUJfg9QmT88cDaCJ3ZKgdZ78oO8Qo= github.com/invopop/jsonschema v0.12.0 h1:6ovsNSuvn9wEQVOyc72aycBMVQFKz7cPdMJn10CvzRI= github.com/invopop/jsonschema v0.12.0/go.mod h1:ffZ5Km5SWWRAIN6wbDXItl95euhFz2uON45H2qjYt+0= github.com/jackc/chunkreader v1.0.0/go.mod h1:RT6O25fNZIuasFJRyZ4R/Y2BbhasbmZXF9QQ7T3kePo= @@ -414,6 +430,7 @@ github.com/klauspost/asmfmt v1.3.2 h1:4Ri7ox3EwapiOjCki+hw14RyKk201CN4rzyCJRFLpK github.com/klauspost/asmfmt v1.3.2/go.mod h1:AG8TuvYojzulgDAMCnYn50l/5QV3Bs/tp6j0HLHbNSE= github.com/klauspost/compress v1.18.0 h1:c/Cqfb0r+Yi+JtIEq73FWXVkRonBlf0CRNYc8Zttxdo= github.com/klauspost/compress v1.18.0/go.mod h1:2Pp+KzxcywXVXMr50+X0Q/Lsb43OQHYWRCY2AiWywWQ= +github.com/klauspost/cpuid/v2 v2.0.4/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= github.com/klauspost/cpuid/v2 v2.2.10 h1:tBs3QSyvjDyFTq3uoc/9xFpCuOsJQFNPiAhYdw2skhE= github.com/klauspost/cpuid/v2 v2.2.10/go.mod h1:hqwkgyIinND0mEev00jJYCxPNVRVXFQeu1XKlok6oO0= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= @@ -469,6 +486,8 @@ github.com/minio/asm2plan9s v0.0.0-20200509001527-cdd76441f9d8 h1:AMFGa4R4MiIpsp github.com/minio/asm2plan9s v0.0.0-20200509001527-cdd76441f9d8/go.mod h1:mC1jAcsrzbxHt8iiaC+zU4b1ylILSosueou12R++wfY= github.com/minio/c2goasm v0.0.0-20190812172519-36a3d3bbc4f3 h1:+n/aFZefKZp7spd8DFdX7uMikMLXX4oubIzJF4kv/wI= github.com/minio/c2goasm v0.0.0-20190812172519-36a3d3bbc4f3/go.mod h1:RagcQ7I8IeTMnF8JTXieKnO4Z6JCsikNEzj0DwauVzE= +github.com/minio/sha256-simd v1.0.0 h1:v1ta+49hkWZyvaKwrQB8elexRqm6Y0aMLjCNsrYxo6g= +github.com/minio/sha256-simd v1.0.0/go.mod h1:OuYzVNI5vcoYIAmbIvHPl3N3jUzVedXbKy5RFepssQM= github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= @@ -515,12 +534,16 @@ github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAl github.com/onsi/gomega v1.19.0/go.mod h1:LY+I3pBVzYsTBU1AnDwOSxaYi9WoWiqgwooUqq9yPro= github.com/onsi/gomega v1.36.2 h1:koNYke6TVk6ZmnyHrCXba/T/MoLBXFjeC1PtvYgw0A8= github.com/onsi/gomega v1.36.2/go.mod h1:DdwyADRjrc825LhMEkD76cHR5+pUnjhUN8GlHlRPHzY= +github.com/opentracing/opentracing-go v1.2.0 h1:uEJPy/1a5RIPAJ0Ov+OIO8OxWu77jEv+1B0VhjKrZUs= +github.com/opentracing/opentracing-go v1.2.0/go.mod h1:GxEUsuufX4nBwe+T+Wl9TAgYrxe9dPLANfrWvHYVTgc= github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pelletier/go-toml v1.9.3/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= github.com/pelletier/go-toml v1.9.5 h1:4yBQzkHv+7BHq2PQUZF3Mx0IYxG7LsP222s7Agd3ve8= github.com/pelletier/go-toml v1.9.5/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= github.com/pelletier/go-toml/v2 v2.2.4 h1:mye9XuhQ6gvn5h28+VilKrrPoQVanw5PMw/TB0t5Ec4= github.com/pelletier/go-toml/v2 v2.2.4/go.mod h1:2gIqNv+qfxSVS7cM2xJQKtLSTLUE9V8t9Stt+h56mCY= +github.com/peterh/liner v1.1.1-0.20190123174540-a2c9a5303de7 h1:oYW+YCJ1pachXTQmzR3rNLYGGz4g/UgFcjb28p/viDM= +github.com/peterh/liner v1.1.1-0.20190123174540-a2c9a5303de7/go.mod h1:CRroGNssyjTd/qIG2FyxByd2S8JEAZXBl4qUrZf8GS0= github.com/pierrec/lz4/v4 v4.1.22 h1:cKFw6uJDK+/gfw5BcDL0JL5aBsAFdsIT18eRtLj7VIU= github.com/pierrec/lz4/v4 v4.1.22/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4= github.com/pingcap/errors v0.11.4 h1:lFuQV/oaUMGcD2tqt+01ROSmJs75VG1ToEOkZIZ4nE4= @@ -556,6 +579,8 @@ github.com/prometheus/common v0.63.0 h1:YR/EIY1o3mEFP/kZCD7iDMnLPlGyuU2Gb3HIcXnA github.com/prometheus/common v0.63.0/go.mod h1:VVFF/fBIoToEnWRVkYoXEkq3R3paCoxG9PXP74SnV18= github.com/prometheus/procfs v0.16.0 h1:xh6oHhKwnOJKMYiYBDWmkHqQPyiY40sny36Cmx2bbsM= github.com/prometheus/procfs v0.16.0/go.mod h1:8veyXUu3nGP7oaCxhX6yeaM5u4stL2FeMXnCqhDthZg= +github.com/prysmaticlabs/gohashtree v0.0.4-beta h1:H/EbCuXPeTV3lpKeXGPpEV9gsUpkqOOVnWapUyeWro4= +github.com/prysmaticlabs/gohashtree v0.0.4-beta/go.mod h1:BFdtALS+Ffhg3lGQIHv9HDWuHS8cTvHZzrHWxwOtGOs= github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ= github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= diff --git a/pkg/client/chain_client_test.go b/pkg/client/chain_client_test.go index 47ce847146..9470d2679d 100644 --- a/pkg/client/chain_client_test.go +++ b/pkg/client/chain_client_test.go @@ -846,7 +846,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..460b98b317 100644 --- a/pkg/client/clienttest/clienttest.go +++ b/pkg/client/clienttest/clienttest.go @@ -7,12 +7,13 @@ import ( "testing" "github.com/ethereum/go-ethereum" + "github.com/smartcontractkit/chainlink-evm/pkg/types" "github.com/stretchr/testify/mock" ) 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 e2fe66610d..06cd56db9a 100644 --- a/pkg/client/null_client.go +++ b/pkg/client/null_client.go @@ -30,7 +30,7 @@ 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 +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..60d02c4d91 100644 --- a/pkg/types/utils.go +++ b/pkg/types/utils.go @@ -13,3 +13,5 @@ func MustGetABI(json string) abi.ABI { } return abi } + +const NullClientChainID = 1399100 From d3c67335c28fec8369da0cff927babb53f037c3f Mon Sep 17 00:00:00 2001 From: vreff <104409744+vreff@users.noreply.github.com> Date: Tue, 2 Sep 2025 18:10:20 -0400 Subject: [PATCH 2/7] fix lint --- pkg/client/clienttest/clienttest.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/client/clienttest/clienttest.go b/pkg/client/clienttest/clienttest.go index 460b98b317..f31d2447f7 100644 --- a/pkg/client/clienttest/clienttest.go +++ b/pkg/client/clienttest/clienttest.go @@ -7,8 +7,9 @@ import ( "testing" "github.com/ethereum/go-ethereum" - "github.com/smartcontractkit/chainlink-evm/pkg/types" "github.com/stretchr/testify/mock" + + "github.com/smartcontractkit/chainlink-evm/pkg/types" ) func NewClientWithDefaultChainID(t testing.TB) *Client { From 9fe25fd4539a450bb686cfdd35c75aeef3a74e78 Mon Sep 17 00:00:00 2001 From: vreff <104409744+vreff@users.noreply.github.com> Date: Tue, 2 Sep 2025 20:18:34 -0400 Subject: [PATCH 3/7] downgrade temporarily, add test fixes --- go.mod | 10 ++----- go.sum | 37 ++++--------------------- pkg/gas/fee_history_estimator_test.go | 11 ++++---- pkg/log/integration_test.go | 2 +- pkg/testutils/evmtypes.go | 6 ++-- pkg/txmgr/broadcaster_benchmark_test.go | 1 + pkg/txmgr/broadcaster_test.go | 12 ++++++-- pkg/txmgr/confirmer_test.go | 4 +-- pkg/txmgr/evm_tx_store_test.go | 10 ++++--- pkg/txmgr/finalizer_benchmark_test.go | 1 + pkg/txmgr/finalizer_test.go | 5 ++++ pkg/txmgr/nonce_tracker_test.go | 13 ++++----- pkg/txmgr/resender_test.go | 15 +++++----- pkg/txmgr/tracker_test.go | 2 +- pkg/txmgr/txmgr_test.go | 29 +++++++++++++------ pkg/txmgr/txmgrtest/utils.go | 1 + 16 files changed, 80 insertions(+), 79 deletions(-) diff --git a/go.mod b/go.mod index 27c7e01704..7c1fd5f8d2 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/smartcontractkit/chainlink-evm go 1.24.4 require ( - github.com/ethereum/go-ethereum v1.16.2 + github.com/ethereum/go-ethereum v1.15.3 github.com/google/uuid v1.6.0 github.com/gorilla/websocket v1.5.3 github.com/jackc/pgconn v1.14.3 @@ -66,17 +66,15 @@ require ( github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect github.com/consensys/gnark-crypto v0.18.0 // indirect github.com/cpuguy83/go-md2man/v2 v2.0.5 // indirect - github.com/crate-crypto/go-eth-kzg v1.3.0 // indirect github.com/crate-crypto/go-ipa v0.0.0-20240724233137-53bbb0ceb27a // indirect + github.com/crate-crypto/go-kzg-4844 v1.1.0 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/deckarep/golang-set/v2 v2.6.0 // indirect github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 // indirect - github.com/emicklei/dot v1.6.2 // indirect - github.com/ethereum/c-kzg-4844/v2 v2.1.0 // indirect + github.com/ethereum/c-kzg-4844 v1.0.3 // indirect github.com/ethereum/go-verkle v0.2.2 // indirect github.com/fatih/color v1.18.0 // indirect github.com/fbsobreira/gotron-sdk v0.0.0-00010101000000-000000000000 // indirect - github.com/ferranbt/fastssz v0.1.4 // indirect github.com/fsnotify/fsnotify v1.8.0 // indirect github.com/fxamacker/cbor/v2 v2.5.0 // indirect github.com/gabriel-vasile/mimetype v1.4.8 // indirect @@ -127,7 +125,6 @@ require ( github.com/mattn/go-colorable v0.1.14 // indirect github.com/mattn/go-isatty v0.0.20 // indirect github.com/mattn/go-runewidth v0.0.16 // indirect - github.com/minio/sha256-simd v1.0.0 // indirect github.com/mitchellh/mapstructure v1.5.1-0.20220423185008-bf980b35cac4 // indirect github.com/mitchellh/pointerstructure v1.2.0 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect @@ -199,7 +196,6 @@ require ( google.golang.org/genproto/googleapis/rpc v0.0.0-20250519155744-55703ea1f237 // indirect google.golang.org/grpc v1.73.0 // indirect gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect - gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index f16d79e189..eef4f66c44 100644 --- a/go.sum +++ b/go.sum @@ -121,10 +121,10 @@ github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSV github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/cpuguy83/go-md2man/v2 v2.0.5 h1:ZtcqGrnekaHpVLArFSe4HK5DoKx1T0rq2DwVB0alcyc= github.com/cpuguy83/go-md2man/v2 v2.0.5/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= -github.com/crate-crypto/go-eth-kzg v1.3.0 h1:05GrhASN9kDAidaFJOda6A4BEvgvuXbazXg/0E3OOdI= -github.com/crate-crypto/go-eth-kzg v1.3.0/go.mod h1:J9/u5sWfznSObptgfa92Jq8rTswn6ahQWEuiLHOjCUI= github.com/crate-crypto/go-ipa v0.0.0-20240724233137-53bbb0ceb27a h1:W8mUrRp6NOVl3J+MYp5kPMoUZPp7aOYHtaua31lwRHg= github.com/crate-crypto/go-ipa v0.0.0-20240724233137-53bbb0ceb27a/go.mod h1:sTwzHBvIzm2RfVCGNEBZgRyjwK40bVoun3ZnGOCafNM= +github.com/crate-crypto/go-kzg-4844 v1.1.0 h1:EN/u9k2TF6OWSHrCCDBBU6GLNMq88OspHHlMnHfoyU4= +github.com/crate-crypto/go-kzg-4844 v1.1.0/go.mod h1:JolLjpSff1tCCJKaJx4psrlEdlXuJEC996PL3tTAFks= github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -137,10 +137,6 @@ github.com/decred/dcrd/crypto/blake256 v1.0.1 h1:7PltbUIQB7u/FfZ39+DGa/ShuMyJ5il github.com/decred/dcrd/crypto/blake256 v1.0.1/go.mod h1:2OfgNZ5wDpcsFmHmCK5gZTPcCXqlm2ArzUIkw9czNJo= github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 h1:rpfIENRNNilwHwZeG5+P150SMrnNEcHYvcCuK6dPZSg= github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0/go.mod h1:v57UDF4pDQJcEfFUCRop3lJL149eHGSe9Jvczhzjo/0= -github.com/deepmap/oapi-codegen v1.8.2 h1:SegyeYGcdi0jLLrpbCMoJxnUUn8GBXHsvr4rbzjuhfU= -github.com/deepmap/oapi-codegen v1.8.2/go.mod h1:YLgSKSDv/bZQB7N4ws6luhozi3cEdRktEqrX88CvjIw= -github.com/emicklei/dot v1.6.2 h1:08GN+DD79cy/tzN6uLCT84+2Wk9u+wvqP+Hkx/dIR8A= -github.com/emicklei/dot v1.6.2/go.mod h1:DeV7GvQtIw4h2u73RKBkkFdvVAz0D9fzeJrgPW6gy/s= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= @@ -148,18 +144,16 @@ github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5y github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/ethereum/c-kzg-4844/v2 v2.1.0 h1:gQropX9YFBhl3g4HYhwE70zq3IHFRgbbNPw0Shwzf5w= -github.com/ethereum/c-kzg-4844/v2 v2.1.0/go.mod h1:TC48kOKjJKPbN7C++qIgt0TJzZ70QznYR7Ob+WXl57E= -github.com/ethereum/go-ethereum v1.16.2 h1:VDHqj86DaQiMpnMgc7l0rwZTg0FRmlz74yupSG5SnzI= -github.com/ethereum/go-ethereum v1.16.2/go.mod h1:X5CIOyo8SuK1Q5GnaEizQVLHT/DfsiGWuNeVdQcEMNA= +github.com/ethereum/c-kzg-4844 v1.0.3 h1:IEnbOHwjixW2cTvKRUlAAUOeleV7nNM/umJR+qy4WDs= +github.com/ethereum/c-kzg-4844 v1.0.3/go.mod h1:VewdlzQmpT5QSrVhbBuGoCdFJkpaJlO1aQputP83wc0= +github.com/ethereum/go-ethereum v1.15.3 h1:OeTWAq6r8iR89bfJDjmmOemE74ywArl9DUViFsVj3Y8= +github.com/ethereum/go-ethereum v1.15.3/go.mod h1:jMXlpZXfSar1mGs/5sB0aEpEnPsiE1Jn6/3anlueqz8= github.com/ethereum/go-verkle v0.2.2 h1:I2W0WjnrFUIzzVPwm8ykY+7pL2d4VhlsePn4j7cnFk8= github.com/ethereum/go-verkle v0.2.2/go.mod h1:M3b90YRnzqKyyzBEWJGqj8Qff4IDeXnzFw0P9bFw3uk= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= github.com/fatih/color v1.18.0 h1:S8gINlzdQ840/4pfAwic/ZE0djQEH3wM94VfqLTZcOM= github.com/fatih/color v1.18.0/go.mod h1:4FelSpRwEGDpQ12mAdzqdOukCy4u8WUtOY6lkT/6HfU= -github.com/ferranbt/fastssz v0.1.4 h1:OCDB+dYDEQDvAgtAGnTSidK1Pe2tW3nFV40XyMkTeDY= -github.com/ferranbt/fastssz v0.1.4/go.mod h1:Ea3+oeoRGGLGm5shYAeDgu6PGUlcvQhE2fILyD9+tGg= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= @@ -169,8 +163,6 @@ github.com/fxamacker/cbor/v2 v2.5.0 h1:oHsG0V/Q6E/wqTS2O1Cozzsy69nqCiguo5Q1a1ADi github.com/fxamacker/cbor/v2 v2.5.0/go.mod h1:TA1xS00nchWmaBnEIxPSE5oHLuJBAVvqrtAnWBwBCVo= github.com/gabriel-vasile/mimetype v1.4.8 h1:FfZ3gj38NjllZIeJAmMhr+qKL8Wu+nOoI3GqacKw1NM= github.com/gabriel-vasile/mimetype v1.4.8/go.mod h1:ByKUIKGjh1ODkGM1asKUbQZOLGrPjydw3hYPU2YU9t8= -github.com/gballet/go-libpcsclite v0.0.0-20191108122812-4678299bea08 h1:f6D9Hr8xV8uYKlyuj8XIruxlh9WjVjdh1gIicAS7ays= -github.com/gballet/go-libpcsclite v0.0.0-20191108122812-4678299bea08/go.mod h1:x7DCsMOv1taUwEWCzT4cmDeAkigA5/QCwUodaVOe8Ww= github.com/getsentry/sentry-go v0.27.0 h1:Pv98CIbtB3LkMWmXi4Joa5OOcwbmnX88sF5qbK3r3Ps= github.com/getsentry/sentry-go v0.27.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= @@ -302,8 +294,6 @@ github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORR github.com/gopherjs/gopherjs v1.17.2/go.mod h1:pRRIvn/QzFLrKfvEz3qUuEhtE/zLCWfreZ6J5gM2i+k= github.com/gorilla/websocket v1.5.3 h1:saDtZ6Pbx/0u+bgYQ3q96pZgCzfhKXGPqt7kZ72aNNg= github.com/gorilla/websocket v1.5.3/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= -github.com/graph-gophers/graphql-go v1.3.0 h1:Eb9x/q6MFpCLz7jBCiP/WTxjSDrYLR1QY41SORZyNJ0= -github.com/graph-gophers/graphql-go v1.3.0/go.mod h1:9CQHMSxwO4MprSdzoIEobiHpoLtHm77vfxsvsIN5Vuc= github.com/grpc-ecosystem/go-grpc-middleware/providers/prometheus v1.0.1 h1:qnpSQwGEnkcRpTqNOIR6bJbR0gAorgP9CSALpRcKoAA= github.com/grpc-ecosystem/go-grpc-middleware/providers/prometheus v1.0.1/go.mod h1:lXGCsh6c22WGtjr+qGHj1otzZpV/1kwTMAqkwZsnWRU= github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.1.0 h1:pRhl55Yx1eC7BZ1N+BBWwnKaMyD8uC+34TLdndZMAKk= @@ -351,12 +341,6 @@ github.com/huin/goupnp v1.3.0/go.mod h1:gnGPsThkYa7bFi/KWmEysQRf48l2dvR5bxr2OFck github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= -github.com/influxdata/influxdb-client-go/v2 v2.4.0 h1:HGBfZYStlx3Kqvsv1h2pJixbCl/jhnFtxpKFAv9Tu5k= -github.com/influxdata/influxdb-client-go/v2 v2.4.0/go.mod h1:vLNHdxTJkIf2mSLvGrpj8TCcISApPoXkaxP8g9uRlW8= -github.com/influxdata/influxdb1-client v0.0.0-20220302092344-a9ab5670611c h1:qSHzRbhzK8RdXOsAdfDgO49TtqC1oZ+acxPrkfTxcCs= -github.com/influxdata/influxdb1-client v0.0.0-20220302092344-a9ab5670611c/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo= -github.com/influxdata/line-protocol v0.0.0-20210311194329-9aa0e372d097 h1:vilfsDSy7TDxedi9gyBkMvAirat/oRcL0lFdJBf6tdM= -github.com/influxdata/line-protocol v0.0.0-20210311194329-9aa0e372d097/go.mod h1:xaLFMmpvUxqXtVkUJfg9QmT88cDaCJ3ZKgdZ78oO8Qo= github.com/invopop/jsonschema v0.12.0 h1:6ovsNSuvn9wEQVOyc72aycBMVQFKz7cPdMJn10CvzRI= github.com/invopop/jsonschema v0.12.0/go.mod h1:ffZ5Km5SWWRAIN6wbDXItl95euhFz2uON45H2qjYt+0= github.com/jackc/chunkreader v1.0.0/go.mod h1:RT6O25fNZIuasFJRyZ4R/Y2BbhasbmZXF9QQ7T3kePo= @@ -430,7 +414,6 @@ github.com/klauspost/asmfmt v1.3.2 h1:4Ri7ox3EwapiOjCki+hw14RyKk201CN4rzyCJRFLpK github.com/klauspost/asmfmt v1.3.2/go.mod h1:AG8TuvYojzulgDAMCnYn50l/5QV3Bs/tp6j0HLHbNSE= github.com/klauspost/compress v1.18.0 h1:c/Cqfb0r+Yi+JtIEq73FWXVkRonBlf0CRNYc8Zttxdo= github.com/klauspost/compress v1.18.0/go.mod h1:2Pp+KzxcywXVXMr50+X0Q/Lsb43OQHYWRCY2AiWywWQ= -github.com/klauspost/cpuid/v2 v2.0.4/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= github.com/klauspost/cpuid/v2 v2.2.10 h1:tBs3QSyvjDyFTq3uoc/9xFpCuOsJQFNPiAhYdw2skhE= github.com/klauspost/cpuid/v2 v2.2.10/go.mod h1:hqwkgyIinND0mEev00jJYCxPNVRVXFQeu1XKlok6oO0= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= @@ -486,8 +469,6 @@ github.com/minio/asm2plan9s v0.0.0-20200509001527-cdd76441f9d8 h1:AMFGa4R4MiIpsp github.com/minio/asm2plan9s v0.0.0-20200509001527-cdd76441f9d8/go.mod h1:mC1jAcsrzbxHt8iiaC+zU4b1ylILSosueou12R++wfY= github.com/minio/c2goasm v0.0.0-20190812172519-36a3d3bbc4f3 h1:+n/aFZefKZp7spd8DFdX7uMikMLXX4oubIzJF4kv/wI= github.com/minio/c2goasm v0.0.0-20190812172519-36a3d3bbc4f3/go.mod h1:RagcQ7I8IeTMnF8JTXieKnO4Z6JCsikNEzj0DwauVzE= -github.com/minio/sha256-simd v1.0.0 h1:v1ta+49hkWZyvaKwrQB8elexRqm6Y0aMLjCNsrYxo6g= -github.com/minio/sha256-simd v1.0.0/go.mod h1:OuYzVNI5vcoYIAmbIvHPl3N3jUzVedXbKy5RFepssQM= github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= @@ -534,16 +515,12 @@ github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAl github.com/onsi/gomega v1.19.0/go.mod h1:LY+I3pBVzYsTBU1AnDwOSxaYi9WoWiqgwooUqq9yPro= github.com/onsi/gomega v1.36.2 h1:koNYke6TVk6ZmnyHrCXba/T/MoLBXFjeC1PtvYgw0A8= github.com/onsi/gomega v1.36.2/go.mod h1:DdwyADRjrc825LhMEkD76cHR5+pUnjhUN8GlHlRPHzY= -github.com/opentracing/opentracing-go v1.2.0 h1:uEJPy/1a5RIPAJ0Ov+OIO8OxWu77jEv+1B0VhjKrZUs= -github.com/opentracing/opentracing-go v1.2.0/go.mod h1:GxEUsuufX4nBwe+T+Wl9TAgYrxe9dPLANfrWvHYVTgc= github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pelletier/go-toml v1.9.3/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= github.com/pelletier/go-toml v1.9.5 h1:4yBQzkHv+7BHq2PQUZF3Mx0IYxG7LsP222s7Agd3ve8= github.com/pelletier/go-toml v1.9.5/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= github.com/pelletier/go-toml/v2 v2.2.4 h1:mye9XuhQ6gvn5h28+VilKrrPoQVanw5PMw/TB0t5Ec4= github.com/pelletier/go-toml/v2 v2.2.4/go.mod h1:2gIqNv+qfxSVS7cM2xJQKtLSTLUE9V8t9Stt+h56mCY= -github.com/peterh/liner v1.1.1-0.20190123174540-a2c9a5303de7 h1:oYW+YCJ1pachXTQmzR3rNLYGGz4g/UgFcjb28p/viDM= -github.com/peterh/liner v1.1.1-0.20190123174540-a2c9a5303de7/go.mod h1:CRroGNssyjTd/qIG2FyxByd2S8JEAZXBl4qUrZf8GS0= github.com/pierrec/lz4/v4 v4.1.22 h1:cKFw6uJDK+/gfw5BcDL0JL5aBsAFdsIT18eRtLj7VIU= github.com/pierrec/lz4/v4 v4.1.22/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4= github.com/pingcap/errors v0.11.4 h1:lFuQV/oaUMGcD2tqt+01ROSmJs75VG1ToEOkZIZ4nE4= @@ -579,8 +556,6 @@ github.com/prometheus/common v0.63.0 h1:YR/EIY1o3mEFP/kZCD7iDMnLPlGyuU2Gb3HIcXnA github.com/prometheus/common v0.63.0/go.mod h1:VVFF/fBIoToEnWRVkYoXEkq3R3paCoxG9PXP74SnV18= github.com/prometheus/procfs v0.16.0 h1:xh6oHhKwnOJKMYiYBDWmkHqQPyiY40sny36Cmx2bbsM= github.com/prometheus/procfs v0.16.0/go.mod h1:8veyXUu3nGP7oaCxhX6yeaM5u4stL2FeMXnCqhDthZg= -github.com/prysmaticlabs/gohashtree v0.0.4-beta h1:H/EbCuXPeTV3lpKeXGPpEV9gsUpkqOOVnWapUyeWro4= -github.com/prysmaticlabs/gohashtree v0.0.4-beta/go.mod h1:BFdtALS+Ffhg3lGQIHv9HDWuHS8cTvHZzrHWxwOtGOs= github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ= github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= diff --git a/pkg/gas/fee_history_estimator_test.go b/pkg/gas/fee_history_estimator_test.go index 72235435cb..7bcd1b98fd 100644 --- a/pkg/gas/fee_history_estimator_test.go +++ b/pkg/gas/fee_history_estimator_test.go @@ -16,6 +16,7 @@ import ( "github.com/smartcontractkit/chainlink-evm/pkg/assets" "github.com/smartcontractkit/chainlink-evm/pkg/gas" "github.com/smartcontractkit/chainlink-evm/pkg/gas/mocks" + "github.com/smartcontractkit/chainlink-evm/pkg/testutils" "github.com/smartcontractkit/chainlink-framework/chains/fees" ) @@ -23,7 +24,7 @@ func TestFeeHistoryEstimatorLifecycle(t *testing.T) { t.Parallel() var gasLimit uint64 = 21000 maxPrice := assets.NewWeiI(100) - chainID := big.NewInt(0) + chainID := testutils.FixtureChainID t.Run("fails if you fetch gas price before the estimator starts", func(t *testing.T) { cfg := gas.FeeHistoryEstimatorConfig{ @@ -78,7 +79,7 @@ func TestFeeHistoryEstimatorGetLegacyGas(t *testing.T) { var gasLimit uint64 = 21000 maxPrice := assets.NewWeiI(100) - chainID := big.NewInt(0) + chainID := testutils.FixtureChainID t.Run("fetches a new gas price when first called", func(t *testing.T) { client := mocks.NewFeeHistoryEstimatorClient(t) @@ -125,7 +126,7 @@ func TestFeeHistoryEstimatorBumpLegacyGas(t *testing.T) { var gasLimit uint64 = 21000 maxPrice := assets.NewWeiI(100) - chainID := big.NewInt(0) + chainID := testutils.FixtureChainID t.Run("bumps a previous attempt by BumpPercent", func(t *testing.T) { client := mocks.NewFeeHistoryEstimatorClient(t) @@ -216,7 +217,7 @@ func TestFeeHistoryEstimatorGetDynamicFee(t *testing.T) { t.Parallel() maxPrice := assets.NewWeiI(100) - chainID := big.NewInt(0) + chainID := testutils.FixtureChainID t.Run("fetches a new dynamic fee when first called", func(t *testing.T) { client := mocks.NewFeeHistoryEstimatorClient(t) @@ -287,7 +288,7 @@ func TestFeeHistoryEstimatorBumpDynamicFee(t *testing.T) { t.Parallel() globalMaxPrice := assets.NewWeiI(100) - chainID := big.NewInt(0) + chainID := testutils.FixtureChainID t.Run("bumps a previous attempt by BumpPercent", func(t *testing.T) { client := mocks.NewFeeHistoryEstimatorClient(t) diff --git a/pkg/log/integration_test.go b/pkg/log/integration_test.go index 74605acec5..5d70fc7cf7 100644 --- a/pkg/log/integration_test.go +++ b/pkg/log/integration_test.go @@ -1545,7 +1545,7 @@ func TestBroadcaster_BroadcastsWithZeroConfirmations(t *testing.T) { ethClient := clienttest.NewClient(t) mockEth := &clienttest.MockEth{EthClient: ethClient} - ethClient.On("ConfiguredChainID").Return(big.NewInt(0)).Maybe() + ethClient.On("ConfiguredChainID").Return(testutils.FixtureChainID).Maybe() logsChCh := make(chan testutils.RawSub[types.Log]) ethClient.On("SubscribeFilterLogs", mock.Anything, mock.Anything, mock.Anything). Return( diff --git a/pkg/testutils/evmtypes.go b/pkg/testutils/evmtypes.go index 8aca8721b5..3c81dfed61 100644 --- a/pkg/testutils/evmtypes.go +++ b/pkg/testutils/evmtypes.go @@ -19,9 +19,9 @@ import ( ubig "github.com/smartcontractkit/chainlink-evm/pkg/utils/big" ) -// 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 +// FixtureChainID is set to a chainID that is unlikely to be used in production. +// It can no longer be zero due to a breaking change in go-ethereum: +// https://github.com/ethereum/go-ethereum/blob/master/core/types/transaction_signing.go#L193 var FixtureChainID = big.NewInt(evmtypes.NullClientChainID) // SimulatedChainID is the chain ID for the go-ethereum simulated backend diff --git a/pkg/txmgr/broadcaster_benchmark_test.go b/pkg/txmgr/broadcaster_benchmark_test.go index c63c504d78..87a3781690 100644 --- a/pkg/txmgr/broadcaster_benchmark_test.go +++ b/pkg/txmgr/broadcaster_benchmark_test.go @@ -54,6 +54,7 @@ func BenchmarkEthBroadcaster_ProcessUnstartedEthTxs_Success(b *testing.B) { FeeLimit: gasLimit, CreatedAt: time.Unix(0, 0), State: txmgrcommon.TxUnstarted, + ChainID: testutils.FixtureChainID, } evmcfg := configtest.NewChainScopedConfig(b, nil) diff --git a/pkg/txmgr/broadcaster_test.go b/pkg/txmgr/broadcaster_test.go index 67ec070535..1055793780 100644 --- a/pkg/txmgr/broadcaster_test.go +++ b/pkg/txmgr/broadcaster_test.go @@ -253,6 +253,7 @@ func TestEthBroadcaster_ProcessUnstartedEthTxs_Success(t *testing.T) { FeeLimit: gasLimit, BroadcastAt: &timeNow, InitialBroadcastAt: &timeNow, + ChainID: testutils.FixtureChainID, Error: null.String{}, State: txmgrcommon.TxUnconfirmed, } @@ -285,6 +286,7 @@ func TestEthBroadcaster_ProcessUnstartedEthTxs_Success(t *testing.T) { FeeLimit: gasLimit, CreatedAt: time.Unix(0, 0), State: txmgrcommon.TxUnstarted, + ChainID: testutils.FixtureChainID, } ethClient.On("SendTransactionReturnCode", mock.Anything, mock.MatchedBy(func(tx *gethTypes.Transaction) bool { return tx.Nonce() == uint64(2) && tx.Value().Cmp(big.NewInt(242)) == 0 @@ -304,6 +306,7 @@ func TestEthBroadcaster_ProcessUnstartedEthTxs_Success(t *testing.T) { CreatedAt: time.Unix(0, 1), State: txmgrcommon.TxUnstarted, Meta: &meta, + ChainID: testutils.FixtureChainID, } ethClient.On("SendTransactionReturnCode", mock.Anything, mock.MatchedBy(func(tx *gethTypes.Transaction) bool { if tx.Nonce() != uint64(0) { @@ -327,6 +330,7 @@ func TestEthBroadcaster_ProcessUnstartedEthTxs_Success(t *testing.T) { FeeLimit: gasLimit, CreatedAt: time.Unix(1, 0), State: txmgrcommon.TxUnstarted, + ChainID: testutils.FixtureChainID, } ethClient.On("SendTransactionReturnCode", mock.Anything, mock.MatchedBy(func(tx *gethTypes.Transaction) bool { if tx.Nonce() != uint64(1) { @@ -786,6 +790,7 @@ func TestEthBroadcaster_ProcessUnstartedEthTxs_ResumingFromCrash(t *testing.T) { FeeLimit: gasLimit, Error: null.String{}, State: txmgrcommon.TxInProgress, + ChainID: testutils.FixtureChainID, } secondInProgress := txmgr.Tx{ @@ -797,6 +802,7 @@ func TestEthBroadcaster_ProcessUnstartedEthTxs_ResumingFromCrash(t *testing.T) { FeeLimit: gasLimit, Error: null.String{}, State: txmgrcommon.TxInProgress, + ChainID: testutils.FixtureChainID, } require.NoError(t, txStore.InsertTx(ctx, &firstInProgress)) @@ -1162,6 +1168,7 @@ func TestEthBroadcaster_ProcessUnstartedEthTxs_Errors(t *testing.T) { State: txmgrcommon.TxUnstarted, PipelineTaskRunID: uuid.NullUUID{UUID: trID, Valid: true}, SignalCallback: true, + ChainID: testutils.FixtureChainID, } t.Run("with erroring callback bails out", func(t *testing.T) { @@ -1464,6 +1471,7 @@ func TestEthBroadcaster_ProcessUnstartedEthTxs_Errors(t *testing.T) { Value: value, FeeLimit: gasLimit, State: txmgrcommon.TxUnstarted, + ChainID: testutils.FixtureChainID, } require.NoError(t, txStore.InsertTx(ctx, &etxUnfinished)) @@ -1874,7 +1882,7 @@ func TestEthBroadcaster_NonceTracker_InProgressTx(t *testing.T) { txStore := txmgrtest.NewTestTxStore(t, db) memKS := keystest.NewMemoryChainStore() fromAddress := memKS.MustCreate(t) - ethKeyStore := keys.NewChainStore(memKS, big.NewInt(0)) + ethKeyStore := keys.NewChainStore(memKS, testutils.FixtureChainID) ethClient := clienttest.NewClientWithDefaultChainID(t) evmcfg := configtest.NewChainScopedConfig(t, nil) @@ -1912,7 +1920,7 @@ func TestEthBroadcaster_HederaBroadcastValidation(t *testing.T) { db := testutils.NewSqlxDB(t) txStore := txmgrtest.NewTestTxStore(t, db) memKS := keystest.NewMemoryChainStore() - ethKeyStore := keys.NewChainStore(memKS, big.NewInt(0)) + ethKeyStore := keys.NewChainStore(memKS, testutils.FixtureChainID) evmcfg := configtest.NewChainScopedConfig(t, nil) ethClient := clienttest.NewClientWithDefaultChainID(t) lggr, observed := logger.TestObserved(t, zapcore.DebugLevel) diff --git a/pkg/txmgr/confirmer_test.go b/pkg/txmgr/confirmer_test.go index 09548afb66..727d747621 100644 --- a/pkg/txmgr/confirmer_test.go +++ b/pkg/txmgr/confirmer_test.go @@ -1281,7 +1281,7 @@ func TestEthConfirmer_RebroadcastWhereNecessary_TerminallyUnderpriced_ThenGoesTh memKS := keystest.NewMemoryChainStore() fromAddress := memKS.MustCreate(t) - kst := keys.NewChainStore(memKS, big.NewInt(0)) + kst := keys.NewChainStore(memKS, testutils.FixtureChainID) evmcfg := configtest.NewChainScopedConfig(t, func(c *toml.EVMConfig) { c.GasEstimator.PriceMax = assets.GWei(500) @@ -1547,7 +1547,7 @@ func TestEthConfirmer_ForceRebroadcast(t *testing.T) { memKS := keystest.NewMemoryChainStore() fromAddress := memKS.MustCreate(t) config := configtest.NewChainScopedConfig(t, nil) - ethKeyStore := keys.NewChainStore(memKS, big.NewInt(0)) + ethKeyStore := keys.NewChainStore(memKS, testutils.FixtureChainID) mustCreateUnstartedGeneratedTx(t, txStore, fromAddress, config.EVM().ChainID()) mustInsertInProgressEthTx(t, txStore, 0, fromAddress) diff --git a/pkg/txmgr/evm_tx_store_test.go b/pkg/txmgr/evm_tx_store_test.go index a489310112..24364db083 100644 --- a/pkg/txmgr/evm_tx_store_test.go +++ b/pkg/txmgr/evm_tx_store_test.go @@ -650,7 +650,7 @@ func Test_FindTxWithIdempotencyKey(t *testing.T) { t.Run("returns nil error if no results", func(t *testing.T) { idempotencyKey := "777" - etx, err := txStore.FindTxWithIdempotencyKey(tests.Context(t), idempotencyKey, big.NewInt(0)) + etx, err := txStore.FindTxWithIdempotencyKey(tests.Context(t), idempotencyKey, testutils.FixtureChainID) require.NoError(t, err) assert.Nil(t, etx) }) @@ -658,11 +658,11 @@ func Test_FindTxWithIdempotencyKey(t *testing.T) { t.Run("returns transaction if it exists", func(t *testing.T) { idempotencyKey := "777" cfg.EVM().ChainID() - etx := mustCreateUnstartedGeneratedTx(t, txStore, fromAddress, big.NewInt(0), + etx := mustCreateUnstartedGeneratedTx(t, txStore, fromAddress, testutils.FixtureChainID, txRequestWithIdempotencyKey(idempotencyKey)) require.Equal(t, idempotencyKey, *etx.IdempotencyKey) - res, err := txStore.FindTxWithIdempotencyKey(tests.Context(t), idempotencyKey, big.NewInt(0)) + res, err := txStore.FindTxWithIdempotencyKey(tests.Context(t), idempotencyKey, testutils.FixtureChainID) require.NoError(t, err) assert.Equal(t, etx.Sequence, res.Sequence) require.Equal(t, idempotencyKey, *res.IdempotencyKey) @@ -679,7 +679,7 @@ func Test_FindReceiptWithIdempotencyKey(t *testing.T) { idempotencyKey := "654" t.Run("returns nil error if no results", func(t *testing.T) { - r, err := txStore.FindReceiptWithIdempotencyKey(tests.Context(t), idempotencyKey, big.NewInt(0)) + r, err := txStore.FindReceiptWithIdempotencyKey(tests.Context(t), idempotencyKey, testutils.FixtureChainID) require.NoError(t, err) assert.Nil(t, r) }) @@ -1862,6 +1862,7 @@ func TestORM_UpdateTxStatesToFinalizedUsingTxHashes(t *testing.T) { State: txmgrcommon.TxConfirmed, BroadcastAt: &broadcast, InitialBroadcastAt: &broadcast, + ChainID: testutils.FixtureChainID, } err := txStore.InsertTx(ctx, tx) require.NoError(t, err) @@ -2060,6 +2061,7 @@ func mustInsertTerminallyStuckTxWithAttempt(t testing.TB, txStore txmgr.TestEvmT BroadcastAt: &broadcast, InitialBroadcastAt: &broadcast, Error: null.StringFrom(client.TerminallyStuckMsg), + ChainID: testutils.FixtureChainID, } require.NoError(t, txStore.InsertTx(ctx, &tx)) attempt := txmgrtest.NewLegacyEthTxAttempt(t, tx.ID) diff --git a/pkg/txmgr/finalizer_benchmark_test.go b/pkg/txmgr/finalizer_benchmark_test.go index 48e73d39d5..6874b605f4 100644 --- a/pkg/txmgr/finalizer_benchmark_test.go +++ b/pkg/txmgr/finalizer_benchmark_test.go @@ -66,6 +66,7 @@ func BenchmarkFinalizer(b *testing.B) { State: txmgrcommon.TxConfirmed, BroadcastAt: &broadcast, InitialBroadcastAt: &broadcast, + ChainID: testutils.FixtureChainID, } attemptHash := insertTxAndAttemptWithIdempotencyKey(b, txStore, tx, idempotencyKey) // Insert receipt for finalized block num diff --git a/pkg/txmgr/finalizer_test.go b/pkg/txmgr/finalizer_test.go index 9b0c1a18a3..599e928f17 100644 --- a/pkg/txmgr/finalizer_test.go +++ b/pkg/txmgr/finalizer_test.go @@ -78,6 +78,7 @@ func TestFinalizer_MarkTxFinalized(t *testing.T) { State: txmgrcommon.TxConfirmed, BroadcastAt: &broadcast, InitialBroadcastAt: &broadcast, + ChainID: testutils.FixtureChainID, } attemptHash := insertTxAndAttemptWithIdempotencyKey(t, txStore, tx, idempotencyKey) // Insert receipt for unfinalized block num @@ -108,6 +109,7 @@ func TestFinalizer_MarkTxFinalized(t *testing.T) { State: txmgrcommon.TxConfirmed, BroadcastAt: &broadcast, InitialBroadcastAt: &broadcast, + ChainID: testutils.FixtureChainID, } attemptHash := insertTxAndAttemptWithIdempotencyKey(t, txStore, tx, idempotencyKey) // Insert receipt for finalized block num @@ -140,6 +142,7 @@ func TestFinalizer_MarkTxFinalized(t *testing.T) { State: txmgrcommon.TxConfirmed, BroadcastAt: &broadcast, InitialBroadcastAt: &broadcast, + ChainID: testutils.FixtureChainID, } attemptHash := insertTxAndAttemptWithIdempotencyKey(t, txStore, tx, idempotencyKey) // Insert receipt for finalized block num @@ -170,6 +173,7 @@ func TestFinalizer_MarkTxFinalized(t *testing.T) { State: txmgrcommon.TxConfirmed, BroadcastAt: &broadcast, InitialBroadcastAt: &broadcast, + ChainID: testutils.FixtureChainID, } attemptHash := insertTxAndAttemptWithIdempotencyKey(t, txStore, tx, idempotencyKey) // Insert receipt for finalized block num @@ -186,6 +190,7 @@ func TestFinalizer_MarkTxFinalized(t *testing.T) { State: txmgrcommon.TxConfirmed, BroadcastAt: &broadcast, InitialBroadcastAt: &broadcast, + ChainID: testutils.FixtureChainID, } attemptHash = insertTxAndAttemptWithIdempotencyKey(t, txStore, tx, idempotencyKey) // Insert receipt for finalized block num diff --git a/pkg/txmgr/nonce_tracker_test.go b/pkg/txmgr/nonce_tracker_test.go index d91ee1979e..3a2b20d6fa 100644 --- a/pkg/txmgr/nonce_tracker_test.go +++ b/pkg/txmgr/nonce_tracker_test.go @@ -3,7 +3,6 @@ package txmgr_test import ( "errors" "fmt" - "math/big" "math/rand" "testing" @@ -27,7 +26,7 @@ func TestNonceTracker_LoadSequenceMap(t *testing.T) { t.Parallel() ctx := tests.Context(t) - chainID := big.NewInt(0) + chainID := testutils.FixtureChainID txStore := txstoremock.NewEvmTxStore(t) client := clienttest.NewClient(t) @@ -78,7 +77,7 @@ func TestNonceTracker_syncOnChain(t *testing.T) { t.Parallel() ctx := tests.Context(t) - chainID := big.NewInt(0) + chainID := testutils.FixtureChainID txStore := txstoremock.NewEvmTxStore(t) client := clienttest.NewClient(t) @@ -134,7 +133,7 @@ func TestNonceTracker_SyncSequence(t *testing.T) { t.Parallel() ctx := tests.Context(t) - chainID := big.NewInt(0) + chainID := testutils.FixtureChainID txStore := txstoremock.NewEvmTxStore(t) client := clienttest.NewClient(t) @@ -181,7 +180,7 @@ func TestNonceTracker_GetNextSequence(t *testing.T) { t.Parallel() ctx := tests.Context(t) - chainID := big.NewInt(0) + chainID := testutils.FixtureChainID txStore := txstoremock.NewEvmTxStore(t) client := clienttest.NewClient(t) @@ -231,7 +230,7 @@ func TestNonceTracker_GenerateNextSequence(t *testing.T) { t.Parallel() ctx := tests.Context(t) - chainID := big.NewInt(0) + chainID := testutils.FixtureChainID txStore := txstoremock.NewEvmTxStore(t) client := clienttest.NewClient(t) @@ -260,7 +259,7 @@ func Test_SetNonceAfterInit(t *testing.T) { t.Parallel() ctx := tests.Context(t) - chainID := big.NewInt(0) + chainID := testutils.FixtureChainID db := testutils.NewSqlxDB(t) txStore := txmgr.NewTxStore(db, logger.Test(t)) diff --git a/pkg/txmgr/resender_test.go b/pkg/txmgr/resender_test.go index bc29376aaf..5d8e826700 100644 --- a/pkg/txmgr/resender_test.go +++ b/pkg/txmgr/resender_test.go @@ -1,7 +1,6 @@ package txmgr_test import ( - "math/big" "testing" "time" @@ -41,7 +40,7 @@ func Test_EthResender_resendUnconfirmed(t *testing.T) { fromAddress := memKS.MustCreate(t) fromAddress2 := memKS.MustCreate(t) fromAddress3 := memKS.MustCreate(t) - ethKeyStore := keys.NewChainStore(memKS, big.NewInt(0)) + ethKeyStore := keys.NewChainStore(memKS, testutils.FixtureChainID) txStore := txmgrtest.NewTestTxStore(t, db) @@ -67,7 +66,7 @@ func Test_EthResender_resendUnconfirmed(t *testing.T) { addr3TxesRawHex = append(addr3TxesRawHex, hexutil.Encode(etx.TxAttempts[0].SignedRawTx)) } - er := txmgr.NewEvmResender(lggr, txStore, txmgr.NewEvmTxmClient(ethClient, nil), txmgr.NewEvmTracker(txStore, ethKeyStore, big.NewInt(0), lggr), ethKeyStore, 100*time.Millisecond, ccfg.EVM(), ccfg.EVM().Transactions()) + er := txmgr.NewEvmResender(lggr, txStore, txmgr.NewEvmTxmClient(ethClient, nil), txmgr.NewEvmTracker(txStore, ethKeyStore, testutils.FixtureChainID, lggr), ethKeyStore, 100*time.Millisecond, ccfg.EVM(), ccfg.EVM().Transactions()) var resentHex = make(map[string]struct{}) ethClient.On("BatchCallContextAll", mock.Anything, mock.MatchedBy(func(elems []rpc.BatchElem) bool { @@ -108,13 +107,13 @@ func Test_EthResender_alertUnconfirmed(t *testing.T) { ethClient := clienttest.NewClientWithDefaultChainID(t) memKS := keystest.NewMemoryChainStore() fromAddress := memKS.MustCreate(t) - ethKeyStore := keys.NewChainStore(memKS, big.NewInt(0)) + ethKeyStore := keys.NewChainStore(memKS, testutils.FixtureChainID) ethClient.On("IsL2").Return(false).Maybe() // Set this to the smallest non-zero value possible for the attempt to be eligible for resend delay := commonconfig.MustNewDuration(1 * time.Nanosecond) ccfg := testutils.NewTestChainScopedConfig(t, func(c *toml.EVMConfig) { - c.Chain = toml.Defaults(ubig.New(big.NewInt(0)), &toml.Chain{ + c.Chain = toml.Defaults(ubig.New(testutils.FixtureChainID), &toml.Chain{ Transactions: toml.Transactions{ResendAfterThreshold: delay}, }) }) @@ -122,7 +121,7 @@ func Test_EthResender_alertUnconfirmed(t *testing.T) { txStore := txmgrtest.NewTestTxStore(t, db) originalBroadcastAt := time.Unix(1616509100, 0) - er := txmgr.NewEvmResender(lggr, txStore, txmgr.NewEvmTxmClient(ethClient, nil), txmgr.NewEvmTracker(txStore, ethKeyStore, big.NewInt(0), lggr), ethKeyStore, 100*time.Millisecond, ccfg.EVM(), ccfg.EVM().Transactions()) + er := txmgr.NewEvmResender(lggr, txStore, txmgr.NewEvmTxmClient(ethClient, nil), txmgr.NewEvmTracker(txStore, ethKeyStore, testutils.FixtureChainID, lggr), ethKeyStore, 100*time.Millisecond, ccfg.EVM(), ccfg.EVM().Transactions()) t.Run("alerts only once for unconfirmed transaction attempt within the unconfirmedTxAlertDelay duration", func(t *testing.T) { _ = txmgrtest.MustInsertUnconfirmedEthTxWithBroadcastLegacyAttempt(t, txStore, int64(1), fromAddress, originalBroadcastAt) @@ -153,7 +152,7 @@ func Test_EthResender_Start(t *testing.T) { txStore := txmgrtest.NewTestTxStore(t, db) memKS := keystest.NewMemoryChainStore() fromAddress := memKS.MustCreate(t) - ethKeyStore := keys.NewChainStore(memKS, big.NewInt(0)) + ethKeyStore := keys.NewChainStore(memKS, testutils.FixtureChainID) lggr := logger.Test(t) t.Run("resends transactions that have been languishing unconfirmed for too long", func(t *testing.T) { @@ -161,7 +160,7 @@ func Test_EthResender_Start(t *testing.T) { ethClient := clienttest.NewClientWithDefaultChainID(t) ethClient.On("IsL2").Return(false).Maybe() - er := txmgr.NewEvmResender(lggr, txStore, txmgr.NewEvmTxmClient(ethClient, nil), txmgr.NewEvmTracker(txStore, ethKeyStore, big.NewInt(0), lggr), ethKeyStore, 100*time.Millisecond, ccfg.EVM(), ccfg.EVM().Transactions()) + er := txmgr.NewEvmResender(lggr, txStore, txmgr.NewEvmTxmClient(ethClient, nil), txmgr.NewEvmTracker(txStore, ethKeyStore, testutils.FixtureChainID, lggr), ethKeyStore, 100*time.Millisecond, ccfg.EVM(), ccfg.EVM().Transactions()) originalBroadcastAt := time.Unix(1616509100, 0) etx := txmgrtest.MustInsertUnconfirmedEthTxWithBroadcastLegacyAttempt(t, txStore, 0, fromAddress, originalBroadcastAt) diff --git a/pkg/txmgr/tracker_test.go b/pkg/txmgr/tracker_test.go index 7480a851e7..61352efce6 100644 --- a/pkg/txmgr/tracker_test.go +++ b/pkg/txmgr/tracker_test.go @@ -23,7 +23,7 @@ import ( func newTestEvmTrackerSetup(t *testing.T) (*txmgr.Tracker, txmgr.TestEvmTxStore) { db := testutils.NewSqlxDB(t) txStore := txmgrtest.NewTestTxStore(t, db) - chainID := big.NewInt(0) + chainID := testutils.FixtureChainID memKS := keystest.NewMemoryChainStore() addr1 := memKS.MustCreate(t) addr2 := memKS.MustCreate(t) diff --git a/pkg/txmgr/txmgr_test.go b/pkg/txmgr/txmgr_test.go index 9ae4f1c866..593ad4a861 100644 --- a/pkg/txmgr/txmgr_test.go +++ b/pkg/txmgr/txmgr_test.go @@ -107,7 +107,7 @@ func TestTxm_SendNativeToken_DoesNotSendToZero(t *testing.T) { txm, err := makeTestEvmTxm(t, db, ethClient, estimator, evmConfig, evmConfig.GasEstimator(), evmConfig.Transactions(), dbConfig, dbConfig.Listener(), &keystest.FakeChainStore{}) require.NoError(t, err) - _, err = txm.SendNativeToken(tests.Context(t), big.NewInt(0), from, to, *value, 21000) + _, err = txm.SendNativeToken(tests.Context(t), testutils.FixtureChainID, from, to, *value, 21000) require.Error(t, err) require.EqualError(t, err, "cannot send native token to zero address") } @@ -119,7 +119,7 @@ func TestTxm_CreateTransaction(t *testing.T) { txStore := txmgrtest.NewTestTxStore(t, db) memKS := keystest.NewMemoryChainStore() fromAddress := memKS.MustCreate(t) - ethKeyStore := keys.NewChainStore(memKS, big.NewInt(0)) + ethKeyStore := keys.NewChainStore(memKS, testutils.FixtureChainID) toAddress := testutils.NewAddress() gasLimit := uint64(1000) @@ -395,7 +395,7 @@ func BenchmarkCreateTransaction(b *testing.B) { config, dbConfig, evmConfig := txmgr.MakeTestConfigs(b) ethClient := clienttest.NewClient(b) - ethClient.On("ConfiguredChainID").Return(big.NewInt(0)).Maybe() + ethClient.On("ConfiguredChainID").Return(testutils.FixtureChainID).Maybe() estimator, err := gas.NewEstimator(logger.Test(b), ethClient, config.ChainType(), ethClient.ConfiguredChainID(), evmConfig.GasEstimator(), nil) require.NoError(b, err) @@ -433,7 +433,7 @@ func TestTxm_CreateTransaction_OutOfEth(t *testing.T) { memKS := keystest.NewMemoryChainStore() fromAddress := memKS.MustCreate(t) otherAddress := memKS.MustCreate(t) - ethKeyStore := keys.NewChainStore(memKS, big.NewInt(0)) + ethKeyStore := keys.NewChainStore(memKS, testutils.FixtureChainID) gasLimit := uint64(1000) toAddress := testutils.NewAddress() @@ -567,7 +567,7 @@ func TestTxm_Reset(t *testing.T) { memKS := keystest.NewMemoryChainStore() addr := memKS.MustCreate(t) addr2 := memKS.MustCreate(t) - ethKeyStore := keys.NewChainStore(memKS, big.NewInt(0)) + ethKeyStore := keys.NewChainStore(memKS, testutils.FixtureChainID) txStore := txmgrtest.NewTestTxStore(t, db) // 4 confirmed tx from addr1 @@ -632,7 +632,7 @@ func TestTxm_GetTransactionFee(t *testing.T) { db := testutils.NewSqlxDB(t) txStore := txmgrtest.NewTestTxStore(t, db) memKS := keystest.NewMemoryChainStore() - ethKeyStore := keys.NewChainStore(memKS, big.NewInt(0)) + ethKeyStore := keys.NewChainStore(memKS, testutils.FixtureChainID) feeLimit := uint64(10_000) _, dbConfig, evmConfig := txmgr.MakeTestConfigs(t) @@ -678,6 +678,7 @@ func TestTxm_GetTransactionFee(t *testing.T) { EncodedPayload: []byte{1, 2, 3}, FeeLimit: feeLimit, State: txmgrcommon.TxUnstarted, + ChainID: testutils.FixtureChainID, } err := txStore.InsertTx(ctx, tx) require.NoError(t, err) @@ -710,6 +711,7 @@ func TestTxm_GetTransactionFee(t *testing.T) { State: txmgrcommon.TxFinalized, BroadcastAt: &broadcast, InitialBroadcastAt: &broadcast, + ChainID: testutils.FixtureChainID, } err := txStore.InsertTx(ctx, tx) require.NoError(t, err) @@ -737,7 +739,7 @@ func TestTxm_GetTransactionStatus(t *testing.T) { db := testutils.NewSqlxDB(t) txStore := txmgrtest.NewTestTxStore(t, db) memKS := keystest.NewMemoryChainStore() - ethKeyStore := keys.NewChainStore(memKS, big.NewInt(0)) + ethKeyStore := keys.NewChainStore(memKS, testutils.FixtureChainID) feeLimit := uint64(10_000) _, dbConfig, evmConfig := txmgr.MakeTestConfigs(t) @@ -784,6 +786,7 @@ func TestTxm_GetTransactionStatus(t *testing.T) { EncodedPayload: []byte{1, 2, 3}, FeeLimit: feeLimit, State: txmgrcommon.TxUnstarted, + ChainID: testutils.FixtureChainID, } err := txStore.InsertTx(ctx, tx) require.NoError(t, err) @@ -803,6 +806,7 @@ func TestTxm_GetTransactionStatus(t *testing.T) { EncodedPayload: []byte{1, 2, 3}, FeeLimit: feeLimit, State: txmgrcommon.TxInProgress, + ChainID: testutils.FixtureChainID, } err := txStore.InsertTx(ctx, tx) require.NoError(t, err) @@ -825,6 +829,7 @@ func TestTxm_GetTransactionStatus(t *testing.T) { State: txmgrcommon.TxUnconfirmed, BroadcastAt: &broadcast, InitialBroadcastAt: &broadcast, + ChainID: testutils.FixtureChainID, } err := txStore.InsertTx(ctx, tx) require.NoError(t, err) @@ -847,6 +852,7 @@ func TestTxm_GetTransactionStatus(t *testing.T) { State: txmgrcommon.TxConfirmed, BroadcastAt: &broadcast, InitialBroadcastAt: &broadcast, + ChainID: testutils.FixtureChainID, } err := txStore.InsertTx(ctx, tx) require.NoError(t, err) @@ -876,6 +882,7 @@ func TestTxm_GetTransactionStatus(t *testing.T) { State: txmgrcommon.TxFinalized, BroadcastAt: &broadcast, InitialBroadcastAt: &broadcast, + ChainID: testutils.FixtureChainID, } err := txStore.InsertTx(ctx, tx) require.NoError(t, err) @@ -905,6 +912,7 @@ func TestTxm_GetTransactionStatus(t *testing.T) { State: txmgrcommon.TxConfirmedMissingReceipt, BroadcastAt: &broadcast, InitialBroadcastAt: &broadcast, + ChainID: testutils.FixtureChainID, } err := txStore.InsertTx(ctx, tx) require.NoError(t, err) @@ -929,6 +937,7 @@ func TestTxm_GetTransactionStatus(t *testing.T) { Error: null.NewString(evmclient.TerminallyStuckMsg, true), BroadcastAt: &broadcast, InitialBroadcastAt: &broadcast, + ChainID: testutils.FixtureChainID, } err := txStore.InsertTx(ctx, tx) require.NoError(t, err) @@ -951,6 +960,7 @@ func TestTxm_GetTransactionStatus(t *testing.T) { Error: null.NewString(terminallyStuckClientError, true), BroadcastAt: &broadcast, InitialBroadcastAt: &broadcast, + ChainID: testutils.FixtureChainID, } err = txStore.InsertTx(ctx, tx) require.NoError(t, err) @@ -971,6 +981,7 @@ func TestTxm_GetTransactionStatus(t *testing.T) { FeeLimit: feeLimit, State: txmgrcommon.TxFatalError, Error: null.NewString(errorMsg, true), + ChainID: testutils.FixtureChainID, } err := txStore.InsertTx(ctx, tx) require.NoError(t, err) @@ -1065,7 +1076,7 @@ func mustInsertUnconfirmedEthTxWithBroadcastDynamicFeeAttempt(t *testing.T, txSt addr := testutils.NewAddress() dtx := types.DynamicFeeTx{ - ChainID: big.NewInt(0), + ChainID: testutils.FixtureChainID, Nonce: uint64(nonce), GasTipCap: big.NewInt(1), GasFeeCap: big.NewInt(1), @@ -1127,6 +1138,7 @@ func mustInsertConfirmedMissingReceiptEthTxWithLegacyAttempt( require.NoError(t, txStore.InsertTx(ctx, &etx)) attempt := txmgrtest.NewLegacyEthTxAttempt(t, etx.ID) attempt.BroadcastBeforeBlockNum = &broadcastBeforeBlockNum + attempt.Tx.ChainID = testutils.FixtureChainID attempt.State = txmgrtypes.TxAttemptBroadcast require.NoError(t, txStore.InsertTxAttempt(ctx, &attempt)) etx.TxAttempts = append(etx.TxAttempts, attempt) @@ -1145,6 +1157,7 @@ func mustInsertInProgressEthTxWithAttempt(t testing.TB, txStore txmgr.TestEvmTxS rlp := new(bytes.Buffer) require.NoError(t, tx.EncodeRLP(rlp)) attempt.SignedRawTx = rlp.Bytes() + attempt.Tx.ChainID = testutils.FixtureChainID attempt.State = txmgrtypes.TxAttemptInProgress require.NoError(t, txStore.InsertTxAttempt(ctx, &attempt)) var err error diff --git a/pkg/txmgr/txmgrtest/utils.go b/pkg/txmgr/txmgrtest/utils.go index 54f337d001..8a6e926347 100644 --- a/pkg/txmgr/txmgrtest/utils.go +++ b/pkg/txmgr/txmgrtest/utils.go @@ -35,6 +35,7 @@ func NewEthTx(fromAddress common.Address) txmgr.Tx { Value: big.Int(assets.NewEthValue(142)), FeeLimit: uint64(1000000000), State: txmgrcommon.TxUnstarted, + ChainID: evmtestutils.FixtureChainID, } } From a0b320cdf511a7cacec1a2b485504a412d1064da Mon Sep 17 00:00:00 2001 From: vreff <104409744+vreff@users.noreply.github.com> Date: Tue, 2 Sep 2025 20:22:13 -0400 Subject: [PATCH 4/7] more test fixes --- pkg/heads/saver_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/heads/saver_test.go b/pkg/heads/saver_test.go index ff83910b06..a4633f566d 100644 --- a/pkg/heads/saver_test.go +++ b/pkg/heads/saver_test.go @@ -12,11 +12,11 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/utils/tests" evmheads "github.com/smartcontractkit/chainlink-evm/pkg/heads" + ubig "github.com/smartcontractkit/chainlink-evm/pkg/utils/big" "github.com/smartcontractkit/chainlink-evm/pkg/testutils" evmtypes "github.com/smartcontractkit/chainlink-evm/pkg/types" "github.com/smartcontractkit/chainlink-evm/pkg/utils" - ubig "github.com/smartcontractkit/chainlink-evm/pkg/utils/big" ) type trackerConfig struct { @@ -121,7 +121,7 @@ func TestHeadSaver_Load(t *testing.T) { // H2Uncle // newHead := func(num int, parent common.Hash) *evmtypes.Head { - h := evmtypes.NewHead(big.NewInt(int64(num)), utils.NewHash(), parent, ubig.NewI(0)) + h := evmtypes.NewHead(big.NewInt(int64(num)), utils.NewHash(), parent, ubig.New(testutils.FixtureChainID)) return &h } h0 := newHead(0, utils.NewHash()) From 2bbe8e27125f56885633810496b83c88656c2d4c Mon Sep 17 00:00:00 2001 From: vreff <104409744+vreff@users.noreply.github.com> Date: Tue, 2 Sep 2025 20:54:47 -0400 Subject: [PATCH 5/7] fix lint, fix method name for go-ethereum JSON RPC mapping --- pkg/client/chain_client_test.go | 2 +- pkg/txmgr/evm_tx_store_test.go | 6 +++--- pkg/txmgr/txmgr_test.go | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pkg/client/chain_client_test.go b/pkg/client/chain_client_test.go index 9470d2679d..1a08a1ec4e 100644 --- a/pkg/client/chain_client_test.go +++ b/pkg/client/chain_client_test.go @@ -504,7 +504,7 @@ type sendTxService struct { sentCount atomic.Int32 } -func (x *sendTxService) ChainID(ctx context.Context) (*hexutil.Big, error) { +func (x *sendTxService) ChainId(ctx context.Context) (*hexutil.Big, error) { return (*hexutil.Big)(x.chainID), nil } diff --git a/pkg/txmgr/evm_tx_store_test.go b/pkg/txmgr/evm_tx_store_test.go index 24364db083..c1594fd829 100644 --- a/pkg/txmgr/evm_tx_store_test.go +++ b/pkg/txmgr/evm_tx_store_test.go @@ -650,7 +650,7 @@ func Test_FindTxWithIdempotencyKey(t *testing.T) { t.Run("returns nil error if no results", func(t *testing.T) { idempotencyKey := "777" - etx, err := txStore.FindTxWithIdempotencyKey(tests.Context(t), idempotencyKey, testutils.FixtureChainID) + etx, err := txStore.FindTxWithIdempotencyKey(t.Context(), idempotencyKey, testutils.FixtureChainID) require.NoError(t, err) assert.Nil(t, etx) }) @@ -662,7 +662,7 @@ func Test_FindTxWithIdempotencyKey(t *testing.T) { txRequestWithIdempotencyKey(idempotencyKey)) require.Equal(t, idempotencyKey, *etx.IdempotencyKey) - res, err := txStore.FindTxWithIdempotencyKey(tests.Context(t), idempotencyKey, testutils.FixtureChainID) + res, err := txStore.FindTxWithIdempotencyKey(t.Context(), idempotencyKey, testutils.FixtureChainID) require.NoError(t, err) assert.Equal(t, etx.Sequence, res.Sequence) require.Equal(t, idempotencyKey, *res.IdempotencyKey) @@ -679,7 +679,7 @@ func Test_FindReceiptWithIdempotencyKey(t *testing.T) { idempotencyKey := "654" t.Run("returns nil error if no results", func(t *testing.T) { - r, err := txStore.FindReceiptWithIdempotencyKey(tests.Context(t), idempotencyKey, testutils.FixtureChainID) + r, err := txStore.FindReceiptWithIdempotencyKey(t.Context(), idempotencyKey, testutils.FixtureChainID) require.NoError(t, err) assert.Nil(t, r) }) diff --git a/pkg/txmgr/txmgr_test.go b/pkg/txmgr/txmgr_test.go index 593ad4a861..84e35b697d 100644 --- a/pkg/txmgr/txmgr_test.go +++ b/pkg/txmgr/txmgr_test.go @@ -107,7 +107,7 @@ func TestTxm_SendNativeToken_DoesNotSendToZero(t *testing.T) { txm, err := makeTestEvmTxm(t, db, ethClient, estimator, evmConfig, evmConfig.GasEstimator(), evmConfig.Transactions(), dbConfig, dbConfig.Listener(), &keystest.FakeChainStore{}) require.NoError(t, err) - _, err = txm.SendNativeToken(tests.Context(t), testutils.FixtureChainID, from, to, *value, 21000) + _, err = txm.SendNativeToken(t.Context(), testutils.FixtureChainID, from, to, *value, 21000) require.Error(t, err) require.EqualError(t, err, "cannot send native token to zero address") } From d6d3fc2e8ea562022f79453f643d6183b818cced Mon Sep 17 00:00:00 2001 From: vreff <104409744+vreff@users.noreply.github.com> Date: Tue, 2 Sep 2025 21:06:28 -0400 Subject: [PATCH 6/7] silence linter --- pkg/client/chain_client_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/pkg/client/chain_client_test.go b/pkg/client/chain_client_test.go index 1a08a1ec4e..8be608619a 100644 --- a/pkg/client/chain_client_test.go +++ b/pkg/client/chain_client_test.go @@ -504,6 +504,7 @@ type sendTxService struct { sentCount atomic.Int32 } +//nolint:revive // ChainId must match JSON-RPC method name eth_chainId, not ChainID func (x *sendTxService) ChainId(ctx context.Context) (*hexutil.Big, error) { return (*hexutil.Big)(x.chainID), nil } From 5f0035cefa5035d993c96b2fedbc27219037bce5 Mon Sep 17 00:00:00 2001 From: vreff <104409744+vreff@users.noreply.github.com> Date: Wed, 3 Sep 2025 09:36:42 -0400 Subject: [PATCH 7/7] add clarifying comment --- pkg/types/utils.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/types/utils.go b/pkg/types/utils.go index 60d02c4d91..33c5f0f9cd 100644 --- a/pkg/types/utils.go +++ b/pkg/types/utils.go @@ -14,4 +14,7 @@ func MustGetABI(json string) abi.ABI { return abi } +// NullClientChainID is set to a chainID that is unlikely to be used in production. +// It cannot be zero due to a breaking change in go-ethereum: +// https://github.com/ethereum/go-ethereum/blob/master/core/types/transaction_signing.go#L193 const NullClientChainID = 1399100