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
4 changes: 4 additions & 0 deletions .github/actions/run-monitored-tmpnet-cmd/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ inputs:
run:
description: "the bash script to run e.g. ./scripts/my-script.sh"
required: true
working_directory:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was required to allow usage of the action from the graft/coreth path.

description: "the working directory to run the command in"
default: ''
run_env:
description: 'a string containing env vars for the command e.g. "MY_VAR1=foo MY_VAR2=bar"'
default: ''
Expand Down Expand Up @@ -108,6 +111,7 @@ runs:
shell: bash
# --impure ensures the env vars are accessible to the command
run: ${{ inputs.run_env }} $GITHUB_ACTION_PATH/nix-develop.sh --impure --command bash -x ${{ inputs.run }}
working-directory: ${{ inputs.working_directory }}
env:
# Always collect metrics locally even when nodes are running in kube to enable collection from the test workload
TMPNET_START_METRICS_COLLECTOR: ${{ inputs.prometheus_username != '' }}
Expand Down
62 changes: 62 additions & 0 deletions .github/workflows/coreth-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Coreth
on:
push:
branches:
- master
pull_request:
merge_group:
types: [checks_requested]

jobs:
lint_test:
name: Lint
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./graft/coreth
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup-go-for-project
- name: Run all lint checks
run: ./scripts/run_task.sh lint-all-ci
- name: Check go.mod and go.sum are up-to-date
run: ./scripts/run_task.sh check-go-mod-tidy

unit_test:
name: Unit Tests (${{ matrix.os }})
runs-on: ${{ matrix.os }}
defaults:
run:
working-directory: ./graft/coreth
strategy:
fail-fast: false
matrix:
os: [macos-latest, ubuntu-22.04, ubuntu-latest]
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup-go-for-project
- run: ./scripts/run_task.sh build-test
- run: ./scripts/run_task.sh coverage

e2e_warp:
name: E2E Warp Tests
runs-on: ubuntu-latest
steps:
- name: Git checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Run Warp E2E Tests
uses: ./.github/actions/run-monitored-tmpnet-cmd
with:
run: ./scripts/run_task.sh test-e2e-warp-ci
working_directory: ./graft/coreth
artifact_prefix: warp
prometheus_url: ${{ secrets.PROMETHEUS_URL || '' }}
prometheus_push_url: ${{ secrets.PROMETHEUS_PUSH_URL || '' }}
prometheus_username: ${{ secrets.PROMETHEUS_ID || '' }}
prometheus_password: ${{ secrets.PROMETHEUS_PASSWORD || '' }}
loki_url: ${{ secrets.LOKI_URL || '' }}
loki_push_url: ${{ secrets.LOKI_PUSH_URL || '' }}
loki_username: ${{ secrets.LOKI_ID || '' }}
loki_password: ${{ secrets.LOKI_PASSWORD || '' }}
35 changes: 18 additions & 17 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:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is necessary to allow dynamically appending excluded files at the bottom of the lint file for coreth linting

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 @@ -240,20 +258,3 @@ linters:
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
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ WORKDIR /build
# Copy and download avalanche dependencies using go mod
COPY go.mod .
COPY go.sum .
COPY graft/coreth ./graft/coreth
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without this the subsequent line fails due to the replace directive pointing to a local path

RUN go mod download

# Copy the code into the container
Expand Down
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -243,3 +243,8 @@ To officially support a new platform, one must satisfy the following requirement
**We and our community welcome responsible disclosures.**

Please refer to our [Security Policy](SECURITY.md) and [Security Advisories](https://github.com/ava-labs/avalanchego/security/advisories).

## Licenses

Unless otherwise stated, all code in this repository is licensed under BSD-3. See our [licensing](LICENSE) for more details. Specifically, [grafted repositories](graft/) may use
a different license, and one must refer to that project's README and LICENSE for more details
3 changes: 2 additions & 1 deletion Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,8 @@ tasks:
generate-mocks:
desc: Generates testing mocks
cmds:
- cmd: grep -lr -E '^// Code generated by MockGen\. DO NOT EDIT\.$' . | xargs -r rm
# Avoid deleting mocks in grafted modules
- cmd: grep -lr -E '^// Code generated by MockGen\. DO NOT EDIT\.$' . | grep -v '^./graft' | xargs -r rm
- cmd: go generate -run "mockgen" ./...

generate-canoto:
Expand Down
Loading
Loading