Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
a816411
format: as coreth
Nov 6, 2024
8aacc88
use libevm: params, core/vm, eth/tracers/* + some of core/types (#662)
Nov 6, 2024
7466d8e
format: as subnet-evm
Nov 7, 2024
f8f2e7e
fix coreth formatting
Nov 7, 2024
104fe95
fix mocks
Nov 7, 2024
fe301ae
fix contract deployer allowlist
Nov 7, 2024
24fdbe3
nits
Nov 7, 2024
0ee0ee6
nits
Nov 7, 2024
be64eac
nit
Nov 7, 2024
fcc03ed
fix test import loop
Nov 7, 2024
7e10385
fix imports
Nov 7, 2024
b5b0939
nits
Nov 7, 2024
cfae5bc
fix
Nov 7, 2024
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)
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
00bf183
add TODO
Dec 2, 2024
75ce547
format: as coreth
Dec 2, 2024
1472487
rename: ethereum/go-ethereum -> ava-labs/libevm (#681)
Nov 7, 2024
bbd95fa
Remove IsProhibited (#682)
Nov 7, 2024
bfcc2f6
libevm renaming nits (#683)
Dec 2, 2024
6f3690a
Use upstream statedb
Dec 3, 2024
9a35d56
use libevm v1.13.14-0.1.0.rc-2 (#694)
Dec 2, 2024
c241eda
format: as subnet-evm
Dec 3, 2024
8da7527
fix lint
Dec 3, 2024
294b029
fixes for CI
Dec 3, 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
1f38e34
merge
Dec 12, 2024
665486f
mark flaky: TestTimedUnlock (#1411)
Dec 18, 2024
b465ad5
bump avalanchego to master (updates x/crypto) (#1410)
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)
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
4dbbf4e
bump avalanchego to compatible coreth version
Jan 9, 2025
29f1408
Merge branch 'master' of github.com:ava-labs/subnet-evm into use-libe…
Jan 9, 2025
28942af
update mocks
Jan 9, 2025
8245f1e
use ethmetrics
Jan 9, 2025
c56c5aa
update avalanchego dependency (no params import in coreth/atomic)
Jan 9, 2025
06d57e1
antithesis script patch: change dir for avalanchego build (for go.mod…
Jan 9, 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/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/accounts"
"github.com/ethereum/go-ethereum/accounts/external"
"github.com/ethereum/go-ethereum/accounts/keystore"
"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
Loading