diff --git a/.github/workflows/bench.yml b/.github/workflows/bench.yml index 0b7a4a8ffa..3d6cb25bf4 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.9' + go-version: "~1.21.10" check-latest: true - run: go mod download shell: bash diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 33d5500ad7..0ec774044d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -4,11 +4,11 @@ on: workflow_dispatch: inputs: tag: - description: 'Tag to include in artifact name' + description: "Tag to include in artifact name" required: true push: tags: - - 'v[0-9]+.[0-9]+.[0-9]+' + - "v[0-9]+.[0-9]+.[0-9]+" jobs: release: @@ -23,7 +23,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v5 with: - go-version: '~1.21.9' + go-version: "~1.21.10" check-latest: true - name: Set up arm64 cross compiler run: | diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 7b7299762f..29ab02ce1c 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -5,11 +5,11 @@ on: branches: - master tags: - - '*' + - "*" pull_request: env: - min_go_version: '~1.21.9' + min_go_version: "~1.21.10" grafana_url: https://grafana-experimental.avax-dev.network/d/kBQpRdWnk/avalanche-main-dashboard?orgId=1&refresh=10s&var-filter=is_ephemeral_node%7C%3D%7Cfalse&var-filter=gh_repo%7C%3D%7Cava-labs%2Fsubnet-evm&var-filter=gh_run_id%7C%3D%7C${{ github.run_id }}&var-filter=gh_run_attempt%7C%3D%7C${{ github.run_attempt }} jobs: @@ -58,7 +58,7 @@ jobs: shell: bash - run: ./scripts/build_test.sh env: - TIMEOUT: ${{ env.TIMEOUT }} + TIMEOUT: ${{ env.TIMEOUT }} shell: bash - run: ./scripts/coverage.sh shell: bash diff --git a/Dockerfile b/Dockerfile index ff30c90589..c74583d595 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,7 +5,7 @@ ARG AVALANCHE_VERSION # ============= Compilation Stage ================ -FROM golang:1.21.9-bullseye AS builder +FROM golang:1.21.10-bullseye AS builder WORKDIR /build diff --git a/README.md b/README.md index dae472b8f0..597596373a 100644 --- a/README.md +++ b/README.md @@ -59,8 +59,9 @@ The Subnet EVM runs in a separate process from the main AvalancheGo process and [v0.6.0] AvalancheGo@v1.11.0-v1.11.1 (Protocol Version: 33) [v0.6.1] AvalancheGo@v1.11.0-v1.11.1 (Protocol Version: 33) [v0.6.2] AvalancheGo@v1.11.2 (Protocol Version: 34) -[v0.6.3] AvalancheGo@v1.11.3-v1.11.5 (Protocol Version: 35) -[v0.6.4] AvalancheGo@v1.11.3-v1.11.5 (Protocol Version: 35) +[v0.6.3] AvalancheGo@v1.11.3-v1.11.6 (Protocol Version: 35) +[v0.6.4] AvalancheGo@v1.11.3-v1.11.6 (Protocol Version: 35) +[v0.6.5] AvalancheGo@v1.11.3-v1.11.6 (Protocol Version: 35) ``` ## API @@ -100,7 +101,7 @@ To support these changes, there have been a number of changes to the SubnetEVM b ### Clone Subnet-evm -First install Go 1.21.9 or later. Follow the instructions [here](https://go.dev/doc/install). You can verify by running `go version`. +First install Go 1.21.10 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/compatibility.json b/compatibility.json index bc24c7d8a3..c06a645549 100644 --- a/compatibility.json +++ b/compatibility.json @@ -1,5 +1,6 @@ { "rpcChainVMProtocolVersion": { + "v0.6.5": 35, "v0.6.4": 35, "v0.6.3": 35, "v0.6.2": 34, @@ -45,4 +46,4 @@ "v0.1.1": 10, "v0.1.0": 9 } -} +} \ No newline at end of file diff --git a/core/state/snapshot/snapshot.go b/core/state/snapshot/snapshot.go index 9c2bac4c4a..01effb2040 100644 --- a/core/state/snapshot/snapshot.go +++ b/core/state/snapshot/snapshot.go @@ -568,9 +568,6 @@ func (t *Tree) AbortGeneration() { // for it to shutdown before returning (if it is running). This call should not // be made concurrently. func (dl *diskLayer) abortGeneration() bool { - dl.lock.Lock() - defer dl.lock.Unlock() - // Store ideal time for abort to get better estimate of load // // Note that we set this time regardless if abortion was skipped otherwise we @@ -580,7 +577,10 @@ func (dl *diskLayer) abortGeneration() bool { } // If the disk layer is running a snapshot generator, abort it - if dl.genAbort != nil && dl.genStats == nil { + dl.lock.RLock() + shouldAbort := dl.genAbort != nil && dl.genStats == nil + dl.lock.RUnlock() + if shouldAbort { abort := make(chan struct{}) dl.genAbort <- abort <-abort diff --git a/go.mod b/go.mod index e9e9f0659d..bd6fea0a61 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.21.10 require ( github.com/VictoriaMetrics/fastcache v1.12.1 - github.com/ava-labs/avalanchego v1.11.6-0.20240515173814-c68a07f7dc40 + github.com/ava-labs/avalanchego v1.11.6 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 @@ -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.4-geth-1.13.8 // indirect + github.com/ava-labs/coreth v0.13.4-rc.0 // 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 b11f12b1d8..9756d53584 100644 --- a/go.sum +++ b/go.sum @@ -56,10 +56,10 @@ github.com/ajg/form v1.5.1/go.mod h1:uL1WgH+h2mgNtvBq0339dVnzXdBETtL2LeUXaIv25UY github.com/allegro/bigcache v1.2.1-0.20190218064605-e24eb225f156 h1:eMwmnE/GDgah4HI848JfFxHt+iPb26b4zyfspmqY0/8= github.com/allegro/bigcache v1.2.1-0.20190218064605-e24eb225f156/go.mod h1:Cb/ax3seSYIx7SuZdm2G2xzfwmv3TPSk2ucNfQESPXM= github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= -github.com/ava-labs/avalanchego v1.11.6-0.20240515173814-c68a07f7dc40 h1:vH0n7GYHYwzRE08u26G+5+lnBxLekSNbHR4JonRxwEk= -github.com/ava-labs/avalanchego v1.11.6-0.20240515173814-c68a07f7dc40/go.mod h1:i7n85ExR039Txd/vaCBxhhli/yfeaAdZXT9PqR8g96g= -github.com/ava-labs/coreth v0.13.4-geth-1.13.8 h1:xMLf9C8Td9j95C5L128itRDpCnXD4VN3aAJd/wFRhSw= -github.com/ava-labs/coreth v0.13.4-geth-1.13.8/go.mod h1:mP1QRzaQKq+y+bqyx3xMR3/K/+TpjHbPJi+revI6Y38= +github.com/ava-labs/avalanchego v1.11.6 h1:gPWNQSV+bY3XW9OhfJ4wNwxp/qidTSHA4V+VYP8kWpQ= +github.com/ava-labs/avalanchego v1.11.6/go.mod h1:s8U9tOakcU6ftSL4JcRcFrNNYI5JbekNCjTkdqZWYdE= +github.com/ava-labs/coreth v0.13.4-rc.0 h1:UU7SOlLVeviT59Y+FyDyrdt0Wvl+SOj0EyET8ZtH1ZY= +github.com/ava-labs/coreth v0.13.4-rc.0/go.mod h1:mP1QRzaQKq+y+bqyx3xMR3/K/+TpjHbPJi+revI6Y38= 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= diff --git a/plugin/evm/syncervm_client.go b/plugin/evm/syncervm_client.go index bec4897341..6cd738b381 100644 --- a/plugin/evm/syncervm_client.go +++ b/plugin/evm/syncervm_client.go @@ -85,7 +85,7 @@ type StateSyncClient interface { ParseStateSummary(ctx context.Context, summaryBytes []byte) (block.StateSummary, error) // additional methods required by the evm package - StateSyncClearOngoingSummary() error + ClearOngoingSummary() error Shutdown() error Error() error } @@ -125,8 +125,8 @@ func (client *stateSyncerClient) GetOngoingSyncStateSummary(context.Context) (bl return summary, nil } -// StateSyncClearOngoingSummary clears any marker of an ongoing state sync summary -func (client *stateSyncerClient) StateSyncClearOngoingSummary() error { +// ClearOngoingSummary clears any marker of an ongoing state sync summary +func (client *stateSyncerClient) ClearOngoingSummary() error { if err := client.metadataDB.Delete(stateSyncSummaryKey); err != nil { return fmt.Errorf("failed to clear ongoing summary: %w", err) } @@ -167,12 +167,6 @@ func (client *stateSyncerClient) acceptSyncSummary(proposedSummary message.SyncS "lastAccepted", client.lastAcceptedHeight, "syncableHeight", proposedSummary.Height(), ) - if err := client.StateSyncClearOngoingSummary(); err != nil { - return block.StateSyncSkipped, fmt.Errorf("failed to clear ongoing summary after skipping state sync: %w", err) - } - // Initialize snapshots if we're skipping state sync, since it will not have been initialized on - // startup. - client.chain.BlockChain().InitializeSnapshots() return block.StateSyncSkipped, nil } diff --git a/plugin/evm/version.go b/plugin/evm/version.go index 145b585f01..9c908a91bd 100644 --- a/plugin/evm/version.go +++ b/plugin/evm/version.go @@ -11,7 +11,7 @@ var ( // GitCommit is set by the build script GitCommit string // Version is the version of Subnet EVM - Version string = "v0.6.4" + Version string = "v0.6.5" ) func init() { diff --git a/plugin/evm/vm.go b/plugin/evm/vm.go index 54f7c9449c..d461e8a767 100644 --- a/plugin/evm/vm.go +++ b/plugin/evm/vm.go @@ -610,7 +610,7 @@ func (vm *VM) initializeStateSyncClient(lastAcceptedHeight uint64) error { // If StateSync is disabled, clear any ongoing summary so that we will not attempt to resume // sync using a snapshot that has been modified by the node running normal operations. if !vm.config.StateSyncEnabled { - return vm.StateSyncClient.StateSyncClearOngoingSummary() + return vm.StateSyncClient.ClearOngoingSummary() } return nil @@ -665,6 +665,13 @@ func (vm *VM) SetState(_ context.Context, state snow.State) error { if err := vm.StateSyncClient.Error(); err != nil { return err } + // After starting bootstrapping, do not attempt to resume a previous state sync. + if err := vm.StateSyncClient.ClearOngoingSummary(); err != nil { + return err + } + // Ensure snapshots are initialized before bootstrapping (i.e., if state sync is skipped). + // Note calling this function has no effect if snapshots are already initialized. + vm.blockChain.InitializeSnapshots() return nil case snow.NormalOp: // Initialize goroutines related to block building once we enter normal operation as there is no need to handle mempool gossip before this point. diff --git a/scripts/versions.sh b/scripts/versions.sh index a0144ba8b7..b550af9cdd 100644 --- a/scripts/versions.sh +++ b/scripts/versions.sh @@ -4,8 +4,8 @@ # shellcheck disable=SC2034 # Don't export them as they're used in the context of other calls -AVALANCHE_VERSION=${AVALANCHE_VERSION:-'c68a07f7dc40'} +AVALANCHE_VERSION=${AVALANCHE_VERSION:-'v1.11.6'} GINKGO_VERSION=${GINKGO_VERSION:-'v2.2.0'} # This won't be used, but it's here to make code syncs easier -LATEST_CORETH_VERSION='0.13.1-rc.5' +LATEST_CORETH_VERSION='0.13.4'