diff --git a/.github/workflows/bench.yml b/.github/workflows/bench.yml index 726c877428..7c7c833eb6 100644 --- a/.github/workflows/bench.yml +++ b/.github/workflows/bench.yml @@ -11,7 +11,7 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-go@v4 with: - go-version: "~1.21.12" + go-version: "~1.22.8" check-latest: true - run: go mod download shell: bash diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 21fff68b02..84113cffe1 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -23,7 +23,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v5 with: - go-version: "~1.21.12" + go-version: "~1.22.8" check-latest: true - name: Set up arm64 cross compiler run: | diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 526629f233..3540ea2616 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -9,7 +9,7 @@ on: pull_request: env: - min_go_version: "~1.21.12" + min_go_version: "~1.22.8" jobs: lint_test: diff --git a/Dockerfile b/Dockerfile index 2b08a3d49c..047144d21a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,7 +5,7 @@ ARG AVALANCHEGO_NODE_IMAGE # ============= Compilation Stage ================ -FROM golang:1.21.12-bullseye AS builder +FROM golang:1.22.8-bullseye AS builder WORKDIR /build @@ -14,7 +14,7 @@ WORKDIR /build COPY go.mod go.sum avalanchego* ./ # Download avalanche dependencies using go mod -RUN go mod download && go mod tidy -compat=1.21 +RUN go mod download && go mod tidy -compat=1.22 # Copy the code into the container COPY . . diff --git a/README.md b/README.md index 11fe3fb65e..efa120a578 100644 --- a/README.md +++ b/README.md @@ -68,7 +68,7 @@ To support these changes, there have been a number of changes to the SubnetEVM b ### Clone Subnet-evm -First install Go 1.21.12 or later. Follow the instructions [here](https://go.dev/doc/install). You can verify by running `go version`. +First install Go 1.22.8 or later. Follow the instructions [here](https://go.dev/doc/install). You can verify by running `go version`. Set `$GOPATH` environment variable properly for Go to look for Go Workspaces. Please read [this](https://go.dev/doc/code) for details. You can verify by running `echo $GOPATH`. diff --git a/accounts/abi/bind/bind_test.go b/accounts/abi/bind/bind_test.go index e2832add64..9179e369c4 100644 --- a/accounts/abi/bind/bind_test.go +++ b/accounts/abi/bind/bind_test.go @@ -2179,7 +2179,7 @@ func golangBindings(t *testing.T, overload bool) { if out, err := replacer.CombinedOutput(); err != nil { t.Fatalf("failed to replace binding test dependency to current source tree: %v\n%s", err, out) } - tidier := exec.Command(gocmd, "mod", "tidy", "-compat=1.21") + tidier := exec.Command(gocmd, "mod", "tidy", "-compat=1.22") tidier.Dir = pkg if out, err := tidier.CombinedOutput(); err != nil { t.Fatalf("failed to tidy Go module file: %v\n%s", err, out) diff --git a/accounts/abi/bind/precompilebind/precompile_bind_test.go b/accounts/abi/bind/precompilebind/precompile_bind_test.go index a1633388dc..f12170dede 100644 --- a/accounts/abi/bind/precompilebind/precompile_bind_test.go +++ b/accounts/abi/bind/precompilebind/precompile_bind_test.go @@ -695,7 +695,7 @@ func TestPrecompileBind(t *testing.T) { if out, err := replacer.CombinedOutput(); err != nil { t.Fatalf("failed to replace binding test dependency to current source tree: %v\n%s", err, out) } - tidier := exec.Command(gocmd, "mod", "tidy", "-compat=1.21") + tidier := exec.Command(gocmd, "mod", "tidy", "-compat=1.22") tidier.Dir = pkg if out, err := tidier.CombinedOutput(); err != nil { t.Fatalf("failed to tidy Go module file: %v\n%s", err, out) diff --git a/go.mod b/go.mod index cc35468149..f15a30e537 100644 --- a/go.mod +++ b/go.mod @@ -1,11 +1,11 @@ module github.com/ava-labs/subnet-evm -go 1.21.12 +go 1.22.8 require ( github.com/VictoriaMetrics/fastcache v1.12.1 github.com/antithesishq/antithesis-sdk-go v0.3.8 - github.com/ava-labs/avalanchego v1.11.11 + github.com/ava-labs/avalanchego v1.11.12-rc.2.0.20241003220930-43d5b435a644 github.com/cespare/cp v0.1.0 github.com/crate-crypto/go-ipa v0.0.0-20231025140028-3c0104f4b233 github.com/davecgh/go-spew v1.1.1 @@ -19,7 +19,7 @@ require ( github.com/go-cmd/cmd v1.4.1 github.com/google/uuid v1.6.0 github.com/gorilla/rpc v1.2.0 - github.com/gorilla/websocket v1.4.2 + github.com/gorilla/websocket v1.5.0 github.com/hashicorp/go-bexpr v0.1.10 github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d github.com/holiman/billy v0.0.0-20240216141850-2abb0c79d3c4 @@ -55,7 +55,7 @@ require ( require ( github.com/DataDog/zstd v1.5.2 // indirect github.com/NYTimes/gziphandler v1.1.1 // indirect - github.com/ava-labs/coreth v0.13.8-fixed-genesis-upgrade.0.20240815193440-a96bc921e732 // indirect + github.com/ava-labs/coreth v0.13.8 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/bits-and-blooms/bitset v1.10.0 // indirect github.com/btcsuite/btcd/btcec/v2 v2.3.2 // indirect diff --git a/go.sum b/go.sum index 32359d6de1..089fdbe3f5 100644 --- a/go.sum +++ b/go.sum @@ -58,10 +58,10 @@ github.com/allegro/bigcache v1.2.1-0.20190218064605-e24eb225f156/go.mod h1:Cb/ax github.com/antithesishq/antithesis-sdk-go v0.3.8 h1:OvGoHxIcOXFJLyn9IJQ5DzByZ3YVAWNBc394ObzDRb8= github.com/antithesishq/antithesis-sdk-go v0.3.8/go.mod h1:IUpT2DPAKh6i/YhSbt6Gl3v2yvUZjmKncl7U91fup7E= github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= -github.com/ava-labs/avalanchego v1.11.11 h1:MIQq8xRavRj4ZXHA4G+aMiymig7SOScGOG1SApmMvBc= -github.com/ava-labs/avalanchego v1.11.11/go.mod h1:yFx3V31Jy9NFa8GZlgGnwiVf8KGjeF2+Uc99l9Scd/8= -github.com/ava-labs/coreth v0.13.8-fixed-genesis-upgrade.0.20240815193440-a96bc921e732 h1:wlhGJbmb7s3bU2QWtxKjscGjfHknQiq+cVhhUjONsB8= -github.com/ava-labs/coreth v0.13.8-fixed-genesis-upgrade.0.20240815193440-a96bc921e732/go.mod h1:RkQLaQ961Xe/sUb3ycn4Qi18vPPuEetTqDf2eDcquAs= +github.com/ava-labs/avalanchego v1.11.12-rc.2.0.20241003220930-43d5b435a644 h1:F3SVwl0bmatEgtL7FeREoLOPGZkNCID6gQk94WmeCgY= +github.com/ava-labs/avalanchego v1.11.12-rc.2.0.20241003220930-43d5b435a644/go.mod h1:qSHmog3wMVjo/ruIAQo0ppXAilyni07NIu5K88RyhWE= +github.com/ava-labs/coreth v0.13.8 h1:f14X3KgwHl9LwzfxlN6S4bbn5VA2rhEsNnHaRLSTo/8= +github.com/ava-labs/coreth v0.13.8/go.mod h1:t3BSv/eQv0AlDPMfEDCMMoD/jq1RkUsbFzQAFg5qBcE= github.com/aymerick/raymond v2.0.3-0.20180322193309-b565731e1464+incompatible/go.mod h1:osfaiScAUVup+UC9Nfq76eWqDhXlp+4UYaA8uhTBO6g= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= @@ -325,8 +325,8 @@ github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB7 github.com/gorilla/rpc v1.2.0 h1:WvvdC2lNeT1SP32zrIce5l0ECBfbAlmrmSBsuc57wfk= github.com/gorilla/rpc v1.2.0/go.mod h1:V4h9r+4sF5HnzqbwIez0fKSpANP0zlYd3qR7p36jkTQ= github.com/gorilla/websocket v1.4.1/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= -github.com/gorilla/websocket v1.4.2 h1:+/TMaTYc4QFitKJxsQ7Yye35DkWvkdLcvGKqM+x0Ufc= -github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= +github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc= +github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 h1:Ovs26xHkKqVztRpIrF/92BcuyuQ/YW4NSIpoGtfXNho= github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= github.com/grpc-ecosystem/grpc-gateway/v2 v2.16.0 h1:YBftPWNWd4WwGqtY2yeZL2ef8rHAxPBD8KFhJpmcqms= diff --git a/params/config.go b/params/config.go index 1131ccdee8..69ec9d3262 100644 --- a/params/config.go +++ b/params/config.go @@ -48,24 +48,6 @@ var ( FeeConfig: DefaultFeeConfig, AllowFeeRecipients: false, - HomesteadBlock: big.NewInt(0), - EIP150Block: big.NewInt(0), - EIP155Block: big.NewInt(0), - EIP158Block: big.NewInt(0), - ByzantiumBlock: big.NewInt(0), - ConstantinopleBlock: big.NewInt(0), - PetersburgBlock: big.NewInt(0), - IstanbulBlock: big.NewInt(0), - MuirGlacierBlock: big.NewInt(0), - NetworkUpgrades: getDefaultNetworkUpgrades(upgrade.GetConfig(constants.MainnetID)), // This can be changed to correct network (local, test) via VM. - GenesisPrecompiles: Precompiles{}, - } - - TestChainConfig = &ChainConfig{ - AvalancheContext: AvalancheContext{utils.TestSnowContext()}, - ChainID: big.NewInt(1), - FeeConfig: DefaultFeeConfig, - AllowFeeRecipients: false, HomesteadBlock: big.NewInt(0), EIP150Block: big.NewInt(0), EIP155Block: big.NewInt(0), @@ -77,11 +59,8 @@ var ( MuirGlacierBlock: big.NewInt(0), BerlinBlock: big.NewInt(0), LondonBlock: big.NewInt(0), - ShanghaiTime: utils.TimeToNewUint64(upgrade.GetConfig(constants.UnitTestID).DurangoTime), - CancunTime: utils.TimeToNewUint64(upgrade.GetConfig(constants.UnitTestID).EtnaTime), - NetworkUpgrades: getDefaultNetworkUpgrades(upgrade.GetConfig(constants.UnitTestID)), // This can be changed to correct network (local, test) via VM. + NetworkUpgrades: getDefaultNetworkUpgrades(upgrade.GetConfig(constants.MainnetID)), // This can be changed to correct network (local, test) via VM. GenesisPrecompiles: Precompiles{}, - UpgradeConfig: UpgradeConfig{}, } TestPreSubnetEVMChainConfig = &ChainConfig{ @@ -150,10 +129,10 @@ var ( MuirGlacierBlock: big.NewInt(0), BerlinBlock: big.NewInt(0), LondonBlock: big.NewInt(0), - ShanghaiTime: utils.NewUint64(0), + ShanghaiTime: utils.TimeToNewUint64(upgrade.InitiallyActiveTime), NetworkUpgrades: NetworkUpgrades{ SubnetEVMTimestamp: utils.NewUint64(0), - DurangoTimestamp: utils.NewUint64(0), + DurangoTimestamp: utils.TimeToNewUint64(upgrade.InitiallyActiveTime), EtnaTimestamp: utils.TimeToNewUint64(upgrade.UnscheduledActivationTime), }, GenesisPrecompiles: Precompiles{}, @@ -176,17 +155,19 @@ var ( MuirGlacierBlock: big.NewInt(0), BerlinBlock: big.NewInt(0), LondonBlock: big.NewInt(0), - ShanghaiTime: utils.NewUint64(0), - CancunTime: utils.NewUint64(0), + ShanghaiTime: utils.TimeToNewUint64(upgrade.InitiallyActiveTime), + CancunTime: utils.TimeToNewUint64(upgrade.InitiallyActiveTime), NetworkUpgrades: NetworkUpgrades{ SubnetEVMTimestamp: utils.NewUint64(0), - DurangoTimestamp: utils.NewUint64(0), - EtnaTimestamp: utils.NewUint64(0), + DurangoTimestamp: utils.TimeToNewUint64(upgrade.InitiallyActiveTime), + EtnaTimestamp: utils.TimeToNewUint64(upgrade.InitiallyActiveTime), }, GenesisPrecompiles: Precompiles{}, UpgradeConfig: UpgradeConfig{}, } - TestRules = TestChainConfig.Rules(new(big.Int), 0) + + TestChainConfig = TestEtnaChainConfig + TestRules = TestChainConfig.Rules(new(big.Int), 0) ) // ChainConfig is the core config which determines the blockchain settings. diff --git a/params/network_upgrades_test.go b/params/network_upgrades_test.go index 1a93a2587e..d476ff66be 100644 --- a/params/network_upgrades_test.go +++ b/params/network_upgrades_test.go @@ -7,6 +7,7 @@ import ( "testing" "github.com/ava-labs/avalanchego/upgrade" + "github.com/ava-labs/avalanchego/upgrade/upgradetest" "github.com/ava-labs/avalanchego/utils/constants" "github.com/ava-labs/subnet-evm/utils" "github.com/stretchr/testify/require" @@ -179,13 +180,13 @@ func TestVerifyNetworkUpgrades(t *testing.T) { expected bool }{ { - name: "ValidNetworkUpgrades for custom network", + name: "ValidNetworkUpgrades for latest network", upgrades: &NetworkUpgrades{ SubnetEVMTimestamp: utils.NewUint64(0), DurangoTimestamp: utils.NewUint64(1607144400), EtnaTimestamp: utils.NewUint64(1607144400), }, - avagoUpgrades: upgrade.GetConfig(1111), + avagoUpgrades: upgradetest.GetConfig(upgradetest.Latest), expected: true, }, { diff --git a/plugin/evm/vm_test.go b/plugin/evm/vm_test.go index 934a999684..13a22a8e81 100644 --- a/plugin/evm/vm_test.go +++ b/plugin/evm/vm_test.go @@ -145,7 +145,6 @@ func NewContext() *snow.Context { ctx.ChainID = testCChainID ctx.AVAXAssetID = testAvaxAssetID ctx.XChainID = testXChainID - ctx.NetworkUpgrades = upgrade.GetConfig(testNetworkID) aliaser := ctx.BCLookup.(ids.Aliaser) _ = aliaser.Alias(testCChainID, "C") _ = aliaser.Alias(testCChainID, testCChainID.String()) diff --git a/scripts/versions.sh b/scripts/versions.sh index e76d3bbad6..d5783f2838 100644 --- a/scripts/versions.sh +++ b/scripts/versions.sh @@ -4,7 +4,7 @@ # shellcheck disable=SC2034 # Don't export them as they're used in the context of other calls -AVALANCHE_VERSION=${AVALANCHE_VERSION:-'v1.11.11'} +AVALANCHE_VERSION=${AVALANCHE_VERSION:-'43d5b435'} GINKGO_VERSION=${GINKGO_VERSION:-'v2.2.0'} # This won't be used, but it's here to make code syncs easier diff --git a/utils/snow.go b/utils/snow.go index 2042c9ff2d..f7e194ef7e 100644 --- a/utils/snow.go +++ b/utils/snow.go @@ -8,7 +8,7 @@ import ( "github.com/ava-labs/avalanchego/ids" "github.com/ava-labs/avalanchego/snow" "github.com/ava-labs/avalanchego/snow/validators/validatorstest" - "github.com/ava-labs/avalanchego/upgrade" + "github.com/ava-labs/avalanchego/upgrade/upgradetest" "github.com/ava-labs/avalanchego/utils/crypto/bls" "github.com/ava-labs/avalanchego/utils/logging" ) @@ -24,7 +24,7 @@ func TestSnowContext() *snow.Context { SubnetID: ids.Empty, ChainID: ids.Empty, NodeID: ids.EmptyNodeID, - NetworkUpgrades: upgrade.Default, + NetworkUpgrades: upgradetest.GetConfig(upgradetest.Latest), PublicKey: pk, Log: logging.NoLog{}, BCLookup: ids.NewAliaser(),