Skip to content

Commit 4e746c8

Browse files
committed
Merge branch 'master' into libevm
2 parents de68986 + 8d13faa commit 4e746c8

File tree

170 files changed

+5307
-2702
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

170 files changed

+5307
-2702
lines changed

.github/ISSUE_TEMPLATE/release_checklist.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,5 @@ Link the relevant documentation PRs for this release.
2626
- [ ] Update AvalancheGo dependency in scripts/versions.sh for e2e tests.
2727
- [ ] Add new entry in compatibility.json for RPCChainVM Compatibility
2828
- [ ] Update AvalancheGo compatibility in README
29-
- [ ] Deploy to WAGMI
29+
- [ ] Deploy to Echo/Dispatch
3030
- [ ] Confirm goreleaser job has successfully generated binaries by checking the releases page

.github/workflows/bench.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,17 @@ name: Bench
33
on:
44
workflow_dispatch:
55
pull_request:
6+
merge_group:
7+
types: [checks_requested]
68

79
jobs:
810
bench:
9-
runs-on: ubuntu-20.04
11+
runs-on: ubuntu-latest
1012
steps:
1113
- uses: actions/checkout@v4
12-
- uses: actions/setup-go@v4
14+
- uses: actions/setup-go@v5
1315
with:
14-
go-version: "~1.22.8"
16+
go-version-file: "go.mod"
1517
- run: go mod download
1618
shell: bash
1719
- run: ./scripts/build_bench_precompiles.sh

.github/workflows/codeql-analysis.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ on:
1717
pull_request:
1818
# The branches below must be a subset of the branches above
1919
branches: [ master ]
20+
merge_group:
21+
types: [checks_requested]
2022
schedule:
2123
- cron: '44 11 * * 4'
2224

.github/workflows/publish_docker.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@ on:
88
default: ''
99
required: false
1010
type: string
11+
avalanche_version:
12+
description: 'The SHA or tag of avalanchego to use for the base image (must be compatible with the version in go.mod)'
13+
default: ''
14+
required: false
15+
type: string
1116

1217
push:
1318
tags:
@@ -26,8 +31,9 @@ jobs:
2631
env:
2732
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
2833
DOCKER_PASS: ${{ secrets.DOCKER_PASS }}
29-
DOCKER_REPO: "avaplatform/subnet-evm"
34+
IMAGE_NAME: "avaplatform/subnet-evm"
3035
VM_ID: ${{ inputs.vm_id }}
3136
PUBLISH: 1
3237
PLATFORMS: "linux/amd64,linux/arm64"
38+
AVALANCHE_VERSION: ${{ inputs.avalanche_version }}
3339
run: scripts/build_docker_image.sh

.github/workflows/release.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ on:
1313
jobs:
1414
release:
1515
# needs: [lint_test, unit_test, e2e_test, simulator_test]
16-
runs-on: ubuntu-20.04
16+
runs-on: ubuntu-22.04
1717
steps:
1818
- name: Git checkout
1919
uses: actions/checkout@v4
@@ -24,7 +24,7 @@ jobs:
2424
- name: Set up Go
2525
uses: actions/setup-go@v5
2626
with:
27-
go-version: "~1.22.8"
27+
go-version-file: "./subnet-evm/go.mod"
2828
- name: Set up arm64 cross compiler
2929
run: |
3030
sudo apt-get -y update
@@ -46,7 +46,7 @@ jobs:
4646
uses: goreleaser/goreleaser-action@v3
4747
with:
4848
distribution: goreleaser
49-
version: latest
49+
version: v2.5.1
5050
args: release --clean
5151
workdir: ./subnet-evm/
5252
env:

.github/workflows/tests.yml

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,25 +7,24 @@ on:
77
tags:
88
- "*"
99
pull_request:
10-
11-
env:
12-
min_go_version: "~1.22.8"
10+
merge_group:
11+
types: [checks_requested]
1312

1413
jobs:
1514
lint_test:
1615
name: Lint
17-
runs-on: ubuntu-20.04
16+
runs-on: ubuntu-latest
1817
steps:
1918
- uses: actions/checkout@v4
2019
- run: ./scripts/lint_allowed_eth_imports.sh
2120
shell: bash
2221
- uses: actions/setup-go@v5
2322
with:
24-
go-version: ${{ env.min_go_version }}
23+
go-version-file: "go.mod"
2524
- name: golangci-lint
2625
uses: golangci/golangci-lint-action@v3
2726
with:
28-
version: v1.56
27+
version: v1.63
2928
working-directory: .
3029
args: --timeout 10m
3130
skip-pkg-cache: true
@@ -46,12 +45,12 @@ jobs:
4645
strategy:
4746
fail-fast: false
4847
matrix:
49-
os: [macos-latest, ubuntu-20.04, ubuntu-latest, windows-latest]
48+
os: [macos-latest, ubuntu-22.04, ubuntu-latest, windows-latest]
5049
steps:
5150
- uses: actions/checkout@v4
5251
- uses: actions/setup-go@v5
5352
with:
54-
go-version: ${{ env.min_go_version }}
53+
go-version-file: "go.mod"
5554
- name: Set timeout on Windows # Windows UT run slower and need a longer timeout
5655
shell: bash
5756
if: matrix.os == 'windows-latest'
@@ -85,7 +84,7 @@ jobs:
8584
- name: Set up Go
8685
uses: actions/setup-go@v5
8786
with:
88-
go-version: ${{ env.min_go_version }}
87+
go-version-file: "go.mod"
8988
- name: Use Node.js
9089
uses: actions/setup-node@v4
9190
with:
@@ -126,7 +125,7 @@ jobs:
126125
- name: Set up Go
127126
uses: actions/setup-go@v5
128127
with:
129-
go-version: ${{ env.min_go_version }}
128+
go-version-file: "go.mod"
130129
- name: Use Node.js
131130
uses: actions/setup-node@v4
132131
with:
@@ -170,7 +169,7 @@ jobs:
170169
- name: Set up Go
171170
uses: actions/setup-go@v5
172171
with:
173-
go-version: ${{ env.min_go_version }}
172+
go-version-file: "go.mod"
174173
- name: Install AvalancheGo Release
175174
shell: bash
176175
run: BASEDIR=/tmp/e2e-test AVALANCHEGO_BUILD_PATH=/tmp/e2e-test/avalanchego ./scripts/install_avalanchego_release.sh
@@ -195,6 +194,10 @@ jobs:
195194
runs-on: ubuntu-latest
196195
steps:
197196
- uses: actions/checkout@v4
197+
- name: Install qemu (required for cross-platform builds)
198+
run: |
199+
sudo apt update
200+
sudo apt -y install qemu-system qemu-user-static
198201
- name: Check image build
199202
shell: bash
200203
run: bash -x scripts/tests.build_docker_image.sh
@@ -205,7 +208,7 @@ jobs:
205208
- uses: actions/checkout@v4
206209
- uses: actions/setup-go@v5
207210
with:
208-
go-version: ${{ env.min_go_version }}
211+
go-version-file: "go.mod"
209212
- name: Install AvalancheGo Release
210213
shell: bash
211214
run: BASEDIR=/tmp/e2e-test AVALANCHEGO_BUILD_PATH=/tmp/e2e-test/avalanchego ./scripts/install_avalanchego_release.sh

.golangci.yml

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,6 @@
33
run:
44
timeout: 10m
55
tests: true
6-
# default is true. Enables skipping of directories:
7-
# vendor$, third_party$, testdata$, examples$, Godeps$, builtin$
8-
skip-dirs-use-default: true
9-
# Include non-test files tagged as test-only.
10-
# Context: https://github.com/ava-labs/avalanchego/pull/3173
116

127
linters:
138
disable-all: true
@@ -18,8 +13,19 @@ linters:
1813
- ineffassign
1914
- misspell
2015
- unconvert
16+
- typecheck
2117
- unused
18+
# - staticcheck
19+
- bidichk
20+
- durationcheck
21+
- copyloopvar
2222
- whitespace
23+
# - revive # only certain checks enabled
24+
- durationcheck
25+
- gocheckcompilerdirectives
26+
- reassign
27+
- mirror
28+
- tenv
2329

2430
linters-settings:
2531
gofmt:

Dockerfile

Lines changed: 31 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,58 @@
1-
# syntax=docker/dockerfile:experimental
2-
31
# ============= Setting up base Stage ================
42
# AVALANCHEGO_NODE_IMAGE needs to identify an existing node image and should include the tag
5-
ARG AVALANCHEGO_NODE_IMAGE
3+
# This value is not intended to be used but silences a warning
4+
ARG AVALANCHEGO_NODE_IMAGE="invalid-image"
65

76
# ============= Compilation Stage ================
8-
FROM golang:1.22.8-bullseye AS builder
7+
FROM --platform=$BUILDPLATFORM golang:1.23.6-bullseye AS builder
98

109
WORKDIR /build
1110

1211
# Copy avalanche dependencies first (intermediate docker image caching)
1312
# Copy avalanchego directory if present (for manual CI case, which uses local dependency)
1413
COPY go.mod go.sum avalanchego* ./
15-
1614
# Download avalanche dependencies using go mod
17-
RUN go mod download && go mod tidy -compat=1.22
15+
RUN go mod download && go mod tidy
1816

1917
# Copy the code into the container
2018
COPY . .
2119

2220
# Ensure pre-existing builds are not available for inclusion in the final image
2321
RUN [ -d ./build ] && rm -rf ./build/* || true
2422

23+
24+
ARG TARGETPLATFORM
25+
ARG BUILDPLATFORM
26+
27+
# Configure a cross-compiler if the target platform differs from the build platform.
28+
#
29+
# build_env.sh is used to capture the environmental changes required by the build step since RUN
30+
# environment state is not otherwise persistent.
31+
RUN if [ "$TARGETPLATFORM" = "linux/arm64" ] && [ "$BUILDPLATFORM" != "linux/arm64" ]; then \
32+
apt-get update && apt-get install -y gcc-aarch64-linux-gnu && \
33+
echo "export CC=aarch64-linux-gnu-gcc" > ./build_env.sh \
34+
; elif [ "$TARGETPLATFORM" = "linux/amd64" ] && [ "$BUILDPLATFORM" != "linux/amd64" ]; then \
35+
apt-get update && apt-get install -y gcc-x86-64-linux-gnu && \
36+
echo "export CC=x86_64-linux-gnu-gcc" > ./build_env.sh \
37+
; else \
38+
echo "export CC=gcc" > ./build_env.sh \
39+
; fi
40+
2541
# Pass in SUBNET_EVM_COMMIT as an arg to allow the build script to set this externally
2642
ARG SUBNET_EVM_COMMIT
2743
ARG CURRENT_BRANCH
2844

29-
RUN export SUBNET_EVM_COMMIT=$SUBNET_EVM_COMMIT && export CURRENT_BRANCH=$CURRENT_BRANCH && ./scripts/build.sh build/subnet-evm
45+
RUN . ./build_env.sh && \
46+
echo "{CC=$CC, TARGETPLATFORM=$TARGETPLATFORM, BUILDPLATFORM=$BUILDPLATFORM}" && \
47+
export GOARCH=$(echo ${TARGETPLATFORM} | cut -d / -f2) && \
48+
export CURRENT_BRANCH=$CURRENT_BRANCH && \
49+
export SUBNET_EVM_COMMIT=$SUBNET_EVM_COMMIT && \
50+
./scripts/build.sh build/subnet-evm
3051

3152
# ============= Cleanup Stage ================
32-
FROM $AVALANCHEGO_NODE_IMAGE AS builtImage
53+
FROM $AVALANCHEGO_NODE_IMAGE AS execution
3354

3455
# Copy the evm binary into the correct location in the container
3556
ARG VM_ID=srEXiWaHuhNyGwPUi444Tu47ZEDwxTWrbQiuD7FmgSAQ6X7Dy
36-
COPY --from=builder /build/build/subnet-evm /avalanchego/build/plugins/$VM_ID
57+
ENV AVAGO_PLUGIN_DIR="/avalanchego/build/plugins"
58+
COPY --from=builder /build/build/subnet-evm $AVAGO_PLUGIN_DIR/$VM_ID

README.md

Lines changed: 7 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# Subnet EVM
22

3-
[![Build + Test + Release](https://github.com/ava-labs/subnet-evm/actions/workflows/lint-tests-release.yml/badge.svg)](https://github.com/ava-labs/subnet-evm/actions/workflows/lint-tests-release.yml)
3+
[![CI](https://github.com/ava-labs/subnet-evm/actions/workflows/ci.yml/badge.svg)](https://github.com/ava-labs/subnet-evm/actions/workflows/ci.yml)
44
[![CodeQL](https://github.com/ava-labs/subnet-evm/actions/workflows/codeql-analysis.yml/badge.svg)](https://github.com/ava-labs/subnet-evm/actions/workflows/codeql-analysis.yml)
55

6-
[Avalanche](https://docs.avax.network/overview/getting-started/avalanche-platform) is a network composed of multiple blockchains.
6+
[Avalanche](https://docs.avax.network/avalanche-l1s) is a network composed of multiple blockchains.
77
Each blockchain is an instance of a Virtual Machine (VM), much like an object in an object-oriented language is an instance of a class.
88
That is, the VM defines the behavior of the blockchain.
99

@@ -18,21 +18,9 @@ The Subnet EVM runs in a separate process from the main AvalancheGo process and
1818
### AvalancheGo Compatibility
1919

2020
```text
21-
[v0.6.0] [email protected] (Protocol Version: 33)
22-
[v0.6.1] [email protected] (Protocol Version: 33)
23-
[v0.6.2] [email protected] (Protocol Version: 34)
24-
[v0.6.3] [email protected] (Protocol Version: 35)
25-
[v0.6.4] [email protected] (Protocol Version: 35)
26-
[v0.6.5] [email protected] (Protocol Version: 35)
27-
[v0.6.6] [email protected] (Protocol Version: 35)
28-
[v0.6.7] [email protected] (Protocol Version: 35)
29-
[v0.6.8] [email protected] (Protocol Version: 36)
30-
[v0.6.9] [email protected] (Protocol Version: 37)
31-
[v0.6.10] [email protected] (Protocol Version: 37)
32-
[v0.6.11] [email protected] (Protocol Version: 37)
33-
[v0.6.12] [email protected]/v1.12.0 (Protocol Version: 38)
3421
[v0.7.0] [email protected] (Protocol Version: 38)
35-
[v0.7.1] [email protected] (Protocol Version: 38)
22+
[v0.7.1] [email protected] (Protocol Version: 39)
23+
[v0.7.2] [email protected]/1.13.0-fuji (Protocol Version: 39)
3624
```
3725

3826
## API
@@ -72,7 +60,7 @@ To support these changes, there have been a number of changes to the SubnetEVM b
7260

7361
### Clone Subnet-evm
7462

75-
First install Go 1.22.8 or later. Follow the instructions [here](https://go.dev/doc/install). You can verify by running `go version`.
63+
First install Go 1.23.6 or later. Follow the instructions [here](https://go.dev/doc/install). You can verify by running `go version`.
7664

7765
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`.
7866

@@ -96,5 +84,5 @@ To run a local network, it is recommended to use the [avalanche-cli](https://git
9684

9785
There are two options when using the Avalanche-CLI:
9886

99-
1. Use an official Subnet-EVM release: https://docs.avax.network/subnets/build-first-subnet
100-
2. Build and deploy a locally built (and optionally modified) version of Subnet-EVM: https://docs.avax.network/subnets/create-custom-subnet
87+
1. Use an official Subnet-EVM release: <https://docs.avax.network/subnets/build-first-subnet>
88+
2. Build and deploy a locally built (and optionally modified) version of Subnet-EVM: <https://docs.avax.network/subnets/create-custom-subnet>

RELEASES.md

Lines changed: 37 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,51 @@
22

33
## Pending Release
44

5-
* Refactored trie_prefetcher.go to be structurally similar to upstream.
5+
* * IMPORTANT: `eth_getProof` calls for historical state will be rejected by default.
6+
* On archive nodes (`"pruning-enabled": false`): queries for historical proofs for state older than approximately 24 hours preceding the last accepted block will be rejected by default. This can be adjusted with the new option `historical-proof-query-window` which defines the number of blocks before the last accepted block which should be accepted for state proof queries, or set to `0` to accept any block number state query (previous behavior).
7+
* On `pruning` nodes: queries for proofs past the tip buffer (32 blocks) will be rejected. This is in support of moving to a path based storage scheme, which does not support historical state proofs.
8+
* Added `Fortuna` upgrade as optional and defaulting to a `nil` timestamp.
9+
10+
## [v0.7.2](https://github.com/ava-labs/subnet-evm/releases/tag/v0.7.2)
11+
12+
This version is backwards compatible to [v0.7.0](https://github.com/ava-labs/subnet-evm/releases/tag/v0.7.0). It is optional, **but strongly encouraged as it's fixing an important bug in uptime tracking.**
13+
14+
### AvalancheGo Compatibility
15+
16+
The plugin version is unchanged at 39 and is compatible with AvalancheGo version v1.12.2.
17+
18+
### Updates
19+
20+
* Fixed concurrency issue in validators/uptime manager
21+
* Bump golang version to v1.23.6
22+
* Bump golangci-lint to v1.63 and add linters
23+
24+
## [v0.7.1](https://github.com/ava-labs/subnet-evm/releases/tag/v0.7.1)
25+
26+
This release focuses on code quality improvements and post-Etna cleanups.
27+
28+
### Compatibility
29+
30+
The plugin version is **updated** to 39 and is compatible with AvalancheGo version v1.12.2.
31+
32+
### Updates
33+
34+
* Moved client type and structs to new `plugin/evm/client` package
35+
* Fixed statedb improper copy issue
36+
* Limited the maximum number of query-able rewardPercentile by 100 in `eth_feeHistory` API
37+
* Refactored `trie_prefetcher.go` to be structurally similar to upstream
38+
* Removed deprecated legacy gossip handler and metrics
39+
* Removed unnecessary locks in mempool
640

741
## [v0.7.0](https://github.com/ava-labs/subnet-evm/releases/tag/v0.7.0)
842

943
### Updates
1044

11-
- Changed default write option from `Sync` to `NoSync` in PebbleDB
45+
* Changed default write option from `Sync` to `NoSync` in PebbleDB
1246

1347
### Fixes
1448

15-
- Fixed database close on shutdown
49+
* Fixed database close on shutdown
1650

1751
## [v0.6.11](https://github.com/ava-labs/subnet-evm/releases/tag/v0.6.11)
1852

accounts/abi/abi_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1210,7 +1210,6 @@ func TestUnpackRevert(t *testing.T) {
12101210
{"4e487b7100000000000000000000000000000000000000000000000000000000000000ff", "unknown panic code: 0xff", nil},
12111211
}
12121212
for index, c := range cases {
1213-
index, c := index, c
12141213
t.Run(fmt.Sprintf("case %d", index), func(t *testing.T) {
12151214
t.Parallel()
12161215
got, err := UnpackRevert(common.Hex2Bytes(c.input))

0 commit comments

Comments
 (0)