Skip to content

Commit 789efec

Browse files
committed
Merge branch 'main' into arr4n/jumptable-override
2 parents e2e9330 + 5c66352 commit 789efec

File tree

826 files changed

+3965
-3644
lines changed

Some content is hidden

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

826 files changed

+3965
-3644
lines changed

.github/workflows/go.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,25 @@ name: Go
22

33
on:
44
push:
5-
branches: [ libevm ]
5+
branches: [ main ]
66
pull_request:
7-
branches: [ libevm ]
7+
branches: [ main ]
88
workflow_dispatch:
99

1010
jobs:
1111
go_test_short:
12+
env:
13+
FLAKY_REGEX: 'ava-labs/libevm/(eth|eth/tracers/js|eth/tracers/logger|accounts/abi/bind|accounts/keystore|eth/downloader|miner|ethclient|ethclient/gethclient|eth/catalyst)$'
1214
runs-on: ubuntu-latest
1315
steps:
1416
- uses: actions/checkout@v4
1517
- name: Set up Go
1618
uses: actions/setup-go@v5
1719
with:
1820
go-version: 1.21.4
19-
- name: Run tests
21+
- name: Run flaky tests sequentially
2022
run: | # Upstream flakes are race conditions exacerbated by concurrent tests
21-
FLAKY_REGEX='go-ethereum/(eth|eth/tracers/js|eth/tracers/logger|accounts/keystore|eth/downloader|miner|ethclient|ethclient/gethclient|eth/catalyst)$';
2223
go list ./... | grep -P "${FLAKY_REGEX}" | xargs -n 1 go test -short;
24+
- name: Run non-flaky tests concurrently
25+
run: |
2326
go test -short $(go list ./... | grep -Pv "${FLAKY_REGEX}");

.github/workflows/golangci-lint.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ name: golangci-lint
22

33
on:
44
push:
5-
branches: [ libevm ]
5+
branches: [ main ]
66
pull_request:
7-
branches: [ libevm ]
7+
branches: [ main ]
88
workflow_dispatch:
99

1010
permissions:

.github/workflows/libevm-delta.yml

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,16 @@ name: libevm delta
22

33
on:
44
push:
5-
branches: [ libevm ]
5+
branches: [ main ]
66
pull_request:
7-
branches: [ libevm ]
7+
branches: [ main ]
88
workflow_dispatch:
99

1010
jobs:
1111
diffs:
12+
env:
13+
# Last commit on `renamed-go-module` branch to be merged into `main`
14+
LIBEVM_BASE: a7f08d0e757d5a69d3e269c69dcea7e45bab97e3
1215
runs-on: ubuntu-latest
1316
steps:
1417
- uses: actions/checkout@v4
@@ -21,18 +24,19 @@ jobs:
2124
git config color.diff.old "#DC3220";
2225
git config color.diff.new "#005AB5";
2326
24-
- name: git diff libevm-base
27+
- name: git diff {LIBEVM_BASE}
2528
run: |
2629
git diff --diff-filter=a --word-diff --unified=0 --color=always \
27-
libevm-base \
30+
"${LIBEVM_BASE}" \
2831
':(exclude).golangci.yml' \
29-
':(exclude).github/**';
32+
':(exclude).github/**' \
33+
':(exclude)README.md';
3034
31-
- name: git diff libevm-base..libevm
35+
- name: git diff {LIBEVM_BASE}..main
3236
run: |
33-
git checkout libevm --;
37+
git checkout main --;
3438
git diff --diff-filter=a --word-diff --unified=0 --color=always \
35-
libevm-base \
39+
"${LIBEVM_BASE}" \
3640
':(exclude).golangci.yml' \
37-
':(exclude).github/**';
38-
41+
':(exclude).github/**' \
42+
':(exclude)README.md';
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
name: Rename Go module
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
source_commit:
7+
description: 'Upstream commit on which to base module renaming'
8+
required: true
9+
type: string
10+
default: '2bd6bd01d2e8561dd7fc21b631f4a34ac16627a1'
11+
12+
jobs:
13+
rename-module:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v4
17+
with:
18+
fetch-depth: 0 # everything
19+
20+
- name: Set variables
21+
id: vars
22+
# Including hashes of both the source commit and the workflow file makes
23+
# this idempotent.
24+
env:
25+
WORKFLOW_HASH: ${{ hashFiles('.github/workflows/rename-module.yml') }}
26+
run: |
27+
echo "WORKFLOW_HASH=${WORKFLOW_HASH}" >> "$GITHUB_OUTPUT";
28+
echo "DEST_BRANCH=auto-rename-module_source-${{ inputs.source_commit }}_workflow-${WORKFLOW_HASH}-${{ github.ref_name }}" \
29+
>> "$GITHUB_OUTPUT";
30+
31+
- name: Check out source commit
32+
run: git checkout ${{ inputs.source_commit }}
33+
34+
- name: Globally update module name
35+
run: |
36+
go mod edit -module github.com/ava-labs/libevm;
37+
find . -iname '*.go' -o -iname '*.txt' | xargs sed -i -E \
38+
's|(["`]github\.com/)ethereum/go-ethereum|\1ava-labs/libevm|g';
39+
40+
- name: Remnant references
41+
run: |
42+
find . -type f | \
43+
xargs grep -In github.com/ethereum/go-ethereum | \
44+
grep -v "https://github.com/ethereum/go-ethereum"
45+
46+
- name: Set up Go
47+
uses: actions/setup-go@v5
48+
with:
49+
go-version: 1.21.4
50+
51+
- name: Smoke tests
52+
# `go list` shows us the module name and grep will non-zero exit on mismatch
53+
# `go build` is a rudimentary but broad test of correctness
54+
# The explicitly tested packages are edge cases:
55+
# - bind generates tests and a go.mod on the fly
56+
# - rlpgen has testdata with imports that need updating
57+
run: |
58+
go list . | grep ava-labs/libevm;
59+
go build ./...;
60+
go test ./accounts/abi/bind ./rlp/rlpgen
61+
62+
- name: Create new branch
63+
env:
64+
BRANCH: ${{ steps.vars.outputs.DEST_BRANCH }}
65+
run: |
66+
git checkout -b "${BRANCH}";
67+
git push origin "${BRANCH}";
68+
69+
- name: Commit to new branch
70+
uses: planetscale/ghcommit-action@d4176bfacef926cc2db351eab20398dfc2f593b5 # v0.2.0
71+
env:
72+
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
73+
with:
74+
commit_message: "[AUTO] rename Go module + update internal import paths\n\nWorkflow: ${{ steps.vars.outputs.WORKFLOW_HASH }} on branch ${{ github.ref_name }}"
75+
repo: ${{ github.repository }}
76+
branch: ${{ steps.vars.outputs.DEST_BRANCH }}

.golangci.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,14 @@ linters-settings:
6161
gomodguard:
6262
blocked:
6363
modules:
64+
- github.com/ethereum/go-ethereum:
6465
- github.com/ava-labs/avalanchego:
6566
- github.com/ava-labs/coreth:
6667
- github.com/ava-labs/subnet-evm:
6768
revive:
6869
rules:
6970
- name: unused-parameter
70-
# Method parameters may be equired by interfaces and forcing them to be
71+
# Method parameters may be required by interfaces and forcing them to be
7172
# named _ is of questionable benefit.
7273
disabled: true
7374

@@ -84,6 +85,7 @@ issues:
8485
- gci
8586
- gofmt
8687
- goheader
88+
- goimports
8789
- gosec
8890
- gosimple
8991
- govet

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -361,4 +361,4 @@ The libevm (i) _additions_ to the go-ethereum library (i.e. all code in files wi
361361
be it a directory or file name); and (ii) _modifications_ to existing go-ethereum code; are licensed under the
362362
[GNU Lesser General Public License v3.0](https://www.gnu.org/licenses/lgpl-3.0.en.html),
363363
also included in our repository in the `COPYING.LESSER` file. A comprehensive outline of _modifications_ is
364-
produced by the [libevm delta workflow](https://github.com/ava-labs/go-ethereum/actions/workflows/libevm-delta.yml).
364+
produced by the [libevm delta workflow](https://github.com/ava-labs/libevm/actions/workflows/libevm-delta.yml).

accounts/abi/abi.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ import (
2424
"io"
2525
"math/big"
2626

27-
"github.com/ethereum/go-ethereum/common"
28-
"github.com/ethereum/go-ethereum/crypto"
27+
"github.com/ava-labs/libevm/common"
28+
"github.com/ava-labs/libevm/crypto"
2929
)
3030

3131
// The ABI holds information about a contract's context and available

accounts/abi/abi_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ import (
2626
"strings"
2727
"testing"
2828

29-
"github.com/ethereum/go-ethereum/common"
30-
"github.com/ethereum/go-ethereum/common/math"
31-
"github.com/ethereum/go-ethereum/crypto"
29+
"github.com/ava-labs/libevm/common"
30+
"github.com/ava-labs/libevm/common/math"
31+
"github.com/ava-labs/libevm/crypto"
3232
)
3333

3434
const jsondata = `

accounts/abi/bind/auth.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,13 @@ import (
2323
"io"
2424
"math/big"
2525

26-
"github.com/ethereum/go-ethereum/accounts"
27-
"github.com/ethereum/go-ethereum/accounts/external"
28-
"github.com/ethereum/go-ethereum/accounts/keystore"
29-
"github.com/ethereum/go-ethereum/common"
30-
"github.com/ethereum/go-ethereum/core/types"
31-
"github.com/ethereum/go-ethereum/crypto"
32-
"github.com/ethereum/go-ethereum/log"
26+
"github.com/ava-labs/libevm/accounts"
27+
"github.com/ava-labs/libevm/accounts/external"
28+
"github.com/ava-labs/libevm/accounts/keystore"
29+
"github.com/ava-labs/libevm/common"
30+
"github.com/ava-labs/libevm/core/types"
31+
"github.com/ava-labs/libevm/crypto"
32+
"github.com/ava-labs/libevm/log"
3333
)
3434

3535
// ErrNoChainID is returned whenever the user failed to specify a chain id.

accounts/abi/bind/backend.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ import (
2121
"errors"
2222
"math/big"
2323

24-
"github.com/ethereum/go-ethereum"
25-
"github.com/ethereum/go-ethereum/common"
26-
"github.com/ethereum/go-ethereum/core/types"
24+
"github.com/ava-labs/libevm"
25+
"github.com/ava-labs/libevm/common"
26+
"github.com/ava-labs/libevm/core/types"
2727
)
2828

2929
var (

0 commit comments

Comments
 (0)