Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update libevm branch with master branch #1484

Draft
wants to merge 60 commits into
base: libevm
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
ec46ce5
remove shared memory from precompiles and accept (#1383)
ceyonur Nov 13, 2024
981830e
Uptime tracking (#1263)
ceyonur Nov 13, 2024
fb40c50
Uptime tracking api (#1374)
ceyonur Nov 13, 2024
f1d549c
Sign validator uptime warp msg (#1367)
ceyonur Nov 13, 2024
f4e6b05
Use startimestamp (#1386)
ceyonur Nov 14, 2024
cc414c8
add db inspect (#1382)
ceyonur Nov 15, 2024
fad48ec
Refactor uptime tracking (#1388)
ceyonur Nov 15, 2024
0f3c513
rename sov to l1validator (#1387)
ceyonur Nov 15, 2024
4ef3c47
bump avago to v1.11.13-rc.1 (#1389)
ceyonur Nov 15, 2024
6083668
use nodeID filter and uptimePerc (#1390)
ceyonur Nov 19, 2024
038c939
bump avago to v1.11.13 (#1391)
ceyonur Nov 19, 2024
f339ea4
specify arm64 version in goreleaser (#1392)
darioush Nov 19, 2024
5853b9c
bump to latest avago (#1394)
ceyonur Nov 20, 2024
7eb3f81
chore: fix problematic const name and some typos in comment (#1400)
mountcount Dec 2, 2024
ee040d0
chore: fix some function names in interface comment (#1397)
chuangjinglu Dec 2, 2024
6c98da7
bump avago to v1.12.0 (#1402)
ceyonur Dec 5, 2024
843e3f7
close database on shutdown (#1403)
ceyonur Dec 10, 2024
ae4064a
bump versions (#1406)
ceyonur Dec 10, 2024
ea8a881
chore: fix some function names in comment (#1405)
guqicun Dec 12, 2024
72cacc3
Fix Typos in Documentation (#1404)
Dimitrolito Dec 12, 2024
665486f
mark flaky: TestTimedUnlock (#1411)
darioush Dec 18, 2024
b465ad5
bump avalanchego to master (updates x/crypto) (#1410)
darioush Dec 18, 2024
a99bc80
chore(ci): remove `check-latest: true` to ensure the specified Go ver…
qdm12 Dec 27, 2024
e0381a9
refactor trie_prefetcher to be similar to upstream structurally (#1395)
darioush Dec 30, 2024
e60bb75
add validators pkg readme (#1398)
ceyonur Dec 30, 2024
9d9cf92
add multiatch docker build to support arm (#1417)
ceyonur Jan 6, 2025
1fdaab7
chore(all): simplify mocks generation (#1413)
qdm12 Jan 7, 2025
9d4ef1a
Coreth sync (#1418)
ceyonur Jan 7, 2025
387bbc1
bump versions (#1419)
ceyonur Jan 7, 2025
bc91e40
docs(readme): fix build and tests workflow badge link (#1425)
Radovenchyk Jan 16, 2025
c16a9dc
chore: replaced the link with avalanche (#1423)
Radovenchyk Jan 16, 2025
68711e0
deprecate avago keystore (#1426)
arturrez Jan 22, 2025
195f473
refactor: align accounts/abi/bind with coreth+upstream (#1427)
darioush Jan 28, 2025
4648893
sync coreth changes up to 3148809 (#1434)
darioush Jan 29, 2025
77661b1
Remove legacy gossip (#1435)
alarso16 Jan 29, 2025
dc60ff7
Reduce magic numbers in dynamic fees (#1437)
StephenButtolph Jan 29, 2025
2136604
bump avalanchego to v1.12.2 (#1436)
ceyonur Jan 29, 2025
a1bfa0e
remove current state lock (#1438)
ceyonur Jan 30, 2025
b049381
pin goreleaser v2.5.1 (#1439)
darioush Feb 4, 2025
a6a3d33
chore: Bump avalanchego to master (#1443)
darioush Feb 24, 2025
95edaf0
chore(ci): use go.mod version and remove unused lint.sh (#1456)
ceyonur Mar 3, 2025
0f03de9
update ubuntu 20.04 to 22.04 (#1464)
ceyonur Mar 4, 2025
6839da2
use ctx in validatorsManager (#1465)
ceyonur Mar 4, 2025
70428c8
fix multiarch docker binary build (#1461)
ceyonur Mar 4, 2025
fdb279d
chore: fix some comments (#1431)
chuangjinglu Mar 4, 2025
a4c71b1
bump version to v0.7.2 (#1467)
ceyonur Mar 4, 2025
f6f17a7
fix go mod path (#1468)
ceyonur Mar 5, 2025
8a40954
eliminate an impossible error case from state.WriteState (#1473)
tsachiherman Mar 6, 2025
fe30ad7
refactor: use slices.Equal to simplify code (#1470)
huochexizhan Mar 10, 2025
c5a095e
[simulator] Fix wrong flag name in readme (#1476)
martineckardt Mar 10, 2025
fb35e42
Simplify avalanchego version maintenance (#1469)
maru-ava Mar 10, 2025
ecce706
[ci] Support providing avalanche version when triggering image build …
maru-ava Mar 10, 2025
90865da
[docker] Fix multi-arch builds for unmerged avalanchego versions (#1474)
maru-ava Mar 10, 2025
4780d74
remove ctx locks and use chain locks (#1483)
ceyonur Mar 10, 2025
5516d29
chore(ci): add merge groups (#1485)
ceyonur Mar 11, 2025
5f18e40
Merge branch 'master' into qdm12/libevm-master-merge
qdm12 Mar 10, 2025
950bafe
update after 0.7.2 release (#1486)
ceyonur Mar 11, 2025
0324458
Merge branch 'master' into qdm12/libevm/master-merge-1
qdm12 Mar 11, 2025
88182c1
Update avago 1.12.3 rc1 (#1492)
ceyonur Mar 12, 2025
b232ed7
Merge branch 'master' into qdm12/libevm/master-merge-1
qdm12 Mar 13, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/release_checklist.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@ Link the relevant documentation PRs for this release.
- [ ] Update AvalancheGo dependency in scripts/versions.sh for e2e tests.
- [ ] Add new entry in compatibility.json for RPCChainVM Compatibility
- [ ] Update AvalancheGo compatibility in README
- [ ] Deploy to WAGMI
- [ ] Deploy to Echo/Dispatch
- [ ] Confirm goreleaser job has successfully generated binaries by checking the releases page
8 changes: 5 additions & 3 deletions .github/workflows/bench.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,17 @@ name: Bench
on:
workflow_dispatch:
pull_request:
merge_group:
types: [checks_requested]

jobs:
bench:
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
- uses: actions/setup-go@v5
with:
go-version: "~1.22.8"
go-version-file: "go.mod"
- run: go mod download
shell: bash
- run: ./scripts/build_bench_precompiles.sh
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ on:
pull_request:
# The branches below must be a subset of the branches above
branches: [ master ]
merge_group:
types: [checks_requested]
schedule:
- cron: '44 11 * * 4'

Expand Down
8 changes: 7 additions & 1 deletion .github/workflows/publish_docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ on:
default: ''
required: false
type: string
avalanche_version:
description: 'The SHA or tag of avalanchego to use for the base image (must be compatible with the version in go.mod)'
default: ''
required: false
type: string

push:
tags:
Expand All @@ -26,8 +31,9 @@ jobs:
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASS: ${{ secrets.DOCKER_PASS }}
DOCKER_REPO: "avaplatform/subnet-evm"
IMAGE_NAME: "avaplatform/subnet-evm"
VM_ID: ${{ inputs.vm_id }}
PUBLISH: 1
PLATFORMS: "linux/amd64,linux/arm64"
AVALANCHE_VERSION: ${{ inputs.avalanche_version }}
run: scripts/build_docker_image.sh
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ on:
jobs:
release:
# needs: [lint_test, unit_test, e2e_test, simulator_test]
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- name: Git checkout
uses: actions/checkout@v4
Expand All @@ -24,7 +24,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "~1.22.8"
go-version-file: "./subnet-evm/go.mod"
- name: Set up arm64 cross compiler
run: |
sudo apt-get -y update
Expand All @@ -46,7 +46,7 @@ jobs:
uses: goreleaser/goreleaser-action@v3
with:
distribution: goreleaser
version: latest
version: v2.5.1
args: release --clean
workdir: ./subnet-evm/
env:
Expand Down
27 changes: 15 additions & 12 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,24 @@ on:
tags:
- "*"
pull_request:

env:
min_go_version: "~1.22.8"
merge_group:
types: [checks_requested]

jobs:
lint_test:
name: Lint
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: ./scripts/lint_allowed_eth_imports.sh
shell: bash
- uses: actions/setup-go@v5
with:
go-version: ${{ env.min_go_version }}
go-version-file: "go.mod"
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: v1.56
version: v1.63
working-directory: .
args: --timeout 10m
skip-pkg-cache: true
Expand All @@ -46,12 +45,12 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [macos-latest, ubuntu-20.04, ubuntu-latest, windows-latest]
os: [macos-latest, ubuntu-22.04, ubuntu-latest, windows-latest]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ env.min_go_version }}
go-version-file: "go.mod"
- name: Set timeout on Windows # Windows UT run slower and need a longer timeout
shell: bash
if: matrix.os == 'windows-latest'
Expand Down Expand Up @@ -85,7 +84,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.min_go_version }}
go-version-file: "go.mod"
- name: Use Node.js
uses: actions/setup-node@v4
with:
Expand Down Expand Up @@ -126,7 +125,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.min_go_version }}
go-version-file: "go.mod"
- name: Use Node.js
uses: actions/setup-node@v4
with:
Expand Down Expand Up @@ -170,7 +169,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.min_go_version }}
go-version-file: "go.mod"
- name: Install AvalancheGo Release
shell: bash
run: BASEDIR=/tmp/e2e-test AVALANCHEGO_BUILD_PATH=/tmp/e2e-test/avalanchego ./scripts/install_avalanchego_release.sh
Expand All @@ -195,6 +194,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install qemu (required for cross-platform builds)
run: |
sudo apt update
sudo apt -y install qemu-system qemu-user-static
- name: Check image build
shell: bash
run: bash -x scripts/tests.build_docker_image.sh
Expand All @@ -205,7 +208,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ env.min_go_version }}
go-version-file: "go.mod"
- name: Install AvalancheGo Release
shell: bash
run: BASEDIR=/tmp/e2e-test AVALANCHEGO_BUILD_PATH=/tmp/e2e-test/avalanchego ./scripts/install_avalanchego_release.sh
Expand Down
16 changes: 11 additions & 5 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,6 @@
run:
timeout: 10m
tests: true
# default is true. Enables skipping of directories:
# vendor$, third_party$, testdata$, examples$, Godeps$, builtin$
skip-dirs-use-default: true
# Include non-test files tagged as test-only.
# Context: https://github.com/ava-labs/avalanchego/pull/3173

linters:
disable-all: true
Expand All @@ -18,8 +13,19 @@ linters:
- ineffassign
- misspell
- unconvert
- typecheck
- unused
# - staticcheck
- bidichk
- durationcheck
- copyloopvar
- whitespace
# - revive # only certain checks enabled
- durationcheck
- gocheckcompilerdirectives
- reassign
- mirror
- tenv

linters-settings:
gofmt:
Expand Down
40 changes: 31 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,36 +1,58 @@
# syntax=docker/dockerfile:experimental

# ============= Setting up base Stage ================
# AVALANCHEGO_NODE_IMAGE needs to identify an existing node image and should include the tag
ARG AVALANCHEGO_NODE_IMAGE
# This value is not intended to be used but silences a warning
ARG AVALANCHEGO_NODE_IMAGE="invalid-image"

# ============= Compilation Stage ================
FROM golang:1.22.8-bullseye AS builder
FROM --platform=$BUILDPLATFORM golang:1.23.6-bullseye AS builder

WORKDIR /build

# Copy avalanche dependencies first (intermediate docker image caching)
# Copy avalanchego directory if present (for manual CI case, which uses local dependency)
COPY go.mod go.sum avalanchego* ./

# Download avalanche dependencies using go mod
RUN go mod download && go mod tidy -compat=1.22
RUN go mod download && go mod tidy

# Copy the code into the container
COPY . .

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


ARG TARGETPLATFORM
ARG BUILDPLATFORM

# Configure a cross-compiler if the target platform differs from the build platform.
#
# build_env.sh is used to capture the environmental changes required by the build step since RUN
# environment state is not otherwise persistent.
RUN if [ "$TARGETPLATFORM" = "linux/arm64" ] && [ "$BUILDPLATFORM" != "linux/arm64" ]; then \
apt-get update && apt-get install -y gcc-aarch64-linux-gnu && \
echo "export CC=aarch64-linux-gnu-gcc" > ./build_env.sh \
; elif [ "$TARGETPLATFORM" = "linux/amd64" ] && [ "$BUILDPLATFORM" != "linux/amd64" ]; then \
apt-get update && apt-get install -y gcc-x86-64-linux-gnu && \
echo "export CC=x86_64-linux-gnu-gcc" > ./build_env.sh \
; else \
echo "export CC=gcc" > ./build_env.sh \
; fi

# Pass in SUBNET_EVM_COMMIT as an arg to allow the build script to set this externally
ARG SUBNET_EVM_COMMIT
ARG CURRENT_BRANCH

RUN export SUBNET_EVM_COMMIT=$SUBNET_EVM_COMMIT && export CURRENT_BRANCH=$CURRENT_BRANCH && ./scripts/build.sh build/subnet-evm
RUN . ./build_env.sh && \
echo "{CC=$CC, TARGETPLATFORM=$TARGETPLATFORM, BUILDPLATFORM=$BUILDPLATFORM}" && \
export GOARCH=$(echo ${TARGETPLATFORM} | cut -d / -f2) && \
export CURRENT_BRANCH=$CURRENT_BRANCH && \
export SUBNET_EVM_COMMIT=$SUBNET_EVM_COMMIT && \
./scripts/build.sh build/subnet-evm

# ============= Cleanup Stage ================
FROM $AVALANCHEGO_NODE_IMAGE AS builtImage
FROM $AVALANCHEGO_NODE_IMAGE AS execution

# Copy the evm binary into the correct location in the container
ARG VM_ID=srEXiWaHuhNyGwPUi444Tu47ZEDwxTWrbQiuD7FmgSAQ6X7Dy
COPY --from=builder /build/build/subnet-evm /avalanchego/build/plugins/$VM_ID
ENV AVAGO_PLUGIN_DIR="/avalanchego/build/plugins"
COPY --from=builder /build/build/subnet-evm $AVAGO_PLUGIN_DIR/$VM_ID
26 changes: 7 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Subnet EVM

[![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)
[![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)
[![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)

[Avalanche](https://docs.avax.network/overview/getting-started/avalanche-platform) is a network composed of multiple blockchains.
[Avalanche](https://docs.avax.network/avalanche-l1s) is a network composed of multiple blockchains.
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.
That is, the VM defines the behavior of the blockchain.

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

```text
[v0.6.0] [email protected] (Protocol Version: 33)
[v0.6.1] [email protected] (Protocol Version: 33)
[v0.6.2] [email protected] (Protocol Version: 34)
[v0.6.3] [email protected] (Protocol Version: 35)
[v0.6.4] [email protected] (Protocol Version: 35)
[v0.6.5] [email protected] (Protocol Version: 35)
[v0.6.6] [email protected] (Protocol Version: 35)
[v0.6.7] [email protected] (Protocol Version: 35)
[v0.6.8] [email protected] (Protocol Version: 36)
[v0.6.9] [email protected] (Protocol Version: 37)
[v0.6.10] [email protected] (Protocol Version: 37)
[v0.6.11] [email protected] (Protocol Version: 37)
[v0.6.12] [email protected]/v1.12.0 (Protocol Version: 38)
[v0.7.0] [email protected] (Protocol Version: 38)
[v0.7.1] [email protected] (Protocol Version: 38)
[v0.7.1] [email protected] (Protocol Version: 39)
[v0.7.2] [email protected]/1.13.0-fuji (Protocol Version: 39)
```

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

### Clone Subnet-evm

First install Go 1.22.8 or later. Follow the instructions [here](https://go.dev/doc/install). You can verify by running `go version`.
First install Go 1.23.6 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`.

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

There are two options when using the Avalanche-CLI:

1. Use an official Subnet-EVM release: https://docs.avax.network/subnets/build-first-subnet
2. Build and deploy a locally built (and optionally modified) version of Subnet-EVM: https://docs.avax.network/subnets/create-custom-subnet
1. Use an official Subnet-EVM release: <https://docs.avax.network/subnets/build-first-subnet>
2. Build and deploy a locally built (and optionally modified) version of Subnet-EVM: <https://docs.avax.network/subnets/create-custom-subnet>
41 changes: 41 additions & 0 deletions RELEASES.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,47 @@

## Pending Release

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

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.**

### AvalancheGo Compatibility

The plugin version is unchanged at 39 and is compatible with AvalancheGo version v1.12.2.

### Updates

* Fixed concurrency issue in validators/uptime manager
* Bump golang version to v1.23.6
* Bump golangci-lint to v1.63 and add linters

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

This release focuses on code quality improvements and post-Etna cleanups.

### Compatibility

The plugin version is **updated** to 39 and is compatible with AvalancheGo version v1.12.2.

### Updates

* Moved client type and structs to new `plugin/evm/client` package
* Fixed statedb improper copy issue
* Limited the maximum number of query-able rewardPercentile by 100 in `eth_feeHistory` API
* Refactored `trie_prefetcher.go` to be structurally similar to upstream
* Removed deprecated legacy gossip handler and metrics
* Removed unnecessary locks in mempool

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

### Updates

- Changed default write option from `Sync` to `NoSync` in PebbleDB

### Fixes

- Fixed database close on shutdown

* Refactored trie_prefetcher.go to be structurally similar to upstream.

## [v0.7.0](https://github.com/ava-labs/subnet-evm/releases/tag/v0.7.0)
Expand Down
1 change: 0 additions & 1 deletion accounts/abi/abi_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1210,7 +1210,6 @@ func TestUnpackRevert(t *testing.T) {
{"4e487b7100000000000000000000000000000000000000000000000000000000000000ff", "unknown panic code: 0xff", nil},
}
for index, c := range cases {
index, c := index, c
t.Run(fmt.Sprintf("case %d", index), func(t *testing.T) {
t.Parallel()
got, err := UnpackRevert(common.Hex2Bytes(c.input))
Expand Down
Loading
Loading