From 002d8fe8aa37c275764a3d1e5a619e34e2555b35 Mon Sep 17 00:00:00 2001 From: Darioush Jalali Date: Thu, 3 Oct 2024 17:22:13 -0700 Subject: [PATCH] update to avalanchego master --- .github/workflows/bench.yml | 2 +- .github/workflows/release.yml | 2 +- .github/workflows/tests.yml | 2 +- Dockerfile | 2 +- README.md | 2 +- go.mod | 8 ++++---- go.sum | 12 ++++++------ internal/ethapi/api_test.go | 7 ++++++- params/config.go | 2 +- params/network_upgrades.go | 4 +++- params/network_upgrades_test.go | 4 ++-- scripts/versions.sh | 2 +- 12 files changed, 28 insertions(+), 21 deletions(-) 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..5d3673bacc 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 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/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/internal/ethapi/api_test.go b/internal/ethapi/api_test.go index d5a931ebc4..a02bc8b203 100644 --- a/internal/ethapi/api_test.go +++ b/internal/ethapi/api_test.go @@ -56,6 +56,7 @@ import ( "github.com/ava-labs/subnet-evm/internal/blocktest" "github.com/ava-labs/subnet-evm/params" "github.com/ava-labs/subnet-evm/rpc" + "github.com/ava-labs/subnet-evm/utils" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/hexutil" "github.com/ethereum/go-ethereum/crypto" @@ -788,12 +789,16 @@ func TestEstimateGas(t *testing.T) { } func TestCall(t *testing.T) { + // Enable BLOBHASH opcode in Cancun + cfg := *params.TestChainConfig + cfg.ShanghaiTime = utils.NewUint64(0) + cfg.CancunTime = utils.NewUint64(0) t.Parallel() // Initialize test accounts var ( accounts = newAccounts(3) genesis = &core.Genesis{ - Config: params.TestChainConfig, + Config: &cfg, Timestamp: uint64(upgrade.InitiallyActiveTime.Unix()), Alloc: types.GenesisAlloc{ accounts[0].addr: {Balance: big.NewInt(params.Ether)}, diff --git a/params/config.go b/params/config.go index 41db362e7e..8759ba565c 100644 --- a/params/config.go +++ b/params/config.go @@ -172,7 +172,7 @@ var ( NetworkUpgrades: NetworkUpgrades{ SubnetEVMTimestamp: utils.NewUint64(0), DurangoTimestamp: utils.NewUint64(0), - EtnaTimestamp: utils.NewUint64(0), + EtnaTimestamp: utils.TimeToNewUint64(upgrade.InitiallyActiveTime), }, GenesisPrecompiles: Precompiles{}, UpgradeConfig: UpgradeConfig{}, diff --git a/params/network_upgrades.go b/params/network_upgrades.go index 9b475c19d2..547908cb68 100644 --- a/params/network_upgrades.go +++ b/params/network_upgrades.go @@ -156,7 +156,9 @@ func verifyWithDefault(configTimestamp *uint64, defaultTimestamp *uint64) error return errCannotBeNil } - if *configTimestamp < *defaultTimestamp { + // Allow scheduling of UnscheduledActivationTime (or later) to an earlier time. + // This is to allow for the network upgrades to be scheduled in tests. + if *defaultTimestamp < uint64(upgrade.UnscheduledActivationTime.Unix()) && *configTimestamp < *defaultTimestamp { return fmt.Errorf("provided timestamp (%d) must be greater than or equal to the default timestamp (%d)", *configTimestamp, *defaultTimestamp) } return nil diff --git a/params/network_upgrades_test.go b/params/network_upgrades_test.go index 1a93a2587e..2524f06ac0 100644 --- a/params/network_upgrades_test.go +++ b/params/network_upgrades_test.go @@ -182,8 +182,8 @@ func TestVerifyNetworkUpgrades(t *testing.T) { name: "ValidNetworkUpgrades for custom network", upgrades: &NetworkUpgrades{ SubnetEVMTimestamp: utils.NewUint64(0), - DurangoTimestamp: utils.NewUint64(1607144400), - EtnaTimestamp: utils.NewUint64(1607144400), + DurangoTimestamp: utils.TimeToNewUint64(upgrade.InitiallyActiveTime), + EtnaTimestamp: utils.TimeToNewUint64(upgrade.UnscheduledActivationTime), }, avagoUpgrades: upgrade.GetConfig(1111), expected: true, 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