Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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: 2 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
/Taskfile.yml @joshua-kim @maru-ava
/flake.lock @joshua-kim @maru-ava
/flake.nix @joshua-kim @maru-ava
/graft/coreth @ava-labs/platform-evm
/graft/coreth/triedb/firewood/ @alarso16 @ava-labs/platform-evm
/network/p2p/ @joshua-kim
/network/p2p/*.md @joshua-kim @meaghanfitzgerald
/nix/* @joshua-kim @maru-ava
Expand Down
49 changes: 47 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,21 @@ jobs:
- name: test-unit
shell: bash
run: ./scripts/run_task.sh test-unit
env:
TIMEOUT: ${{ env.TIMEOUT }}
Unit-coreth:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [macos-14, ubuntu-22.04, ubuntu-24.04, custom-arm64-jammy, custom-arm64-noble]
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup-go-for-project
- name: test-unit
shell: bash
run: ./scripts/run_task.sh test-unit-coreth
- name: coverage
shell: bash
run: ./scripts/run_task.sh coverage
Fuzz:
runs-on: ubuntu-latest
steps:
Expand Down Expand Up @@ -113,6 +126,22 @@ jobs:
loki_push_url: ${{ secrets.LOKI_PUSH_URL || '' }}
loki_username: ${{ secrets.LOKI_USERNAME || '' }}
loki_password: ${{ secrets.LOKI_PASSWORD || '' }}
e2e_warp:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/run-monitored-tmpnet-cmd
with:
run: ./scripts/run_task.sh test-e2e-warp-ci
artifact_prefix: e2e-warp
prometheus_url: ${{ secrets.PROMETHEUS_URL || '' }}
prometheus_push_url: ${{ secrets.PROMETHEUS_PUSH_URL || '' }}
prometheus_username: ${{ secrets.PROMETHEUS_USERNAME || '' }}
prometheus_password: ${{ secrets.PROMETHEUS_PASSWORD || '' }}
loki_url: ${{ secrets.LOKI_URL || '' }}
loki_push_url: ${{ secrets.LOKI_PUSH_URL || '' }}
loki_username: ${{ secrets.LOKI_USERNAME || '' }}
loki_password: ${{ secrets.LOKI_PASSWORD || '' }}
Upgrade:
runs-on: ubuntu-latest
steps:
Expand Down Expand Up @@ -171,6 +200,14 @@ jobs:
- uses: ./.github/actions/setup-go-for-project
- shell: bash
run: ./scripts/run_task.sh check-generate-canoto
check_codec:
name: Up-to-date codec
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup-go-for-project
- shell: bash
run: ./scripts/run_task.sh check-generate-codec
check_contract_bindings:
name: Up-to-date contract bindings
runs-on: ubuntu-latest
Expand All @@ -179,6 +216,14 @@ jobs:
- uses: ./.github/actions/install-nix
- shell: nix develop --command bash -x {0}
run: task check-generate-load-contract-bindings
check_rlp:
name: Up-to-date rlp
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup-go-for-project
- shell: bash
run: ./scripts/run_task.sh check-generate-rlp
go_mod_tidy:
name: Up-to-date go.mod and go.sum
runs-on: ubuntu-latest
Expand Down
37 changes: 19 additions & 18 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,24 @@ issues:
# Maximum count of issues with the same text.
max-same-issues: 0

formatters:
enable:
- gci
- gofmt
- gofumpt
settings:
gci:
sections:
- standard
- default
- blank
- prefix(github.com/ava-labs/avalanchego)
- alias
- dot
custom-order: true
exclusions:
generated: lax

linters:
default: none
enable:
Expand Down Expand Up @@ -236,24 +254,7 @@ linters:
# 2. Exclude any file prefixed with test_ in any directory.
# 3. Exclude any directory suffixed with test.
# 4. Exclude any file suffixed with _test.go.
- path: "(^tests/)|(^(.*/)*test_[^/]*\\.go$)|(.*test/.*)|(.*_test\\.go$)"
- path: "/[^/]*tests?/|(^|.*/)(test_[^/]*\\.go$)|(_test\\.go$)"
linters:
- gosec
- prealloc
formatters:
enable:
- gci
- gofmt
- gofumpt
settings:
gci:
sections:
- standard
- default
- blank
- prefix(github.com/ava-labs/avalanchego)
- alias
- dot
custom-order: true
exclusions:
generated: lax
File renamed without changes.
56 changes: 52 additions & 4 deletions Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,12 @@ tasks:
- task: generate-canoto
- task: check-clean-branch

check-generate-codec:
desc: Checks that generated codec files are up-to-date (requires a clean git working tree)
cmds:
- task: generate-codec
- task: check-clean-branch

check-generate-load-contract-bindings:
desc: Checks that generated load contract bindings are up-to-date (requires a clean git working tree)
cmds:
Expand All @@ -79,6 +85,12 @@ tasks:
- task: generate-protobuf
- task: check-clean-branch

check-generate-rlp:
desc: Checks that generated rlp files are up-to-date (requires a clean git working tree)
cmds:
- task: generate-rlp
- task: check-clean-branch

check-go-mod-tidy:
desc: Checks that go.mod and go.sum are up-to-date (requires a clean git working tree)
cmds:
Expand All @@ -92,6 +104,10 @@ tasks:
desc: Creates the default kind cluster
cmd: bash -x ./scripts/start_kind_cluster.sh {{.CLI_ARGS}}

coverage:
desc: Display test coverage statistics from coverage.out file
cmd: ./scripts/coverage.sh

delete-kind-cluster:
desc: Deletes the default kind cluster
cmd: kind delete cluster
Expand All @@ -118,11 +134,17 @@ tasks:
desc: Generates testing mocks
cmds:
- cmd: grep -lr -E '^// Code generated by MockGen\. DO NOT EDIT\.$' . | xargs -r rm
- cmd: go generate -run "go.uber.org/mock/mockgen" ./...
- cmd: go generate -run "mockgen" ./...

generate-canoto:
desc: Generates canoto
cmd: go generate -run "github.com/StephenButtolph/canoto/canoto" ./...
cmd: go generate -run "canoto" ./...

generate-codec:
desc: Generates fjl/gencodec files
cmds:
- cmd: grep -lr -E '^// Code generated by github\\.com\\/fjl\\/gencodec\\. DO NOT EDIT\\.$' . | xargs -r rm
- cmd: go generate -run gencodec ./...

generate-load-contract-bindings:
desc: Generates load contract bindings
Expand All @@ -134,6 +156,12 @@ tasks:
desc: Generates protobuf
cmd: ./scripts/protobuf_codegen.sh

generate-rlp:
desc: Generates rlp files
cmds:
- cmd: grep -lr -E '^// Code generated by rlpgen\\. DO NOT EDIT\\.$' . | xargs -r rm
- cmd: go generate -run "github.com/ava-labs/libevm/rlp/rlpgen" ./...

ginkgo-build:
desc: Runs ginkgo against the current working directory
cmd: ./bin/ginkgo build {{.USER_WORKING_DIR}}
Expand Down Expand Up @@ -172,7 +200,7 @@ tasks:

lint-fix:
desc: Runs automated fixing for failing static analysis of golang code
cmd: ./scripts/run_tool.sh golangci-lint run --config .golangci.yml --fix
cmd: ./scripts/lint_fix.sh

lint-action:
desc: Runs actionlint to check sanity of github action configuration
Expand Down Expand Up @@ -326,6 +354,23 @@ tasks:
cmds:
- cmd: bash -x ./scripts/tests.e2e.kube.sh --ginkgo.focus-file=xsvm.go {{.CLI_ARGS}}

test-e2e-warp:
desc: Run end-to-end warp tests using Ginkgo test framework
env:
E2E_TARGET: ./graft/coreth/tests/warp
cmds:
- task: build
- cmd: bash -x ./scripts/tests.e2e.sh {{.CLI_ARGS}}

test-e2e-warp-ci:
desc: Run E2E warp tests with CI setup (race detection enabled)
env:
E2E_TARGET: ./graft/coreth/tests/warp
E2E_SERIAL: 1
cmds:
- task: build-race
- cmd: bash -x ./scripts/tests.e2e.sh {{.CLI_ARGS}}

# To use a different fuzz time, run `task test-fuzz FUZZTIME=[value in seconds]`.
# A value of `-1` will run until it encounters a failing output.

Expand Down Expand Up @@ -378,9 +423,12 @@ tasks:

test-unit:
desc: Runs unit tests
# Invoking with bash ensures compatibility with CI execution on Windows
cmd: bash ./scripts/build_test.sh

test-unit-coreth:
desc: Runs unit tests for coreth
cmd: bash ./scripts/tests.unit.coreth.sh

test-unit-fast:
desc: Runs unit tests
env:
Expand Down
2 changes: 1 addition & 1 deletion chains/atomic/mocks_generate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@

package atomic

//go:generate go run go.uber.org/mock/mockgen -package=${GOPACKAGE}mock -destination=${GOPACKAGE}mock/shared_memory.go -mock_names=SharedMemory=SharedMemory . SharedMemory
//go:generate go tool mockgen -package=${GOPACKAGE}mock -destination=${GOPACKAGE}mock/shared_memory.go -mock_names=SharedMemory=SharedMemory . SharedMemory
2 changes: 1 addition & 1 deletion codec/mocks_generate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@

package codec

//go:generate go run go.uber.org/mock/mockgen -package=${GOPACKAGE}mock -destination=${GOPACKAGE}mock/manager.go -mock_names=Manager=Manager . Manager
//go:generate go tool mockgen -package=${GOPACKAGE}mock -destination=${GOPACKAGE}mock/manager.go -mock_names=Manager=Manager . Manager
4 changes: 2 additions & 2 deletions database/mocks_generate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@

package database

//go:generate go run go.uber.org/mock/mockgen -package=${GOPACKAGE}mock -destination=${GOPACKAGE}mock/batch.go -mock_names=Batch=Batch . Batch
//go:generate go run go.uber.org/mock/mockgen -package=${GOPACKAGE}mock -destination=${GOPACKAGE}mock/iterator.go -mock_names=Iterator=Iterator . Iterator
//go:generate go tool mockgen -package=${GOPACKAGE}mock -destination=${GOPACKAGE}mock/batch.go -mock_names=Batch=Batch . Batch
//go:generate go tool mockgen -package=${GOPACKAGE}mock -destination=${GOPACKAGE}mock/iterator.go -mock_names=Iterator=Iterator . Iterator
10 changes: 6 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ require (
github.com/cockroachdb/pebble v0.0.0-20230928194634-aa077af62593
github.com/compose-spec/compose-go v1.20.2
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.4.0
github.com/fjl/gencodec v0.1.1
github.com/go-cmd/cmd v1.4.3
github.com/google/btree v1.1.2
github.com/google/go-cmp v0.7.0
Expand Down Expand Up @@ -71,7 +70,6 @@ require (
go.uber.org/zap v1.27.0
golang.org/x/crypto v0.43.0
golang.org/x/exp v0.0.0-20241215155358-4a5509556b9e
golang.org/x/mod v0.29.0
golang.org/x/net v0.46.0
golang.org/x/sync v0.17.0
golang.org/x/term v0.36.0
Expand All @@ -92,7 +90,6 @@ require (
require (
github.com/BurntSushi/toml v1.5.0 // indirect
github.com/btcsuite/btcd/chaincfg/chainhash v1.1.0 // indirect
github.com/garslo/gogen v0.0.0-20230926014519-f497ca02dd4c // indirect
)

require (
Expand Down Expand Up @@ -194,6 +191,7 @@ require (
go.opentelemetry.io/otel/metric v1.37.0 // indirect
go.opentelemetry.io/proto/otlp v1.7.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
golang.org/x/mod v0.29.0 // indirect
golang.org/x/oauth2 v0.30.0 // indirect
golang.org/x/sys v0.37.0 // indirect
golang.org/x/text v0.30.0 // indirect
Expand All @@ -207,4 +205,8 @@ require (
sigs.k8s.io/yaml v1.3.0 // indirect
)

tool github.com/onsi/ginkgo/v2/ginkgo
tool (
github.com/StephenButtolph/canoto/canoto
github.com/onsi/ginkgo/v2/ginkgo
go.uber.org/mock/mockgen
)
4 changes: 0 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -213,17 +213,13 @@ github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5Kwzbycv
github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M=
github.com/fatih/structtag v1.2.0 h1:/OdNE99OxoI/PqaW/SuSK9uxxT3f/tcSZgon/ssNSx4=
github.com/fatih/structtag v1.2.0/go.mod h1:mBJUNpUnHmRKrKlQQlmCrh5PuhftFbNv8Ys4/aAZl94=
github.com/fjl/gencodec v0.1.1 h1:DhQY29Q6JLXB/GgMqE86NbOEuvckiYcJCbXFu02toms=
github.com/fjl/gencodec v0.1.1/go.mod h1:chDHL3wKXuBgauP8x3XNZkl5EIAR5SoCTmmmDTZRzmw=
github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8=
github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0=
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ=
github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU=
github.com/fsnotify/fsnotify v1.9.0 h1:2Ml+OJNzbYCTzsxtv8vKSFD9PbJjmhYF14k/jKC7S9k=
github.com/fsnotify/fsnotify v1.9.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0=
github.com/garslo/gogen v0.0.0-20230926014519-f497ca02dd4c h1:40KPNY+PW1YryU4J3aX9kNAgjXIXXyfloGA732AnOQc=
github.com/garslo/gogen v0.0.0-20230926014519-f497ca02dd4c/go.mod h1:Q0X6pkwTILDlzrGEckF6HKjXe48EgsY/l7K7vhY4MW8=
github.com/gavv/httpexpect v2.0.0+incompatible/go.mod h1:x+9tiU1YnrOvnB725RkpoLv1M62hOWzwo5OXotisrKc=
github.com/gballet/go-libpcsclite v0.0.0-20191108122812-4678299bea08 h1:f6D9Hr8xV8uYKlyuj8XIruxlh9WjVjdh1gIicAS7ays=
github.com/gballet/go-libpcsclite v0.0.0-20191108122812-4678299bea08/go.mod h1:x7DCsMOv1taUwEWCzT4cmDeAkigA5/QCwUodaVOe8Ww=
Expand Down
Loading