Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
8e744a9
use libevm: params, core/vm, eth/tracers/* + some of core/types (#1380)
Dec 12, 2024
4b8f1dc
libevm phase 2: Use libevm statedb from upstream (#1421)
Jan 13, 2025
0d522e7
refactor: params.ChainConfigExtra & RulesExtra -> params/extras (core…
Feb 4, 2025
f83437d
chore(core): split out code in state_processor.go and state_processor…
qdm12 Feb 7, 2025
de68986
chore(core/types): remove `Blocks`'s `Timestamp()` method (#1429)
qdm12 Feb 7, 2025
4e746c8
Merge branch 'master' into libevm
qdm12 Mar 17, 2025
2c08400
chore(deps): use libevm avalanchego based on `v1.12.3-rc.1.0` (#1514)
qdm12 Mar 25, 2025
1366b3b
chore(metrics): use libevm metrics package (#1508)
qdm12 Apr 1, 2025
fd683d5
chore(core/types): code restructure to accomodate future libevm changes
qdm12 Feb 20, 2025
825153e
chore(all): remove vmerrs package
ceyonur Feb 24, 2025
9752746
chore(core/types): header JSON and RLP serialization hooks
Feb 25, 2025
5d6e078
chore(core/types): `Header` libevm `PostCopy` hook
qdm12 Feb 25, 2025
a1f212a
chore(core/types): remove block.go and import `Block` and `Body` from…
qdm12 Feb 28, 2025
38a9521
chore(core/rawdb): add `ExampleInspectDatabase` to check custom behavior
qdm12 Feb 28, 2025
292f3df
chore(core/rawdb): `InspectDatabase` uses libevm
qdm12 Mar 2, 2025
2768dd5
chore(core/rawdb): use libevm core/rawdb
qdm12 Mar 5, 2025
a183ff8
fix(core/evm): set difficulty post shanghai to 0
Mar 5, 2025
0ffb624
chore(rawdb): migration to plugin/evm/rawdb
qdm12 Mar 11, 2025
c74aa9e
refactor(core/types): add `WithHeaderExtra` helper function
qdm12 Mar 11, 2025
8664cbf
chore(ci): check gencodec generated files are up to date
qdm12 Mar 11, 2025
821575f
refactor(core/rawdb): table-driven `InspectDatabase` config
qdm12 Mar 11, 2025
dc4f237
chore(plugin/evm): log libevm version during VM init
ARR4N Mar 14, 2025
bded714
refactor(core/types): separate subnet-evm and upstream identifiers
qdm12 Mar 19, 2025
c5a9a76
chore: remove unused `libevm` directory
ARR4N Mar 14, 2025
f5364a1
chore: disallow direct `libevm/params` import
ARR4N Mar 14, 2025
b45b79a
refactor: use upstream `core/types`
ARR4N Mar 14, 2025
d393209
refactor: move `core/types` to `plugin/evm/types`
ARR4N Mar 14, 2025
4395f6e
chore(rawdb): move plugin/evm/rawdb to plugin/evm/customrawdb
qdm12 Mar 26, 2025
fa576f0
chore(interfaces): use upstream code
qdm12 Mar 26, 2025
d6e4708
chore(types): move plugin/evm/types to plugin/evm/customtypes
qdm12 Mar 26, 2025
08e92ea
chore(all): final changes to the libevm branch
qdm12 Mar 28, 2025
4f496a0
Merge branch 'master' into libevm
qdm12 Apr 2, 2025
220454e
fix(all): critical fixes to the libevm branch (#1551)
qdm12 Apr 15, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
36 changes: 35 additions & 1 deletion .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,40 @@ guidelines:
- Commit messages should be prefixed with the package(s) they modify.
- E.g. "eth, rpc: make trace configs optional"

### Mocks

Mocks are auto-generated using [mockgen](https://pkg.go.dev/go.uber.org/mock/mockgen) and `//go:generate` commands in the code.

- To **re-generate all mocks**, use the command below from the root of the project:

```sh
go generate -run "go.uber.org/mock/mockgen" ./...
```

- To **add** an interface that needs a corresponding mock generated:
- if the file `mocks_generate_test.go` exists in the package where the interface is located, either:
- modify its `//go:generate go run go.uber.org/mock/mockgen` to generate a mock for your interface (preferred); or
- add another `//go:generate go run go.uber.org/mock/mockgen` to generate a mock for your interface according to specific mock generation settings
- if the file `mocks_generate_test.go` does not exist in the package where the interface is located, create it with content (adapt as needed):

```go
// Copyright (C) 2019-2025, Ava Labs, Inc. All rights reserved.
// See the file LICENSE for licensing terms.

package mypackage

//go:generate go run go.uber.org/mock/mockgen -package=${GOPACKAGE} -destination=mocks_test.go . YourInterface
```

Notes:
1. Ideally generate all mocks to `mocks_test.go` for the package you need to use the mocks for and do not export mocks to other packages. This reduces package dependencies, reduces production code pollution and forces to have locally defined narrow interfaces.
1. Prefer using reflect mode to generate mocks than source mode, unless you need a mock for an unexported interface, which should be rare.
- To **remove** an interface from having a corresponding mock generated:
1. Edit the `mocks_generate_test.go` file in the directory where the interface is defined
1. If the `//go:generate` mockgen command line:
- generates a mock file for multiple interfaces, remove your interface from the line
- generates a mock file only for the interface, remove the entire line. If the file is empty, remove `mocks_generate_test.go` as well.

## Documentation guidelines

- Code should be well commented, so it is easier to read and maintain.
Expand All @@ -35,7 +69,7 @@ guidelines:
[commentary](https://go.dev/doc/effective_go#commentary) guidelines.
- Changes with user facing impact (e.g., addition or modification of flags and
options) should be accompanied by a link to a pull request to the [avalanche-docs](https://github.com/ava-labs/avalanche-docs)
repository. [example](https://github.com/ava-labs/avalanche-docs/pull/1119/files).
repository. [example](https://github.com/ava-labs/avalanche-docs/pull/1119/files).
- Changes that modify a package significantly or add new features should
either update the existing or include a new `README.md` file in that package.

Expand Down
1 change: 0 additions & 1 deletion .github/workflows/bench.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ jobs:
- uses: actions/setup-go@v4
with:
go-version: "~1.22.8"
check-latest: true
- run: go mod download
shell: bash
- run: ./scripts/build_bench_precompiles.sh
Expand Down
9 changes: 0 additions & 9 deletions .github/workflows/check-clean-branch.sh

This file was deleted.

12 changes: 8 additions & 4 deletions .github/workflows/publish_docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,17 @@ on:

jobs:
publish_docker_image:
name: Publish Docker Image
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Publish image to Dockerhub
- uses: docker/setup-qemu-action@v3
- uses: docker/setup-buildx-action@v3
- name: Build and publish images to DockerHub
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASS: ${{ secrets.DOCKER_PASS }}
DOCKER_REPO: "avaplatform/subnet-evm"
run: .github/workflows/publish_docker_image.sh ${{ inputs.vm_id }}
VM_ID: ${{ inputs.vm_id }}
PUBLISH: 1
PLATFORMS: "linux/amd64,linux/arm64"
run: scripts/build_docker_image.sh
35 changes: 0 additions & 35 deletions .github/workflows/publish_docker_image.sh

This file was deleted.

4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
workflow_dispatch:
inputs:
tag:
description: "Tag to include in artifact name"
description: "Tag to checkout & release"
required: true
push:
tags:
Expand All @@ -20,11 +20,11 @@ jobs:
with:
fetch-depth: 0
path: subnet-evm
ref: ${{ github.event.inputs.tag }}
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "~1.22.8"
check-latest: true
- name: Set up arm64 cross compiler
run: |
sudo apt-get -y update
Expand Down
36 changes: 14 additions & 22 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,11 @@ jobs:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- run: ./scripts/lint_allowed_geth_imports.sh
- run: ./scripts/lint_allowed_eth_imports.sh
shell: bash
- uses: actions/setup-go@v5
with:
go-version: ${{ env.min_go_version }}
check-latest: true
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
Expand All @@ -36,6 +35,10 @@ jobs:
- name: Run actionlint
shell: bash
run: scripts/actionlint.sh
- name: go mod tidy
run: |
go mod tidy
git diff --exit-code

unit_test:
name: Golang Unit Tests (${{ matrix.os }})
Expand All @@ -49,13 +52,19 @@ jobs:
- uses: actions/setup-go@v5
with:
go-version: ${{ env.min_go_version }}
check-latest: true
- name: Set timeout on Windows # Windows UT run slower and need a longer timeout
shell: bash
if: matrix.os == 'windows-latest'
run: echo "TIMEOUT=1200s" >> "$GITHUB_ENV"
- run: go mod download
shell: bash
- name: Mocks are up to date
shell: bash
run: |
grep -lr -E '^// Code generated by MockGen\. DO NOT EDIT\.$' . | xargs -r rm
go generate -run "go.uber.org/mock/mockgen" ./...
git add --intent-to-add --all
git diff --exit-code
- run: ./scripts/build.sh
shell: bash
- run: ./scripts/build_test.sh
Expand All @@ -77,7 +86,6 @@ jobs:
uses: actions/setup-go@v5
with:
go-version: ${{ env.min_go_version }}
check-latest: true
- name: Use Node.js
uses: actions/setup-node@v4
with:
Expand Down Expand Up @@ -119,7 +127,6 @@ jobs:
uses: actions/setup-go@v5
with:
go-version: ${{ env.min_go_version }}
check-latest: true
- name: Use Node.js
uses: actions/setup-node@v4
with:
Expand All @@ -140,7 +147,7 @@ jobs:
shell: bash
run: ./scripts/build.sh
- name: Run Warp E2E Tests
uses: ava-labs/avalanchego/.github/actions/[email protected].11-monitoring-url
uses: ava-labs/avalanchego/.github/actions/[email protected].13
with:
run: AVALANCHEGO_BUILD_PATH=/tmp/e2e-test/avalanchego ./scripts/run_ginkgo_warp.sh
prometheus_id: ${{ secrets.PROMETHEUS_ID || '' }}
Expand All @@ -164,15 +171,14 @@ jobs:
uses: actions/setup-go@v5
with:
go-version: ${{ env.min_go_version }}
check-latest: true
- name: Install AvalancheGo Release
shell: bash
run: BASEDIR=/tmp/e2e-test AVALANCHEGO_BUILD_PATH=/tmp/e2e-test/avalanchego ./scripts/install_avalanchego_release.sh
- name: Build Subnet-EVM Plugin Binary
shell: bash
run: ./scripts/build.sh
- name: Run E2E Load Tests
uses: ava-labs/avalanchego/.github/actions/[email protected].11-monitoring-url
uses: ava-labs/avalanchego/.github/actions/[email protected].13
with:
run: AVALANCHEGO_BUILD_PATH=/tmp/e2e-test/avalanchego ./scripts/run_ginkgo_load.sh
prometheus_id: ${{ secrets.PROMETHEUS_ID || '' }}
Expand All @@ -184,19 +190,6 @@ jobs:
if: always()
with:
name: load-tmpnet-data
mock_gen:
name: MockGen Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
go-version: ${{ env.min_go_version }}
check-latest: true
- shell: bash
run: scripts/mock.gen.sh
- shell: bash
run: .github/workflows/check-clean-branch.sh
test_build_image:
name: Image build
runs-on: ubuntu-latest
Expand All @@ -213,7 +206,6 @@ jobs:
- uses: actions/setup-go@v5
with:
go-version: ${{ env.min_go_version }}
check-latest: true
- 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
2 changes: 2 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,12 @@ builds:
overrides:
- goos: linux
goarch: arm64
goarm64: v8.0
env:
- CC=aarch64-linux-gnu-gcc
- goos: darwin
goarch: arm64
goarm64: v8.0
env:
- CC=oa64-clang
- goos: darwin
Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ The Subnet EVM runs in a separate process from the main AvalancheGo process and
[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)
```

## API
Expand Down
12 changes: 12 additions & 0 deletions RELEASES.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,18 @@

## Pending Release

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

### Updates

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

### Fixes

- Fixed database close on shutdown

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

This release focuses on Standalone DB and database configs.
Expand Down
4 changes: 2 additions & 2 deletions accounts/abi/abi.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ import (
"io"
"math/big"

"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ava-labs/libevm/common"
"github.com/ava-labs/libevm/crypto"
)

// The ABI holds information about a contract's context and available
Expand Down
2 changes: 1 addition & 1 deletion accounts/abi/abi_extra_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"strings"
"testing"

"github.com/ethereum/go-ethereum/common"
"github.com/ava-labs/libevm/common"
"github.com/stretchr/testify/require"
)

Expand Down
6 changes: 3 additions & 3 deletions accounts/abi/abi_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ import (
"strings"
"testing"

"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/math"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ava-labs/libevm/common"
"github.com/ava-labs/libevm/common/math"
"github.com/ava-labs/libevm/crypto"
"github.com/stretchr/testify/assert"
)

Expand Down
12 changes: 6 additions & 6 deletions accounts/abi/bind/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@ import (
"io"
"math/big"

"github.com/ava-labs/subnet-evm/accounts"
"github.com/ava-labs/subnet-evm/accounts/external"
"github.com/ava-labs/subnet-evm/accounts/keystore"
"github.com/ava-labs/libevm/accounts"
"github.com/ava-labs/libevm/accounts/external"
"github.com/ava-labs/libevm/accounts/keystore"
"github.com/ava-labs/libevm/common"
"github.com/ava-labs/libevm/crypto"
"github.com/ava-labs/libevm/log"
"github.com/ava-labs/subnet-evm/core/types"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/log"
)

// ErrNoChainID is returned whenever the user failed to specify a chain id.
Expand Down
2 changes: 1 addition & 1 deletion accounts/abi/bind/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ import (
"errors"
"math/big"

"github.com/ava-labs/libevm/common"
"github.com/ava-labs/subnet-evm/core/types"
"github.com/ava-labs/subnet-evm/interfaces"
"github.com/ethereum/go-ethereum/common"
)

var (
Expand Down
2 changes: 1 addition & 1 deletion accounts/abi/bind/backends/simulated.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ package backends
import (
"context"

"github.com/ava-labs/libevm/common"
"github.com/ava-labs/subnet-evm/accounts/abi/bind"
"github.com/ava-labs/subnet-evm/core/types"
"github.com/ava-labs/subnet-evm/ethclient/simulated"
"github.com/ava-labs/subnet-evm/interfaces"
"github.com/ethereum/go-ethereum/common"
)

// Verify that SimulatedBackend implements required interfaces
Expand Down
6 changes: 3 additions & 3 deletions accounts/abi/bind/base.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@ import (
"strings"
"sync"

"github.com/ava-labs/libevm/common"
"github.com/ava-labs/libevm/crypto"
"github.com/ava-labs/libevm/event"
"github.com/ava-labs/subnet-evm/accounts/abi"
"github.com/ava-labs/subnet-evm/core/types"
"github.com/ava-labs/subnet-evm/interfaces"
"github.com/ava-labs/subnet-evm/rpc"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/event"
)

const basefeeWiggleMultiplier = 2
Expand Down
Loading