From 966eb570207f6513c2083c8d642ebb44332201c0 Mon Sep 17 00:00:00 2001 From: "Elvis S." Date: Thu, 25 Sep 2025 22:13:40 +0400 Subject: [PATCH 01/36] ci(avalanchego-build) --- .../avalanchego-build-action/README.md | 101 +++++++++++++++++ .../avalanchego-build-action/action.yml | 105 ++++++++++++++++++ .../avalanchego-build-action/build_target.sh | 48 ++++++++ 3 files changed, 254 insertions(+) create mode 100644 .github/actions/avalanchego-build-action/README.md create mode 100644 .github/actions/avalanchego-build-action/action.yml create mode 100644 .github/actions/avalanchego-build-action/build_target.sh diff --git a/.github/actions/avalanchego-build-action/README.md b/.github/actions/avalanchego-build-action/README.md new file mode 100644 index 000000000000..89137f6de368 --- /dev/null +++ b/.github/actions/avalanchego-build-action/README.md @@ -0,0 +1,101 @@ +# AvalancheGo Build Action + +## Overview +This action provides composable CI capabilities for building AvalancheGo with custom dependency versions. + +### Why this exists? +Solves CI composability problems by enabling repositories to build AvalancheGo with specific dependency versions without complex setup or cross-repository coordination. + +## Modes + +**BUILD Mode** (target specified): Produces a ready-to-use binary with custom dependencies - for teams that need the executable. + +When `target` parameter is provided, the action: +1. Checks out AvalancheGo at specified version +2. Replaces dependencies with custom versions +3. Builds the specified binary +4. Makes binary available via both output parameter AND artifact upload +5. Optionally executes binary with provided args + +**SETUP Mode** (no target): Prepares the build environment with custom dependencies - for teams that need custom build workflows. + +When `target` parameter is empty, the action: +1. Checks out AvalancheGo at specified version +2. Replaces dependencies with custom versions +3. Sets up build environment for consumer's custom workflow + +## Security Model +- Repository Restriction: Only allows dependencies from `github.com/ava-labs/*` repositories +- No Custom Forks: Prevents supply chain attacks from malicious forks +- Commit Validation: Validates dependency versions reference ava-labs repositories only + +## Inputs + +| Input | Description | Required | Default | +|-------|-------------|----------|---------| +| `target` | Which binary to build (`avalanchego`, `reexecution`). Determines BUILD vs SETUP mode | No | `''` | +| `args` | Command-line arguments for target executable (BUILD mode only) | No | `''` | +| `checkout-path` | Directory path where AvalancheGo will be checked out | No | `'avalanchego'` | +| `avalanchego` | AvalancheGo version (commit SHA, branch, tag) | No | `'main'` | +| `firewood` | Firewood version. Consumer should run Firewood shared workflow first | No | `''` | +| `coreth` | Coreth version (commit SHA, branch, tag) | No | `'main'` | +| `libevm` | LibEVM version (commit SHA, branch, tag) | No | `'main'` | + +## Outputs + +| Output | Description | +|--------|-------------| +| `binary-path` | Absolute path to built binary (BUILD mode only) | + +## Usage Examples + +### BUILD Mode - Binary Available for Consumer + +```yaml +- name: Build AvalancheGo + id: build + uses: ./.github/actions/avalanchego-build-action + with: + target: "avalanchego" + coreth: "v0.12.5" + libevm: "v1.0.0" + +- name: Use binary via output parameter + run: ${{ steps.build.outputs.binary-path }} --network-id=local + +- name: Or download as artifact + uses: actions/download-artifact@v4 + with: + name: avalanchego-avalanchego_main-coreth_v0.12.5-libevm_v1.0.0 + +- name: Use downloaded artifact + run: ./avalanchego --network-id=local +``` + +### SETUP Mode - Custom Workflow + +```yaml +- name: Setup AvalancheGo with custom dependencies + uses: ./.github/actions/avalanchego-build-action + with: + checkout-path: "build/avalanchego" + coreth: "my-feature-branch" + libevm: "experimental-branch" + +- name: Run custom build commands + run: | + cd build/avalanchego + ./scripts/run_task.sh reexecute-cchain-range + ./scripts/run_task.sh my-custom-task +``` + +## Artifact Naming + +Artifacts are named with the complete dependency matrix for full traceability: + +**Format:** `{target}-avalanchego_{version}-coreth_{version}-libevm_{version}[-firewood_{version}]` + +**Examples:** +- `avalanchego-avalanchego_main-coreth_main-libevm_main` (default versions) +- `avalanchego-avalanchego_v1.11.0-coreth_v0.12.5-libevm_v1.0.0-firewood_ffi%2Fv0.0.13` (with firewood) +- `reexecution-avalanchego_my-branch-coreth_main-libevm_experimental-firewood_abc123` (mixed versions) diff --git a/.github/actions/avalanchego-build-action/action.yml b/.github/actions/avalanchego-build-action/action.yml new file mode 100644 index 000000000000..f2befd734a15 --- /dev/null +++ b/.github/actions/avalanchego-build-action/action.yml @@ -0,0 +1,105 @@ +name: 'AvalancheGo Build Action' +description: 'Build AvalancheGo with custom dependencies. Dual mode: BUILD (with target) creates binary, SETUP (no target) prepares environment.' + +inputs: + target: + description: 'Binary to build (avalanchego, reexecution). If provided: BUILD mode. If empty: SETUP mode.' + required: false + default: '' + args: + description: 'Arguments for target executable (BUILD mode only)' + required: false + default: '' + checkout-path: + description: 'Directory path where AvalancheGo will be checked out' + required: false + default: 'avalanchego' + avalanchego: + description: 'AvalancheGo version (commit SHA, branch name, or tag)' + required: false + default: 'main' + firewood: + description: 'Firewood version (commit SHA, branch, tag). Consumer should run Firewood shared workflow first.' + required: false + default: '' + coreth: + description: 'Coreth version (commit SHA, branch name, or tag)' + required: false + default: 'main' + libevm: + description: 'LibEVM version (commit SHA, branch name, or tag)' + required: false + default: 'main' + +outputs: + binary-path: + description: 'Absolute path to built binary (BUILD mode only)' + value: ${{ steps.build.outputs.binary-path }} + +runs: + using: 'composite' + steps: + - name: Checkout AvalancheGo + uses: actions/checkout@v4 + with: + repository: 'ava-labs/avalanchego' + ref: ${{ inputs.avalanchego }} + path: ${{ inputs.checkout-path }} + - name: Checkout Coreth + if: inputs.coreth != 'master' + uses: actions/checkout@v4 + with: + repository: 'ava-labs/coreth' + ref: ${{ inputs.coreth }} + path: 'coreth' + - name: Checkout LibEVM + if: inputs.libevm != 'main' + uses: actions/checkout@v4 + with: + repository: 'ava-labs/libevm' + ref: ${{ inputs.libevm }} + path: 'libevm' + - name: Setup Go for project + uses: ./.github/actions/setup-go-for-project # Note: If Nix-specific functionality is needed, consumer should install Nix as prerequisite to this action + - name: Replace dependencies with local checkouts + shell: bash + working-directory: ./${{ inputs.checkout-path }} + run: | + echo "Replacing dependencies with local checkouts..." + + # Use local path replacement for checked out repositories + if [ "${{ inputs.coreth }}" != "master" ]; then + echo "Replacing Coreth with local checkout: ../coreth" + go mod edit -replace github.com/ava-labs/coreth=../coreth + fi + + if [ "${{ inputs.libevm }}" != "main" ]; then + echo "Replacing LibEVM with local checkout: ../libevm" + go mod edit -replace github.com/ava-labs/libevm=../libevm + fi + + go mod tidy + go mod download + - name: Build and run target (BUILD mode) + if: inputs.target != '' + id: build + shell: bash + working-directory: ./${{ inputs.checkout-path }} + run: | + if [ -n "${{ inputs.args }}" ]; then + OUTPUT=$(./build_target.sh "${{ inputs.target }}" ${{ inputs.args }}) + else + OUTPUT=$(./build_target.sh "${{ inputs.target }}") + fi + + # Extract binary path from script output + BINARY_PATH=$(echo "$OUTPUT" | grep "BINARY_PATH=" | cut -d'=' -f2) + + # Set output for consumer use + echo "binary-path=$BINARY_PATH" >> $GITHUB_OUTPUT + - name: Upload binary artifact (BUILD mode) + if: inputs.target != '' + uses: actions/upload-artifact@v4 + with: + name: ${{ inputs.target }}-avalanchego_${{ inputs.avalanchego }}-coreth_${{ inputs.coreth }}-libevm_${{ inputs.libevm }}${{ inputs.firewood != '' && format('-firewood_{0}', inputs.firewood) || '' }} + path: ${{ steps.build.outputs.binary-path }} diff --git a/.github/actions/avalanchego-build-action/build_target.sh b/.github/actions/avalanchego-build-action/build_target.sh new file mode 100644 index 000000000000..2bd25947bf87 --- /dev/null +++ b/.github/actions/avalanchego-build-action/build_target.sh @@ -0,0 +1,48 @@ +#!/usr/bin/env bash +# Build AvalancheGo target binary and optionally execute with arguments +# Usage: ./scripts/build_target.sh [args...] + +set -euo pipefail + +if [[ $# -eq 0 ]]; then + echo "Usage: $0 [args...]" + echo "Valid targets: avalanchego, reexecution" + exit 1 +fi + +TARGET="$1" +shift # Remove target from arguments, remaining args are for execution + +case "$TARGET" in + "avalanchego") + ./scripts/run_task.sh build + EXECUTABLE="./build/avalanchego" + + if [[ ! -f "$EXECUTABLE" ]]; then + echo "Error: Binary $EXECUTABLE was not created" + exit 1 + fi + + echo "BINARY_PATH=$PWD/$EXECUTABLE" + + if [[ $# -gt 0 ]]; then + "$EXECUTABLE" "$@" + fi + ;; + "reexecution") + # Compile reexecution benchmark test into binary + go test -c github.com/ava-labs/avalanchego/tests/reexecute/c -o reexecute-benchmark + EXECUTABLE="./reexecute-benchmark" + + if [[ ! -f "$EXECUTABLE" ]]; then + echo "Error: Binary $EXECUTABLE was not created" + exit 1 + fi + + echo "BINARY_PATH=$PWD/$EXECUTABLE" + ;; + *) + echo "Error: Invalid target '$TARGET'. Valid targets: avalanchego, reexecution" + exit 1 + ;; +esac From ec8fe0ed8acef1645b0a5cc22f6516188a5aba1f Mon Sep 17 00:00:00 2001 From: "Elvis S." Date: Thu, 25 Sep 2025 22:14:07 +0400 Subject: [PATCH 02/36] ci: temp. run custom action on github runners --- .github/workflows/ci.yml | 553 +++++++++++++++++++++------------------ 1 file changed, 296 insertions(+), 257 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index dbfe906bd039..8272fc0e2ab3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,265 +20,304 @@ concurrency: cancel-in-progress: true jobs: - Unit: - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - os: [macos-14, ubuntu-22.04, ubuntu-24.04, custom-arm64-jammy, custom-arm64-noble] +# Unit: +# 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 +# env: +# TIMEOUT: ${{ env.TIMEOUT }} +# Fuzz: +# runs-on: ubuntu-latest +# steps: +# - uses: actions/checkout@v4 +# - uses: ./.github/actions/setup-go-for-project +# - name: test-fuzz +# shell: bash +# run: ./scripts/run_task.sh test-fuzz +# e2e: +# runs-on: ubuntu-latest +# steps: +# - uses: actions/checkout@v4 +# - uses: ./.github/actions/setup-go-for-project +# - name: Run e2e tests +# uses: ./.github/actions/run-monitored-tmpnet-cmd +# with: +# run: ./scripts/run_task.sh test-e2e-ci +# artifact_prefix: e2e +# filter_by_owner: avalanchego-e2e +# 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 || '' }} +# e2e_post_granite: +# runs-on: ubuntu-latest +# steps: +# - uses: actions/checkout@v4 +# - uses: ./.github/actions/setup-go-for-project +# - name: Run e2e tests +# uses: ./.github/actions/run-monitored-tmpnet-cmd +# with: +# run: ./scripts/run_task.sh test-e2e-ci -- --activate-granite +# artifact_prefix: e2e-post-granite +# filter_by_owner: avalanchego-e2e +# 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 || '' }} +# e2e_kube: +# runs-on: ubuntu-latest +# steps: +# - uses: actions/checkout@v4 +# - uses: ./.github/actions/setup-go-for-project +# - uses: ./.github/actions/run-monitored-tmpnet-cmd +# with: +# run: ./scripts/run_task.sh test-e2e-kube-ci +# runtime: kube +# artifact_prefix: e2e-kube +# filter_by_owner: avalanchego-e2e +# 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 || '' }} +# e2e_existing_network: +# runs-on: ubuntu-latest +# steps: +# - uses: actions/checkout@v4 +# - uses: ./.github/actions/setup-go-for-project +# - name: Run e2e tests with existing network +# uses: ./.github/actions/run-monitored-tmpnet-cmd +# with: +# run: ./scripts/run_task.sh test-e2e-existing-ci +# artifact_prefix: e2e-existing-network +# 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: +# - uses: actions/checkout@v4 +# - uses: ./.github/actions/setup-go-for-project +# - name: Run e2e tests +# uses: ./.github/actions/run-monitored-tmpnet-cmd +# with: +# run: ./scripts/run_task.sh test-upgrade +# artifact_prefix: upgrade +# 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 || '' }} +# Lint: +# runs-on: ubuntu-latest +# steps: +# - uses: actions/checkout@v4 +# - uses: ./.github/actions/setup-go-for-project +# - uses: ./.github/actions/install-nix +# - name: Runs all lint checks +# shell: nix develop --command bash -x {0} +# run: ./scripts/run_task.sh lint-all-ci +# links-lint: +# name: Markdown Links Lint +# runs-on: ubuntu-latest +# steps: +# - uses: actions/checkout@v4 +# - uses: umbrelladocs/action-linkspector@de84085e0f51452a470558693d7d308fbb2fa261 #v1.2.5 +# with: +# fail_level: any +# check_generated_protobuf: +# name: Up-to-date protobuf +# runs-on: ubuntu-latest +# steps: +# - uses: actions/checkout@v4 +# - uses: ./.github/actions/setup-go-for-project +# # Use the dev shell instead of bufbuild/buf-action to ensure the dev shell provides the expected versions +# - uses: ./.github/actions/install-nix +# - shell: nix develop --command bash -x {0} +# run: ./scripts/run_task.sh check-generate-protobuf +# check_mockgen: +# name: Up-to-date mocks +# 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-mocks +# check_canotogen: +# name: Up-to-date canoto +# 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-canoto +# check_contract_bindings: +# name: Up-to-date contract bindings +# runs-on: ubuntu-latest +# steps: +# - uses: actions/checkout@v4 +# - uses: ./.github/actions/setup-go-for-project +# - uses: ./.github/actions/install-nix +# - shell: nix develop --command bash -x {0} +# run: task check-generate-load-contract-bindings +# go_mod_tidy: +# name: Up-to-date go.mod and go.sum +# runs-on: ubuntu-latest +# steps: +# - uses: actions/checkout@v4 +# - uses: ./.github/actions/setup-go-for-project +# - shell: bash +# run: ./scripts/run_task.sh check-go-mod-tidy +# test_build_image: +# name: Image build +# runs-on: ubuntu-latest +# steps: +# - uses: actions/checkout@v4 +# - name: Install qemu (required for cross-platform builds) +# run: | +# sudo apt update +# sudo apt -y install qemu-system qemu-user-static +# - name: Check image build +# shell: bash +# run: ./scripts/run_task.sh test-build-image +# test_build_antithesis_avalanchego_images: +# name: Build Antithesis avalanchego images +# runs-on: ubuntu-latest +# steps: +# - uses: actions/checkout@v4 +# - uses: ./.github/actions/setup-go-for-project +# - name: Check image build for avalanchego test setup +# shell: bash +# run: ./scripts/run_task.sh test-build-antithesis-images-avalanchego +# test_build_antithesis_xsvm_images: +# name: Build Antithesis xsvm images +# runs-on: ubuntu-latest +# steps: +# - uses: actions/checkout@v4 +# - uses: ./.github/actions/setup-go-for-project +# - name: Check image build for xsvm test setup +# shell: bash +# run: ./scripts/run_task.sh test-build-antithesis-images-xsvm +# e2e_bootstrap_monitor: +# name: Run bootstrap monitor e2e tests +# runs-on: ubuntu-latest +# steps: +# - uses: actions/checkout@v4 +# - uses: ./.github/actions/setup-go-for-project +# - uses: ./.github/actions/install-nix +# - name: Run e2e tests +# shell: bash +# run: nix develop --command ./scripts/run_task.sh test-bootstrap-monitor-e2e +# load: +# name: Run process-based load test +# runs-on: ubuntu-latest +# steps: +# - uses: actions/checkout@v4 +# - uses: ./.github/actions/setup-go-for-project +# - uses: ./.github/actions/run-monitored-tmpnet-cmd +# with: +# run: ./scripts/run_task.sh test-load -- --load-timeout=30s +# artifact_prefix: load +# 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 || '' }} +# load_kube_kind: +# name: Run load test on kind cluster +# runs-on: ubuntu-latest +# steps: +# - uses: actions/checkout@v4 +# - uses: ./.github/actions/setup-go-for-project +# - uses: ./.github/actions/run-monitored-tmpnet-cmd +# with: +# run: ./scripts/run_task.sh test-load-kube-kind -- --load-timeout=30s +# runtime: kube +# artifact_prefix: load-kube +# 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 || '' }} +# robustness: +# runs-on: ubuntu-latest +# steps: +# - uses: actions/checkout@v4 +# - uses: ./.github/actions/setup-go-for-project +# - uses: ./.github/actions/install-nix +# # TODO(marun) Extend testing of robustness beyond deploying a suitable test environment +# - name: Deploy kind with chaos mesh +# shell: bash +# run: nix develop --command ./scripts/run_task.sh test-robustness + # GitHub runners - BUILD mode + build_github_avalanchego: + name: Build avalanchego on GitHub runner + runs-on: ubuntu-22.04 steps: - - uses: actions/checkout@v4 - - uses: ./.github/actions/setup-go-for-project - - name: test-unit - shell: bash - run: ./scripts/run_task.sh test-unit - env: - TIMEOUT: ${{ env.TIMEOUT }} - Fuzz: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: ./.github/actions/setup-go-for-project - - name: test-fuzz - shell: bash - run: ./scripts/run_task.sh test-fuzz - e2e: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: ./.github/actions/setup-go-for-project - - name: Run e2e tests - uses: ./.github/actions/run-monitored-tmpnet-cmd - with: - run: ./scripts/run_task.sh test-e2e-ci - artifact_prefix: e2e - filter_by_owner: avalanchego-e2e - 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 || '' }} - e2e_post_granite: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: ./.github/actions/setup-go-for-project - - name: Run e2e tests - uses: ./.github/actions/run-monitored-tmpnet-cmd - with: - run: ./scripts/run_task.sh test-e2e-ci -- --activate-granite - artifact_prefix: e2e-post-granite - filter_by_owner: avalanchego-e2e - 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 || '' }} - e2e_kube: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: ./.github/actions/setup-go-for-project - - uses: ./.github/actions/run-monitored-tmpnet-cmd - with: - run: ./scripts/run_task.sh test-e2e-kube-ci - runtime: kube - artifact_prefix: e2e-kube - filter_by_owner: avalanchego-e2e - 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 || '' }} - e2e_existing_network: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: ./.github/actions/setup-go-for-project - - name: Run e2e tests with existing network - uses: ./.github/actions/run-monitored-tmpnet-cmd - with: - run: ./scripts/run_task.sh test-e2e-existing-ci - artifact_prefix: e2e-existing-network - 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: - - uses: actions/checkout@v4 - - uses: ./.github/actions/setup-go-for-project - - name: Run e2e tests - uses: ./.github/actions/run-monitored-tmpnet-cmd - with: - run: ./scripts/run_task.sh test-upgrade - artifact_prefix: upgrade - 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 || '' }} - Lint: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: ./.github/actions/setup-go-for-project - - uses: ./.github/actions/install-nix - - name: Runs all lint checks - shell: nix develop --command bash -x {0} - run: ./scripts/run_task.sh lint-all-ci - links-lint: - name: Markdown Links Lint - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: umbrelladocs/action-linkspector@de84085e0f51452a470558693d7d308fbb2fa261 #v1.2.5 + - name: Build avalanchego + id: build + uses: ./.github/actions/avalanchego-build-action with: - fail_level: any - check_generated_protobuf: - name: Up-to-date protobuf - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: ./.github/actions/setup-go-for-project - # Use the dev shell instead of bufbuild/buf-action to ensure the dev shell provides the expected versions - - uses: ./.github/actions/install-nix - - shell: nix develop --command bash -x {0} - run: ./scripts/run_task.sh check-generate-protobuf - check_mockgen: - name: Up-to-date mocks - 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-mocks - check_canotogen: - name: Up-to-date canoto - 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-canoto - check_contract_bindings: - name: Up-to-date contract bindings - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: ./.github/actions/setup-go-for-project - - uses: ./.github/actions/install-nix - - shell: nix develop --command bash -x {0} - run: task check-generate-load-contract-bindings - go_mod_tidy: - name: Up-to-date go.mod and go.sum - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: ./.github/actions/setup-go-for-project - - shell: bash - run: ./scripts/run_task.sh check-go-mod-tidy - test_build_image: - name: Image build - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Install qemu (required for cross-platform builds) + target: "avalanchego" + args: "--help" + - name: Verify binary output run: | - sudo apt update - sudo apt -y install qemu-system qemu-user-static - - name: Check image build - shell: bash - run: ./scripts/run_task.sh test-build-image - test_build_antithesis_avalanchego_images: - name: Build Antithesis avalanchego images - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: ./.github/actions/setup-go-for-project - - name: Check image build for avalanchego test setup - shell: bash - run: ./scripts/run_task.sh test-build-antithesis-images-avalanchego - test_build_antithesis_xsvm_images: - name: Build Antithesis xsvm images - runs-on: ubuntu-latest + echo "Binary path: ${{ steps.build.outputs.binary-path }}" + if [ ! -f "${{ steps.build.outputs.binary-path }}" ]; then + echo "Error: Binary not found at output path" + exit 1 + fi + echo "Binary verified successfully" + setup_github: + name: Setup mode on GitHub runner + runs-on: ubuntu-22.04 steps: - - uses: actions/checkout@v4 - - uses: ./.github/actions/setup-go-for-project - - name: Check image build for xsvm test setup - shell: bash - run: ./scripts/run_task.sh test-build-antithesis-images-xsvm - e2e_bootstrap_monitor: - name: Run bootstrap monitor e2e tests - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: ./.github/actions/setup-go-for-project - - uses: ./.github/actions/install-nix - - name: Run e2e tests - shell: bash - run: nix develop --command ./scripts/run_task.sh test-bootstrap-monitor-e2e - load: - name: Run process-based load test - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: ./.github/actions/setup-go-for-project - - uses: ./.github/actions/run-monitored-tmpnet-cmd - with: - run: ./scripts/run_task.sh test-load -- --load-timeout=30s - artifact_prefix: load - 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 || '' }} - load_kube_kind: - name: Run load test on kind cluster - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: ./.github/actions/setup-go-for-project - - uses: ./.github/actions/run-monitored-tmpnet-cmd + - name: Setup AvalancheGo + uses: ./.github/actions/avalanchego-build-action with: - run: ./scripts/run_task.sh test-load-kube-kind -- --load-timeout=30s - runtime: kube - artifact_prefix: load-kube - 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 || '' }} - robustness: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: ./.github/actions/setup-go-for-project - - uses: ./.github/actions/install-nix - # TODO(marun) Extend testing of robustness beyond deploying a suitable test environment - - name: Deploy kind with chaos mesh - shell: bash - run: nix develop --command ./scripts/run_task.sh test-robustness + coreth: "2d2f6cbb997ece114b408387773fa161b7324a21" + libevm: "414b1f5dffea8f1c1deb6edde125ad896570b183" + - name: Verify setup and build manually + run: | + cd avalanchego + echo "Checking go.mod exists..." + if [ ! -f "go.mod" ]; then + echo "Error: go.mod not found" + exit 1 + fi + echo "Building manually in setup mode..." + ./scripts/run_task.sh build + echo "Manual build completed successfully" From 36f84205b440f7a58d66f2aa061cdc5a1e56dac9 Mon Sep 17 00:00:00 2001 From: "Elvis S." Date: Thu, 25 Sep 2025 22:17:39 +0400 Subject: [PATCH 03/36] ci: temp. run custom action on github runners with ubuntu-latest tag --- .github/workflows/c-chain-reexecution-benchmark-container.yml | 2 +- .github/workflows/c-chain-reexecution-benchmark-gh-native.yml | 2 +- .github/workflows/ci.yml | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/c-chain-reexecution-benchmark-container.yml b/.github/workflows/c-chain-reexecution-benchmark-container.yml index d95041a56eb9..fc0661ba4da4 100644 --- a/.github/workflows/c-chain-reexecution-benchmark-container.yml +++ b/.github/workflows/c-chain-reexecution-benchmark-container.yml @@ -1,7 +1,7 @@ name: C-Chain Re-Execution Benchmark w/ Container on: - pull_request: +# pull_request: workflow_dispatch: inputs: config: diff --git a/.github/workflows/c-chain-reexecution-benchmark-gh-native.yml b/.github/workflows/c-chain-reexecution-benchmark-gh-native.yml index e5dc6d20679b..3a436eca7d3b 100644 --- a/.github/workflows/c-chain-reexecution-benchmark-gh-native.yml +++ b/.github/workflows/c-chain-reexecution-benchmark-gh-native.yml @@ -1,7 +1,7 @@ name: C-Chain Re-Execution Benchmark GH Native on: - pull_request: +# pull_request: workflow_dispatch: inputs: config: diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8272fc0e2ab3..0821f976a036 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -285,7 +285,7 @@ jobs: # GitHub runners - BUILD mode build_github_avalanchego: name: Build avalanchego on GitHub runner - runs-on: ubuntu-22.04 + runs-on: ubuntu-latest steps: - name: Build avalanchego id: build @@ -303,7 +303,7 @@ jobs: echo "Binary verified successfully" setup_github: name: Setup mode on GitHub runner - runs-on: ubuntu-22.04 + runs-on: ubuntu-latest steps: - name: Setup AvalancheGo uses: ./.github/actions/avalanchego-build-action From 8a517e5888876ae1fd294e9352315ebca543f71f Mon Sep 17 00:00:00 2001 From: "Elvis S." Date: Thu, 25 Sep 2025 22:21:12 +0400 Subject: [PATCH 04/36] ci(gh_runners): temp. checkout --- .github/workflows/ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0821f976a036..7486f3560555 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -287,6 +287,7 @@ jobs: name: Build avalanchego on GitHub runner runs-on: ubuntu-latest steps: + - uses: actions/checkout@v4 - name: Build avalanchego id: build uses: ./.github/actions/avalanchego-build-action @@ -305,6 +306,7 @@ jobs: name: Setup mode on GitHub runner runs-on: ubuntu-latest steps: + - uses: actions/checkout@v4 - name: Setup AvalancheGo uses: ./.github/actions/avalanchego-build-action with: From 04a9aa8df2d8372e38e3cd44cc9a2381b6a19e2b Mon Sep 17 00:00:00 2001 From: "Elvis S." Date: Thu, 25 Sep 2025 22:24:17 +0400 Subject: [PATCH 05/36] ci: remove checkout --- .github/actions/avalanchego-build-action/action.yml | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/.github/actions/avalanchego-build-action/action.yml b/.github/actions/avalanchego-build-action/action.yml index f2befd734a15..e790febf27de 100644 --- a/.github/actions/avalanchego-build-action/action.yml +++ b/.github/actions/avalanchego-build-action/action.yml @@ -14,10 +14,6 @@ inputs: description: 'Directory path where AvalancheGo will be checked out' required: false default: 'avalanchego' - avalanchego: - description: 'AvalancheGo version (commit SHA, branch name, or tag)' - required: false - default: 'main' firewood: description: 'Firewood version (commit SHA, branch, tag). Consumer should run Firewood shared workflow first.' required: false @@ -25,7 +21,7 @@ inputs: coreth: description: 'Coreth version (commit SHA, branch name, or tag)' required: false - default: 'main' + default: 'master' libevm: description: 'LibEVM version (commit SHA, branch name, or tag)' required: false @@ -39,12 +35,6 @@ outputs: runs: using: 'composite' steps: - - name: Checkout AvalancheGo - uses: actions/checkout@v4 - with: - repository: 'ava-labs/avalanchego' - ref: ${{ inputs.avalanchego }} - path: ${{ inputs.checkout-path }} - name: Checkout Coreth if: inputs.coreth != 'master' uses: actions/checkout@v4 From 1477677508bacde5b13bbb990aa19022912d063c Mon Sep 17 00:00:00 2001 From: "Elvis S." Date: Thu, 25 Sep 2025 22:28:21 +0400 Subject: [PATCH 06/36] ci: add checkout back --- .github/actions/avalanchego-build-action/action.yml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/actions/avalanchego-build-action/action.yml b/.github/actions/avalanchego-build-action/action.yml index e790febf27de..f61b23e4356e 100644 --- a/.github/actions/avalanchego-build-action/action.yml +++ b/.github/actions/avalanchego-build-action/action.yml @@ -14,6 +14,10 @@ inputs: description: 'Directory path where AvalancheGo will be checked out' required: false default: 'avalanchego' + avalanchego: + description: 'AvalancheGo version (commit SHA, branch name, or tag)' + required: false + default: ${{ github.sha }} firewood: description: 'Firewood version (commit SHA, branch, tag). Consumer should run Firewood shared workflow first.' required: false @@ -35,6 +39,12 @@ outputs: runs: using: 'composite' steps: + - name: Checkout AvalancheGo + uses: actions/checkout@v4 + with: + repository: 'ava-labs/avalanchego' + ref: ${{ inputs.avalanchego }} + path: ${{ inputs.checkout-path }} - name: Checkout Coreth if: inputs.coreth != 'master' uses: actions/checkout@v4 @@ -50,7 +60,7 @@ runs: ref: ${{ inputs.libevm }} path: 'libevm' - name: Setup Go for project - uses: ./.github/actions/setup-go-for-project # Note: If Nix-specific functionality is needed, consumer should install Nix as prerequisite to this action + uses: ./.github/actions/setup-go-for-project # Note: If Nix-specific functionality is needed, consumer should install Nix as prerequiste to this action - name: Replace dependencies with local checkouts shell: bash working-directory: ./${{ inputs.checkout-path }} From 58784dab649fc01fcbd088d4714bcca4e3f06515 Mon Sep 17 00:00:00 2001 From: "Elvis S." Date: Thu, 25 Sep 2025 22:32:13 +0400 Subject: [PATCH 07/36] ci: remove defaults from coreth and libevm --- .github/actions/avalanchego-build-action/action.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/actions/avalanchego-build-action/action.yml b/.github/actions/avalanchego-build-action/action.yml index f61b23e4356e..db39635eff5e 100644 --- a/.github/actions/avalanchego-build-action/action.yml +++ b/.github/actions/avalanchego-build-action/action.yml @@ -25,11 +25,11 @@ inputs: coreth: description: 'Coreth version (commit SHA, branch name, or tag)' required: false - default: 'master' + default: '' libevm: description: 'LibEVM version (commit SHA, branch name, or tag)' required: false - default: 'main' + default: '' outputs: binary-path: @@ -62,11 +62,10 @@ runs: - name: Setup Go for project uses: ./.github/actions/setup-go-for-project # Note: If Nix-specific functionality is needed, consumer should install Nix as prerequiste to this action - name: Replace dependencies with local checkouts + if: ${{ inputs.coreth != '' || inputs.libevm != '' }} shell: bash working-directory: ./${{ inputs.checkout-path }} run: | - echo "Replacing dependencies with local checkouts..." - # Use local path replacement for checked out repositories if [ "${{ inputs.coreth }}" != "master" ]; then echo "Replacing Coreth with local checkout: ../coreth" From bec87c79bb173106730b47e9ac220b73f5a2ccca Mon Sep 17 00:00:00 2001 From: "Elvis S." Date: Thu, 25 Sep 2025 22:39:59 +0400 Subject: [PATCH 08/36] debug --- .../avalanchego-build-action/action.yml | 14 +++++++++-- .github/workflows/ci.yml | 25 +++++++++++++++++-- 2 files changed, 35 insertions(+), 4 deletions(-) diff --git a/.github/actions/avalanchego-build-action/action.yml b/.github/actions/avalanchego-build-action/action.yml index db39635eff5e..acff096ac641 100644 --- a/.github/actions/avalanchego-build-action/action.yml +++ b/.github/actions/avalanchego-build-action/action.yml @@ -45,6 +45,8 @@ runs: repository: 'ava-labs/avalanchego' ref: ${{ inputs.avalanchego }} path: ${{ inputs.checkout-path }} + - name: Setup Go for project + uses: ./.github/actions/setup-go-for-project # Note: If Nix-specific functionality is needed, consumer should install Nix as prerequiste to this action - name: Checkout Coreth if: inputs.coreth != 'master' uses: actions/checkout@v4 @@ -59,8 +61,6 @@ runs: repository: 'ava-labs/libevm' ref: ${{ inputs.libevm }} path: 'libevm' - - name: Setup Go for project - uses: ./.github/actions/setup-go-for-project # Note: If Nix-specific functionality is needed, consumer should install Nix as prerequiste to this action - name: Replace dependencies with local checkouts if: ${{ inputs.coreth != '' || inputs.libevm != '' }} shell: bash @@ -85,6 +85,16 @@ runs: shell: bash working-directory: ./${{ inputs.checkout-path }} run: | + echo "=== Debug: Directory structure before replacement ===" + echo "Current working directory:" + pwd + echo "Contents of current directory:" + ls -la + echo "Contents of parent directory (..):" + ls -la .. + echo "Github action path:" + echo "$GITHUB_ACTION_PATH" + if [ -n "${{ inputs.args }}" ]; then OUTPUT=$(./build_target.sh "${{ inputs.target }}" ${{ inputs.args }}) else diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7486f3560555..bec40057b28f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -312,7 +312,7 @@ jobs: with: coreth: "2d2f6cbb997ece114b408387773fa161b7324a21" libevm: "414b1f5dffea8f1c1deb6edde125ad896570b183" - - name: Verify setup and build manually + - name: Verify versions and setup run: | cd avalanchego echo "Checking go.mod exists..." @@ -320,6 +320,27 @@ jobs: echo "Error: go.mod not found" exit 1 fi + + echo "=== Verifying coreth version ===" + if [ -f "go.mod" ]; then + echo "Coreth version from go.mod:" + cat go.mod | grep "github.com/ava-labs/coreth" + fi + + echo "=== Verifying libevm version ===" + if [ -f "go.mod" ]; then + echo "LibEVM version from go.mod:" + cat go.mod | grep "github.com/ava-labs/libevm" + fi + + echo "=== Full go.mod content ===" + cat go.mod + - name: Verify setup and build manually + run: | + cd avalanchego echo "Building manually in setup mode..." ./scripts/run_task.sh build - echo "Manual build completed successfully" + echo "Manual build completed successfully + - name: Run avalanchego + run: | + ./build/avalanchego --help From ebeafdc5a83e82b3c16e5eb46ec99233cd46abb9 Mon Sep 17 00:00:00 2001 From: "Elvis S." Date: Thu, 25 Sep 2025 22:42:25 +0400 Subject: [PATCH 09/36] ci: use $GITHUB_ACTION_PATH --- .../actions/avalanchego-build-action/action.yml | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/.github/actions/avalanchego-build-action/action.yml b/.github/actions/avalanchego-build-action/action.yml index acff096ac641..7f7f88f9419b 100644 --- a/.github/actions/avalanchego-build-action/action.yml +++ b/.github/actions/avalanchego-build-action/action.yml @@ -85,20 +85,10 @@ runs: shell: bash working-directory: ./${{ inputs.checkout-path }} run: | - echo "=== Debug: Directory structure before replacement ===" - echo "Current working directory:" - pwd - echo "Contents of current directory:" - ls -la - echo "Contents of parent directory (..):" - ls -la .. - echo "Github action path:" - echo "$GITHUB_ACTION_PATH" - if [ -n "${{ inputs.args }}" ]; then - OUTPUT=$(./build_target.sh "${{ inputs.target }}" ${{ inputs.args }}) + OUTPUT=$($GITHUB_ACTION_PATH/build_target.sh "${{ inputs.target }}" ${{ inputs.args }}) else - OUTPUT=$(./build_target.sh "${{ inputs.target }}") + OUTPUT=$($GITHUB_ACTION_PATH/build_target.sh "${{ inputs.target }}") fi # Extract binary path from script output From 17af2a7ea3c698976c231d21b80f692003f4142b Mon Sep 17 00:00:00 2001 From: "Elvis S." Date: Thu, 25 Sep 2025 22:45:39 +0400 Subject: [PATCH 10/36] ci: github runners --- .github/actions/avalanchego-build-action/build_target.sh | 0 .github/workflows/ci.yml | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) mode change 100644 => 100755 .github/actions/avalanchego-build-action/build_target.sh diff --git a/.github/actions/avalanchego-build-action/build_target.sh b/.github/actions/avalanchego-build-action/build_target.sh old mode 100644 new mode 100755 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bec40057b28f..bc0795bce680 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -340,7 +340,7 @@ jobs: cd avalanchego echo "Building manually in setup mode..." ./scripts/run_task.sh build - echo "Manual build completed successfully + echo "Manual build completed successfully" - name: Run avalanchego run: | ./build/avalanchego --help From 76b7009f080c7b1a0edc088cff31cfddb8cc5045 Mon Sep 17 00:00:00 2001 From: "Elvis S." Date: Thu, 25 Sep 2025 22:52:40 +0400 Subject: [PATCH 11/36] ci: github runners use nix and use realpath --- .github/actions/avalanchego-build-action/action.yml | 5 ++++- .github/workflows/ci.yml | 4 ++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/actions/avalanchego-build-action/action.yml b/.github/actions/avalanchego-build-action/action.yml index 7f7f88f9419b..7fd340424752 100644 --- a/.github/actions/avalanchego-build-action/action.yml +++ b/.github/actions/avalanchego-build-action/action.yml @@ -94,8 +94,11 @@ runs: # Extract binary path from script output BINARY_PATH=$(echo "$OUTPUT" | grep "BINARY_PATH=" | cut -d'=' -f2) + # Convert to absolute path to avoid relative pathing issues + ABSOLUTE_BINARY_PATH=$(realpath "$BINARY_PATH") + # Set output for consumer use - echo "binary-path=$BINARY_PATH" >> $GITHUB_OUTPUT + echo "binary-path=$ABSOLUTE_BINARY_PATH" >> $GITHUB_OUTPUT - name: Upload binary artifact (BUILD mode) if: inputs.target != '' uses: actions/upload-artifact@v4 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bc0795bce680..194f3fe1c07b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -307,6 +307,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + - uses: ./.github/actions/install-nix - name: Setup AvalancheGo uses: ./.github/actions/avalanchego-build-action with: @@ -342,5 +343,8 @@ jobs: ./scripts/run_task.sh build echo "Manual build completed successfully" - name: Run avalanchego + shell: nix develop --command bash -x {0} run: | + echo "=== Debug ===" + ls -lah ./build/avalanchego --help From 7aafbae23289524c55a5712ba07dcae0bd5e3d3d Mon Sep 17 00:00:00 2001 From: "Elvis S." Date: Thu, 25 Sep 2025 22:57:30 +0400 Subject: [PATCH 12/36] ci: github runners run help from bin --- .github/workflows/ci.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 194f3fe1c07b..5ebc20b25a5a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -345,6 +345,4 @@ jobs: - name: Run avalanchego shell: nix develop --command bash -x {0} run: | - echo "=== Debug ===" - ls -lah - ./build/avalanchego --help + ./bin/avalanchego --help From 35e7eb691c98842f95dbac199fcdf6a4d5611170 Mon Sep 17 00:00:00 2001 From: "Elvis S." Date: Thu, 25 Sep 2025 23:22:41 +0400 Subject: [PATCH 13/36] ci: self-hosted runners --- .github/workflows/ci.yml | 31 ++++++++++++++++++++++++------- 1 file changed, 24 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5ebc20b25a5a..540bf378260f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -282,11 +282,19 @@ jobs: # - name: Deploy kind with chaos mesh # shell: bash # run: nix develop --command ./scripts/run_task.sh test-robustness - # GitHub runners - BUILD mode - build_github_avalanchego: - name: Build avalanchego on GitHub runner - runs-on: ubuntu-latest + self-hosted-build-mode: + name: Build avalanchego on self-hosted runner + runs-on: avalanche-avalanchego-runner + container: + image: ghcr.io/actions/actions-runner:2.325.0 steps: + - name: Install dependencies + shell: bash + run: | + if ! command -v xz &> /dev/null; then + sudo apt-get update + sudo apt-get install -y xz-utils + fi - uses: actions/checkout@v4 - name: Build avalanchego id: build @@ -302,13 +310,22 @@ jobs: exit 1 fi echo "Binary verified successfully" - setup_github: - name: Setup mode on GitHub runner + self-hosted-setup-mode: + name: Setup mode on self-hosted runner runs-on: ubuntu-latest + container: + image: ghcr.io/actions/actions-runner:2.325.0 steps: + - name: Install dependencies + shell: bash + run: | + if ! command -v xz &> /dev/null; then + sudo apt-get update + sudo apt-get install -y xz-utils + fi - uses: actions/checkout@v4 - uses: ./.github/actions/install-nix - - name: Setup AvalancheGo + - name: Setup AvalancheGo with custom Coreth and LibEVM uses: ./.github/actions/avalanchego-build-action with: coreth: "2d2f6cbb997ece114b408387773fa161b7324a21" From 2ea5241feb4ade39a879ac54bf56d97861442ef7 Mon Sep 17 00:00:00 2001 From: "Elvis S." Date: Thu, 25 Sep 2025 23:27:10 +0400 Subject: [PATCH 14/36] ci: self-hosted runners install build-essential --- .github/workflows/ci.yml | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 540bf378260f..4757aaa8dc42 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -291,10 +291,8 @@ jobs: - name: Install dependencies shell: bash run: | - if ! command -v xz &> /dev/null; then - sudo apt-get update - sudo apt-get install -y xz-utils - fi + sudo apt-get update + sudo apt-get install -y xz-utils build-essential - uses: actions/checkout@v4 - name: Build avalanchego id: build @@ -319,10 +317,8 @@ jobs: - name: Install dependencies shell: bash run: | - if ! command -v xz &> /dev/null; then - sudo apt-get update - sudo apt-get install -y xz-utils - fi + sudo apt-get update + sudo apt-get install -y xz-utils build-essential - uses: actions/checkout@v4 - uses: ./.github/actions/install-nix - name: Setup AvalancheGo with custom Coreth and LibEVM From 0e863be1c9d1fad99a10741a2a085ada764356cd Mon Sep 17 00:00:00 2001 From: "Elvis S." Date: Thu, 25 Sep 2025 23:36:51 +0400 Subject: [PATCH 15/36] ci: self-hosted runners run & build reexecution bench --- .github/workflows/ci.yml | 47 ++++++++++------------------------------ 1 file changed, 12 insertions(+), 35 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4757aaa8dc42..b70ca6c0b3b4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -283,7 +283,7 @@ jobs: # shell: bash # run: nix develop --command ./scripts/run_task.sh test-robustness self-hosted-build-mode: - name: Build avalanchego on self-hosted runner + name: Build reexecution bench on self-hosted runner runs-on: avalanche-avalanchego-runner container: image: ghcr.io/actions/actions-runner:2.325.0 @@ -298,7 +298,7 @@ jobs: id: build uses: ./.github/actions/avalanchego-build-action with: - target: "avalanchego" + target: "reexecution" args: "--help" - name: Verify binary output run: | @@ -326,36 +326,13 @@ jobs: with: coreth: "2d2f6cbb997ece114b408387773fa161b7324a21" libevm: "414b1f5dffea8f1c1deb6edde125ad896570b183" - - name: Verify versions and setup - run: | - cd avalanchego - echo "Checking go.mod exists..." - if [ ! -f "go.mod" ]; then - echo "Error: go.mod not found" - exit 1 - fi - - echo "=== Verifying coreth version ===" - if [ -f "go.mod" ]; then - echo "Coreth version from go.mod:" - cat go.mod | grep "github.com/ava-labs/coreth" - fi - - echo "=== Verifying libevm version ===" - if [ -f "go.mod" ]; then - echo "LibEVM version from go.mod:" - cat go.mod | grep "github.com/ava-labs/libevm" - fi - - echo "=== Full go.mod content ===" - cat go.mod - - name: Verify setup and build manually - run: | - cd avalanchego - echo "Building manually in setup mode..." - ./scripts/run_task.sh build - echo "Manual build completed successfully" - - name: Run avalanchego - shell: nix develop --command bash -x {0} - run: | - ./bin/avalanchego --help + - name: Run C-Chain Re-Execution Benchmark + uses: ./.github/actions/c-chain-reexecution-benchmark + with: + prometheus-push-url: ${{ secrets.PROMETHEUS_PUSH_URL || '' }} + prometheus-username: ${{ secrets.PROMETHEUS_USERNAME || '' }} + prometheus-password: ${{ secrets.PROMETHEUS_PASSWORD || '' }} + aws-role: ${{ github.event.inputs.push-post-state != '' && secrets.AWS_S3_RW_ROLE || secrets.AWS_S3_READ_ONLY_ROLE }} + aws-region: 'us-east-2' + github-token: ${{ secrets.GITHUB_TOKEN }} + runner_name: ${{ matrix.runner }} From b63ffe45386f8c4a4b3c7c202140c4c9c23dee6d Mon Sep 17 00:00:00 2001 From: "Elvis S." Date: Thu, 25 Sep 2025 23:47:06 +0400 Subject: [PATCH 16/36] ci: self-hosted runners run & build reexecution bench --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b70ca6c0b3b4..dca1ce325ea4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -294,7 +294,7 @@ jobs: sudo apt-get update sudo apt-get install -y xz-utils build-essential - uses: actions/checkout@v4 - - name: Build avalanchego + - name: Build reexecution bench id: build uses: ./.github/actions/avalanchego-build-action with: @@ -310,7 +310,7 @@ jobs: echo "Binary verified successfully" self-hosted-setup-mode: name: Setup mode on self-hosted runner - runs-on: ubuntu-latest + runs-on: avalanche-avalanchego-runner container: image: ghcr.io/actions/actions-runner:2.325.0 steps: From 18e728c6f21ddbbacd230f0e0cfbb1861e3b1538 Mon Sep 17 00:00:00 2001 From: "Elvis S." Date: Thu, 25 Sep 2025 23:55:33 +0400 Subject: [PATCH 17/36] ci(reexec): temp. disable go setup --- .github/actions/c-chain-reexecution-benchmark/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/c-chain-reexecution-benchmark/action.yml b/.github/actions/c-chain-reexecution-benchmark/action.yml index bbe2bc38225d..58911fd0fe03 100644 --- a/.github/actions/c-chain-reexecution-benchmark/action.yml +++ b/.github/actions/c-chain-reexecution-benchmark/action.yml @@ -60,7 +60,7 @@ inputs: runs: using: composite steps: - - uses: ./.github/actions/setup-go-for-project +# - uses: ./.github/actions/setup-go-for-project - name: Set task env shell: bash run: | From 3dfbc382ddba429f9b8852432e836f52876b91a3 Mon Sep 17 00:00:00 2001 From: "Elvis S." Date: Fri, 26 Sep 2025 00:24:41 +0400 Subject: [PATCH 18/36] re-run re-exec --- .github/actions/c-chain-reexecution-benchmark/action.yml | 1 + .github/workflows/ci.yml | 9 +++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/actions/c-chain-reexecution-benchmark/action.yml b/.github/actions/c-chain-reexecution-benchmark/action.yml index 58911fd0fe03..a694b2f585c5 100644 --- a/.github/actions/c-chain-reexecution-benchmark/action.yml +++ b/.github/actions/c-chain-reexecution-benchmark/action.yml @@ -98,6 +98,7 @@ runs: prometheus_password: ${{ inputs.prometheus-password }} grafana_dashboard_id: 'Gl1I20mnk/c-chain' runtime: "" # Set runtime input to empty string to disable log collection + prometheus_url: ${{ inputs.prometheus-push-url }} - name: Compare Benchmark Results uses: benchmark-action/github-action-benchmark@v1 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index dca1ce325ea4..b9d6cc1d5b4c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -329,10 +329,11 @@ jobs: - name: Run C-Chain Re-Execution Benchmark uses: ./.github/actions/c-chain-reexecution-benchmark with: + aws-role: ${{ secrets.AWS_S3_READ_ONLY_ROLE }} + aws-region: us-east-2 + github-token: ${{ secrets.GITHUB_TOKEN }} + push-post-state: '' + runner_name: 'avalanche-avalanchego-runner' prometheus-push-url: ${{ secrets.PROMETHEUS_PUSH_URL || '' }} prometheus-username: ${{ secrets.PROMETHEUS_USERNAME || '' }} prometheus-password: ${{ secrets.PROMETHEUS_PASSWORD || '' }} - aws-role: ${{ github.event.inputs.push-post-state != '' && secrets.AWS_S3_RW_ROLE || secrets.AWS_S3_READ_ONLY_ROLE }} - aws-region: 'us-east-2' - github-token: ${{ secrets.GITHUB_TOKEN }} - runner_name: ${{ matrix.runner }} From dfa8c8164e7578d2bdec93a5c1595dffcdf1732e Mon Sep 17 00:00:00 2001 From: "Elvis S." Date: Fri, 26 Sep 2025 00:29:45 +0400 Subject: [PATCH 19/36] ci: set permissions --- .github/workflows/ci.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b9d6cc1d5b4c..3dc9cbc7cd64 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -313,6 +313,9 @@ jobs: runs-on: avalanche-avalanchego-runner container: image: ghcr.io/actions/actions-runner:2.325.0 + permissions: + id-token: write + contents: read steps: - name: Install dependencies shell: bash From 06708b0ae0dd39d067f2e90b4d2aad2daba35490 Mon Sep 17 00:00:00 2001 From: "Elvis S." Date: Fri, 26 Sep 2025 13:50:47 +0400 Subject: [PATCH 20/36] ci(avalanchego-build-action): use composable Firewood action --- .../avalanchego-build-action/action.yml | 31 +++++++++++++------ 1 file changed, 22 insertions(+), 9 deletions(-) diff --git a/.github/actions/avalanchego-build-action/action.yml b/.github/actions/avalanchego-build-action/action.yml index 7fd340424752..2f383858204e 100644 --- a/.github/actions/avalanchego-build-action/action.yml +++ b/.github/actions/avalanchego-build-action/action.yml @@ -19,7 +19,7 @@ inputs: required: false default: ${{ github.sha }} firewood: - description: 'Firewood version (commit SHA, branch, tag). Consumer should run Firewood shared workflow first.' + description: 'Firewood version (commit SHA, branch, tag, or ffi/vX.Y.Z for pre-built)' required: false default: '' coreth: @@ -47,32 +47,45 @@ runs: path: ${{ inputs.checkout-path }} - name: Setup Go for project uses: ./.github/actions/setup-go-for-project # Note: If Nix-specific functionality is needed, consumer should install Nix as prerequiste to this action + - name: Setup Firewood FFI + if: inputs.firewood != '' + id: firewood + uses: ava-labs/firewood/.github/actions/build-action@composable-ci-action + with: + version: ${{ inputs.firewood }} - name: Checkout Coreth - if: inputs.coreth != 'master' + if: inputs.coreth != '' && inputs.coreth != 'master' uses: actions/checkout@v4 with: repository: 'ava-labs/coreth' ref: ${{ inputs.coreth }} path: 'coreth' - name: Checkout LibEVM - if: inputs.libevm != 'main' + if: inputs.libevm != '' && inputs.libevm != 'main' uses: actions/checkout@v4 with: repository: 'ava-labs/libevm' ref: ${{ inputs.libevm }} path: 'libevm' - name: Replace dependencies with local checkouts - if: ${{ inputs.coreth != '' || inputs.libevm != '' }} + if: ${{ inputs.firewood != '' || inputs.coreth != '' || inputs.libevm != '' }} shell: bash working-directory: ./${{ inputs.checkout-path }} run: | - # Use local path replacement for checked out repositories - if [ "${{ inputs.coreth }}" != "master" ]; then + # Replace Firewood FFI if provided + if [ "${{ inputs.firewood }}" != "" ]; then + echo "Replacing Firewood FFI with: ${{ steps.firewood.outputs.ffi-path }}" + go mod edit -replace github.com/ava-labs/firewood-go-ethhash/ffi=${{ steps.firewood.outputs.ffi-path }} + fi + + # Replace Coreth if provided and not default + if [ "${{ inputs.coreth }}" != "" ] && [ "${{ inputs.coreth }}" != "master" ]; then echo "Replacing Coreth with local checkout: ../coreth" go mod edit -replace github.com/ava-labs/coreth=../coreth fi - if [ "${{ inputs.libevm }}" != "main" ]; then + # Replace LibEVM if provided and not default + if [ "${{ inputs.libevm }}" != "" ] && [ "${{ inputs.libevm }}" != "main" ]; then echo "Replacing LibEVM with local checkout: ../libevm" go mod edit -replace github.com/ava-labs/libevm=../libevm fi @@ -86,9 +99,9 @@ runs: working-directory: ./${{ inputs.checkout-path }} run: | if [ -n "${{ inputs.args }}" ]; then - OUTPUT=$($GITHUB_ACTION_PATH/build_target.sh "${{ inputs.target }}" ${{ inputs.args }}) + OUTPUT=$(./scripts/build_target.sh "${{ inputs.target }}" ${{ inputs.args }}) else - OUTPUT=$($GITHUB_ACTION_PATH/build_target.sh "${{ inputs.target }}") + OUTPUT=$(./scripts/build_target.sh "${{ inputs.target }}") fi # Extract binary path from script output From fb8a6cf11fb3c4ae84e2c38f35589db3e4c6258b Mon Sep 17 00:00:00 2001 From: "Elvis S." Date: Fri, 26 Sep 2025 13:54:10 +0400 Subject: [PATCH 21/36] ci: reexecution bench with firewood custom action --- .github/workflows/ci.yml | 46 ++++++++++++++++++++++------------------ 1 file changed, 25 insertions(+), 21 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3dc9cbc7cd64..e76e5edd591b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -282,34 +282,39 @@ jobs: # - name: Deploy kind with chaos mesh # shell: bash # run: nix develop --command ./scripts/run_task.sh test-robustness - self-hosted-build-mode: - name: Build reexecution bench on self-hosted runner + self-hosted-prebuult-firewood-reexec: + name: Reexecution benchmark with pre built ffi/v0.0.12 Firewood runs-on: avalanche-avalanchego-runner container: image: ghcr.io/actions/actions-runner:2.325.0 + permissions: + id-token: write + contents: read steps: - name: Install dependencies shell: bash run: | sudo apt-get update - sudo apt-get install -y xz-utils build-essential + sudo apt-get install -y xz-utils - uses: actions/checkout@v4 - - name: Build reexecution bench - id: build + - uses: ./.github/actions/install-nix + - name: Setup AvalancheGo with ffi/v0.0.12 Firewood uses: ./.github/actions/avalanchego-build-action with: - target: "reexecution" - args: "--help" - - name: Verify binary output - run: | - echo "Binary path: ${{ steps.build.outputs.binary-path }}" - if [ ! -f "${{ steps.build.outputs.binary-path }}" ]; then - echo "Error: Binary not found at output path" - exit 1 - fi - echo "Binary verified successfully" - self-hosted-setup-mode: - name: Setup mode on self-hosted runner + firewood: 'ffi/v0.0.12' + - name: Run C-Chain Re-Execution Benchmark + uses: ./.github/actions/c-chain-reexecution-benchmark + with: + aws-role: ${{ secrets.AWS_S3_READ_ONLY_ROLE }} + aws-region: us-east-2 + github-token: ${{ secrets.GITHUB_TOKEN }} + push-post-state: '' + runner_name: 'avalanche-avalanchego-runner' + prometheus-push-url: ${{ secrets.PROMETHEUS_PUSH_URL || '' }} + prometheus-username: ${{ secrets.PROMETHEUS_USERNAME || '' }} + prometheus-password: ${{ secrets.PROMETHEUS_PASSWORD || '' }} + self-hosted-source-build-firewood-reexec: + name: Reexecution benchmark with source built Firewood runs-on: avalanche-avalanchego-runner container: image: ghcr.io/actions/actions-runner:2.325.0 @@ -321,14 +326,13 @@ jobs: shell: bash run: | sudo apt-get update - sudo apt-get install -y xz-utils build-essential + sudo apt-get install -y xz-utils - uses: actions/checkout@v4 - uses: ./.github/actions/install-nix - - name: Setup AvalancheGo with custom Coreth and LibEVM + - name: Setup AvalancheGo with custom Firewood uses: ./.github/actions/avalanchego-build-action with: - coreth: "2d2f6cbb997ece114b408387773fa161b7324a21" - libevm: "414b1f5dffea8f1c1deb6edde125ad896570b183" + firewood: '3b644fae75e0c5799e2139949e9061b129937597' - name: Run C-Chain Re-Execution Benchmark uses: ./.github/actions/c-chain-reexecution-benchmark with: From da4c3892f347c60f293dd1a6552e2403c7a405b5 Mon Sep 17 00:00:00 2001 From: "Elvis S." Date: Fri, 26 Sep 2025 14:42:54 +0400 Subject: [PATCH 22/36] ci: add back ci jobs & remove tmp. jobs --- .github/workflows/ci.yml | 564 +++++++++++++++++---------------------- 1 file changed, 251 insertions(+), 313 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e76e5edd591b..dbfe906bd039 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,327 +20,265 @@ concurrency: cancel-in-progress: true jobs: -# Unit: -# 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 -# env: -# TIMEOUT: ${{ env.TIMEOUT }} -# Fuzz: -# runs-on: ubuntu-latest -# steps: -# - uses: actions/checkout@v4 -# - uses: ./.github/actions/setup-go-for-project -# - name: test-fuzz -# shell: bash -# run: ./scripts/run_task.sh test-fuzz -# e2e: -# runs-on: ubuntu-latest -# steps: -# - uses: actions/checkout@v4 -# - uses: ./.github/actions/setup-go-for-project -# - name: Run e2e tests -# uses: ./.github/actions/run-monitored-tmpnet-cmd -# with: -# run: ./scripts/run_task.sh test-e2e-ci -# artifact_prefix: e2e -# filter_by_owner: avalanchego-e2e -# 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 || '' }} -# e2e_post_granite: -# runs-on: ubuntu-latest -# steps: -# - uses: actions/checkout@v4 -# - uses: ./.github/actions/setup-go-for-project -# - name: Run e2e tests -# uses: ./.github/actions/run-monitored-tmpnet-cmd -# with: -# run: ./scripts/run_task.sh test-e2e-ci -- --activate-granite -# artifact_prefix: e2e-post-granite -# filter_by_owner: avalanchego-e2e -# 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 || '' }} -# e2e_kube: -# runs-on: ubuntu-latest -# steps: -# - uses: actions/checkout@v4 -# - uses: ./.github/actions/setup-go-for-project -# - uses: ./.github/actions/run-monitored-tmpnet-cmd -# with: -# run: ./scripts/run_task.sh test-e2e-kube-ci -# runtime: kube -# artifact_prefix: e2e-kube -# filter_by_owner: avalanchego-e2e -# 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 || '' }} -# e2e_existing_network: -# runs-on: ubuntu-latest -# steps: -# - uses: actions/checkout@v4 -# - uses: ./.github/actions/setup-go-for-project -# - name: Run e2e tests with existing network -# uses: ./.github/actions/run-monitored-tmpnet-cmd -# with: -# run: ./scripts/run_task.sh test-e2e-existing-ci -# artifact_prefix: e2e-existing-network -# 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: -# - uses: actions/checkout@v4 -# - uses: ./.github/actions/setup-go-for-project -# - name: Run e2e tests -# uses: ./.github/actions/run-monitored-tmpnet-cmd -# with: -# run: ./scripts/run_task.sh test-upgrade -# artifact_prefix: upgrade -# 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 || '' }} -# Lint: -# runs-on: ubuntu-latest -# steps: -# - uses: actions/checkout@v4 -# - uses: ./.github/actions/setup-go-for-project -# - uses: ./.github/actions/install-nix -# - name: Runs all lint checks -# shell: nix develop --command bash -x {0} -# run: ./scripts/run_task.sh lint-all-ci -# links-lint: -# name: Markdown Links Lint -# runs-on: ubuntu-latest -# steps: -# - uses: actions/checkout@v4 -# - uses: umbrelladocs/action-linkspector@de84085e0f51452a470558693d7d308fbb2fa261 #v1.2.5 -# with: -# fail_level: any -# check_generated_protobuf: -# name: Up-to-date protobuf -# runs-on: ubuntu-latest -# steps: -# - uses: actions/checkout@v4 -# - uses: ./.github/actions/setup-go-for-project -# # Use the dev shell instead of bufbuild/buf-action to ensure the dev shell provides the expected versions -# - uses: ./.github/actions/install-nix -# - shell: nix develop --command bash -x {0} -# run: ./scripts/run_task.sh check-generate-protobuf -# check_mockgen: -# name: Up-to-date mocks -# 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-mocks -# check_canotogen: -# name: Up-to-date canoto -# 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-canoto -# check_contract_bindings: -# name: Up-to-date contract bindings -# runs-on: ubuntu-latest -# steps: -# - uses: actions/checkout@v4 -# - uses: ./.github/actions/setup-go-for-project -# - uses: ./.github/actions/install-nix -# - shell: nix develop --command bash -x {0} -# run: task check-generate-load-contract-bindings -# go_mod_tidy: -# name: Up-to-date go.mod and go.sum -# runs-on: ubuntu-latest -# steps: -# - uses: actions/checkout@v4 -# - uses: ./.github/actions/setup-go-for-project -# - shell: bash -# run: ./scripts/run_task.sh check-go-mod-tidy -# test_build_image: -# name: Image build -# runs-on: ubuntu-latest -# steps: -# - uses: actions/checkout@v4 -# - name: Install qemu (required for cross-platform builds) -# run: | -# sudo apt update -# sudo apt -y install qemu-system qemu-user-static -# - name: Check image build -# shell: bash -# run: ./scripts/run_task.sh test-build-image -# test_build_antithesis_avalanchego_images: -# name: Build Antithesis avalanchego images -# runs-on: ubuntu-latest -# steps: -# - uses: actions/checkout@v4 -# - uses: ./.github/actions/setup-go-for-project -# - name: Check image build for avalanchego test setup -# shell: bash -# run: ./scripts/run_task.sh test-build-antithesis-images-avalanchego -# test_build_antithesis_xsvm_images: -# name: Build Antithesis xsvm images -# runs-on: ubuntu-latest -# steps: -# - uses: actions/checkout@v4 -# - uses: ./.github/actions/setup-go-for-project -# - name: Check image build for xsvm test setup -# shell: bash -# run: ./scripts/run_task.sh test-build-antithesis-images-xsvm -# e2e_bootstrap_monitor: -# name: Run bootstrap monitor e2e tests -# runs-on: ubuntu-latest -# steps: -# - uses: actions/checkout@v4 -# - uses: ./.github/actions/setup-go-for-project -# - uses: ./.github/actions/install-nix -# - name: Run e2e tests -# shell: bash -# run: nix develop --command ./scripts/run_task.sh test-bootstrap-monitor-e2e -# load: -# name: Run process-based load test -# runs-on: ubuntu-latest -# steps: -# - uses: actions/checkout@v4 -# - uses: ./.github/actions/setup-go-for-project -# - uses: ./.github/actions/run-monitored-tmpnet-cmd -# with: -# run: ./scripts/run_task.sh test-load -- --load-timeout=30s -# artifact_prefix: load -# 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 || '' }} -# load_kube_kind: -# name: Run load test on kind cluster -# runs-on: ubuntu-latest -# steps: -# - uses: actions/checkout@v4 -# - uses: ./.github/actions/setup-go-for-project -# - uses: ./.github/actions/run-monitored-tmpnet-cmd -# with: -# run: ./scripts/run_task.sh test-load-kube-kind -- --load-timeout=30s -# runtime: kube -# artifact_prefix: load-kube -# 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 || '' }} -# robustness: -# runs-on: ubuntu-latest -# steps: -# - uses: actions/checkout@v4 -# - uses: ./.github/actions/setup-go-for-project -# - uses: ./.github/actions/install-nix -# # TODO(marun) Extend testing of robustness beyond deploying a suitable test environment -# - name: Deploy kind with chaos mesh -# shell: bash -# run: nix develop --command ./scripts/run_task.sh test-robustness - self-hosted-prebuult-firewood-reexec: - name: Reexecution benchmark with pre built ffi/v0.0.12 Firewood - runs-on: avalanche-avalanchego-runner - container: - image: ghcr.io/actions/actions-runner:2.325.0 - permissions: - id-token: write - contents: read + Unit: + 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: - - name: Install dependencies + - uses: actions/checkout@v4 + - uses: ./.github/actions/setup-go-for-project + - name: test-unit shell: bash - run: | - sudo apt-get update - sudo apt-get install -y xz-utils + run: ./scripts/run_task.sh test-unit + env: + TIMEOUT: ${{ env.TIMEOUT }} + Fuzz: + runs-on: ubuntu-latest + steps: - uses: actions/checkout@v4 - - uses: ./.github/actions/install-nix - - name: Setup AvalancheGo with ffi/v0.0.12 Firewood - uses: ./.github/actions/avalanchego-build-action + - uses: ./.github/actions/setup-go-for-project + - name: test-fuzz + shell: bash + run: ./scripts/run_task.sh test-fuzz + e2e: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: ./.github/actions/setup-go-for-project + - name: Run e2e tests + uses: ./.github/actions/run-monitored-tmpnet-cmd with: - firewood: 'ffi/v0.0.12' - - name: Run C-Chain Re-Execution Benchmark - uses: ./.github/actions/c-chain-reexecution-benchmark + run: ./scripts/run_task.sh test-e2e-ci + artifact_prefix: e2e + filter_by_owner: avalanchego-e2e + 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 || '' }} + e2e_post_granite: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: ./.github/actions/setup-go-for-project + - name: Run e2e tests + uses: ./.github/actions/run-monitored-tmpnet-cmd with: - aws-role: ${{ secrets.AWS_S3_READ_ONLY_ROLE }} - aws-region: us-east-2 - github-token: ${{ secrets.GITHUB_TOKEN }} - push-post-state: '' - runner_name: 'avalanche-avalanchego-runner' - prometheus-push-url: ${{ secrets.PROMETHEUS_PUSH_URL || '' }} - prometheus-username: ${{ secrets.PROMETHEUS_USERNAME || '' }} - prometheus-password: ${{ secrets.PROMETHEUS_PASSWORD || '' }} - self-hosted-source-build-firewood-reexec: - name: Reexecution benchmark with source built Firewood - runs-on: avalanche-avalanchego-runner - container: - image: ghcr.io/actions/actions-runner:2.325.0 - permissions: - id-token: write - contents: read + run: ./scripts/run_task.sh test-e2e-ci -- --activate-granite + artifact_prefix: e2e-post-granite + filter_by_owner: avalanchego-e2e + 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 || '' }} + e2e_kube: + runs-on: ubuntu-latest steps: - - name: Install dependencies - shell: bash + - uses: actions/checkout@v4 + - uses: ./.github/actions/setup-go-for-project + - uses: ./.github/actions/run-monitored-tmpnet-cmd + with: + run: ./scripts/run_task.sh test-e2e-kube-ci + runtime: kube + artifact_prefix: e2e-kube + filter_by_owner: avalanchego-e2e + 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 || '' }} + e2e_existing_network: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: ./.github/actions/setup-go-for-project + - name: Run e2e tests with existing network + uses: ./.github/actions/run-monitored-tmpnet-cmd + with: + run: ./scripts/run_task.sh test-e2e-existing-ci + artifact_prefix: e2e-existing-network + 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: + - uses: actions/checkout@v4 + - uses: ./.github/actions/setup-go-for-project + - name: Run e2e tests + uses: ./.github/actions/run-monitored-tmpnet-cmd + with: + run: ./scripts/run_task.sh test-upgrade + artifact_prefix: upgrade + 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 || '' }} + Lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: ./.github/actions/setup-go-for-project + - uses: ./.github/actions/install-nix + - name: Runs all lint checks + shell: nix develop --command bash -x {0} + run: ./scripts/run_task.sh lint-all-ci + links-lint: + name: Markdown Links Lint + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: umbrelladocs/action-linkspector@de84085e0f51452a470558693d7d308fbb2fa261 #v1.2.5 + with: + fail_level: any + check_generated_protobuf: + name: Up-to-date protobuf + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: ./.github/actions/setup-go-for-project + # Use the dev shell instead of bufbuild/buf-action to ensure the dev shell provides the expected versions + - uses: ./.github/actions/install-nix + - shell: nix develop --command bash -x {0} + run: ./scripts/run_task.sh check-generate-protobuf + check_mockgen: + name: Up-to-date mocks + 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-mocks + check_canotogen: + name: Up-to-date canoto + 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-canoto + check_contract_bindings: + name: Up-to-date contract bindings + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: ./.github/actions/setup-go-for-project + - uses: ./.github/actions/install-nix + - shell: nix develop --command bash -x {0} + run: task check-generate-load-contract-bindings + go_mod_tidy: + name: Up-to-date go.mod and go.sum + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: ./.github/actions/setup-go-for-project + - shell: bash + run: ./scripts/run_task.sh check-go-mod-tidy + test_build_image: + name: Image build + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Install qemu (required for cross-platform builds) run: | - sudo apt-get update - sudo apt-get install -y xz-utils + sudo apt update + sudo apt -y install qemu-system qemu-user-static + - name: Check image build + shell: bash + run: ./scripts/run_task.sh test-build-image + test_build_antithesis_avalanchego_images: + name: Build Antithesis avalanchego images + runs-on: ubuntu-latest + steps: - uses: actions/checkout@v4 + - uses: ./.github/actions/setup-go-for-project + - name: Check image build for avalanchego test setup + shell: bash + run: ./scripts/run_task.sh test-build-antithesis-images-avalanchego + test_build_antithesis_xsvm_images: + name: Build Antithesis xsvm images + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: ./.github/actions/setup-go-for-project + - name: Check image build for xsvm test setup + shell: bash + run: ./scripts/run_task.sh test-build-antithesis-images-xsvm + e2e_bootstrap_monitor: + name: Run bootstrap monitor e2e tests + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: ./.github/actions/setup-go-for-project - uses: ./.github/actions/install-nix - - name: Setup AvalancheGo with custom Firewood - uses: ./.github/actions/avalanchego-build-action + - name: Run e2e tests + shell: bash + run: nix develop --command ./scripts/run_task.sh test-bootstrap-monitor-e2e + load: + name: Run process-based load test + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: ./.github/actions/setup-go-for-project + - uses: ./.github/actions/run-monitored-tmpnet-cmd with: - firewood: '3b644fae75e0c5799e2139949e9061b129937597' - - name: Run C-Chain Re-Execution Benchmark - uses: ./.github/actions/c-chain-reexecution-benchmark + run: ./scripts/run_task.sh test-load -- --load-timeout=30s + artifact_prefix: load + 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 || '' }} + load_kube_kind: + name: Run load test on kind cluster + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: ./.github/actions/setup-go-for-project + - uses: ./.github/actions/run-monitored-tmpnet-cmd with: - aws-role: ${{ secrets.AWS_S3_READ_ONLY_ROLE }} - aws-region: us-east-2 - github-token: ${{ secrets.GITHUB_TOKEN }} - push-post-state: '' - runner_name: 'avalanche-avalanchego-runner' - prometheus-push-url: ${{ secrets.PROMETHEUS_PUSH_URL || '' }} - prometheus-username: ${{ secrets.PROMETHEUS_USERNAME || '' }} - prometheus-password: ${{ secrets.PROMETHEUS_PASSWORD || '' }} + run: ./scripts/run_task.sh test-load-kube-kind -- --load-timeout=30s + runtime: kube + artifact_prefix: load-kube + 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 || '' }} + robustness: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: ./.github/actions/setup-go-for-project + - uses: ./.github/actions/install-nix + # TODO(marun) Extend testing of robustness beyond deploying a suitable test environment + - name: Deploy kind with chaos mesh + shell: bash + run: nix develop --command ./scripts/run_task.sh test-robustness From 2c84ad99083158db3fd1cfac4ca4550be49d8914 Mon Sep 17 00:00:00 2001 From: "Elvis S." Date: Fri, 26 Sep 2025 14:45:31 +0400 Subject: [PATCH 23/36] ci: uncomment c-chain-reexecution-benchmark-* pull_request directive --- .github/actions/c-chain-reexecution-benchmark/action.yml | 2 +- .github/workflows/c-chain-reexecution-benchmark-container.yml | 2 +- .github/workflows/c-chain-reexecution-benchmark-gh-native.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/actions/c-chain-reexecution-benchmark/action.yml b/.github/actions/c-chain-reexecution-benchmark/action.yml index a694b2f585c5..a41b1a91b851 100644 --- a/.github/actions/c-chain-reexecution-benchmark/action.yml +++ b/.github/actions/c-chain-reexecution-benchmark/action.yml @@ -60,7 +60,7 @@ inputs: runs: using: composite steps: -# - uses: ./.github/actions/setup-go-for-project + - uses: ./.github/actions/setup-go-for-project - name: Set task env shell: bash run: | diff --git a/.github/workflows/c-chain-reexecution-benchmark-container.yml b/.github/workflows/c-chain-reexecution-benchmark-container.yml index fc0661ba4da4..d95041a56eb9 100644 --- a/.github/workflows/c-chain-reexecution-benchmark-container.yml +++ b/.github/workflows/c-chain-reexecution-benchmark-container.yml @@ -1,7 +1,7 @@ name: C-Chain Re-Execution Benchmark w/ Container on: -# pull_request: + pull_request: workflow_dispatch: inputs: config: diff --git a/.github/workflows/c-chain-reexecution-benchmark-gh-native.yml b/.github/workflows/c-chain-reexecution-benchmark-gh-native.yml index 3a436eca7d3b..e5dc6d20679b 100644 --- a/.github/workflows/c-chain-reexecution-benchmark-gh-native.yml +++ b/.github/workflows/c-chain-reexecution-benchmark-gh-native.yml @@ -1,7 +1,7 @@ name: C-Chain Re-Execution Benchmark GH Native on: -# pull_request: + pull_request: workflow_dispatch: inputs: config: From f1a55c77886723ddaa4b14ba539780068744e18e Mon Sep 17 00:00:00 2001 From: "Elvis S." Date: Fri, 26 Sep 2025 15:29:19 +0400 Subject: [PATCH 24/36] chore: address copilot PR review --- .github/actions/avalanchego-build-action/action.yml | 2 +- .github/actions/avalanchego-build-action/build_target.sh | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/actions/avalanchego-build-action/action.yml b/.github/actions/avalanchego-build-action/action.yml index 2f383858204e..8367f50795db 100644 --- a/.github/actions/avalanchego-build-action/action.yml +++ b/.github/actions/avalanchego-build-action/action.yml @@ -46,7 +46,7 @@ runs: ref: ${{ inputs.avalanchego }} path: ${{ inputs.checkout-path }} - name: Setup Go for project - uses: ./.github/actions/setup-go-for-project # Note: If Nix-specific functionality is needed, consumer should install Nix as prerequiste to this action + uses: ./.github/actions/setup-go-for-project # Note: If Nix-specific functionality is needed, consumer should install Nix as a prerequisite to this action - name: Setup Firewood FFI if: inputs.firewood != '' id: firewood diff --git a/.github/actions/avalanchego-build-action/build_target.sh b/.github/actions/avalanchego-build-action/build_target.sh index 2bd25947bf87..0583fd5216f1 100755 --- a/.github/actions/avalanchego-build-action/build_target.sh +++ b/.github/actions/avalanchego-build-action/build_target.sh @@ -15,6 +15,10 @@ shift # Remove target from arguments, remaining args are for execution case "$TARGET" in "avalanchego") + if [[ ! -f "./scripts/run_task.sh" || ! -x "./scripts/run_task.sh" ]]; then + echo "Error: ./scripts/run_task.sh not found or not executable" + exit 1 + fi ./scripts/run_task.sh build EXECUTABLE="./build/avalanchego" From 4702f8119c3c64b306d2e2be5a95aeaed3617f07 Mon Sep 17 00:00:00 2001 From: "Elvis S." Date: Fri, 26 Sep 2025 18:13:08 +0400 Subject: [PATCH 25/36] ci(c-chain-reexecution-benchmark) --- .github/actions/c-chain-reexecution-benchmark/action.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/actions/c-chain-reexecution-benchmark/action.yml b/.github/actions/c-chain-reexecution-benchmark/action.yml index a41b1a91b851..bbe2bc38225d 100644 --- a/.github/actions/c-chain-reexecution-benchmark/action.yml +++ b/.github/actions/c-chain-reexecution-benchmark/action.yml @@ -98,7 +98,6 @@ runs: prometheus_password: ${{ inputs.prometheus-password }} grafana_dashboard_id: 'Gl1I20mnk/c-chain' runtime: "" # Set runtime input to empty string to disable log collection - prometheus_url: ${{ inputs.prometheus-push-url }} - name: Compare Benchmark Results uses: benchmark-action/github-action-benchmark@v1 From 7ac895ca90051889996934b71a4f2dacd917bfa9 Mon Sep 17 00:00:00 2001 From: "Elvis S." Date: Fri, 26 Sep 2025 18:38:04 +0400 Subject: [PATCH 26/36] ci(avalanchego-build-action): use `go get` instead of checking libevm and coreth versions locally --- .../avalanchego-build-action/action.yml | 64 +++++++++---------- 1 file changed, 30 insertions(+), 34 deletions(-) diff --git a/.github/actions/avalanchego-build-action/action.yml b/.github/actions/avalanchego-build-action/action.yml index 8367f50795db..e0e27288a45e 100644 --- a/.github/actions/avalanchego-build-action/action.yml +++ b/.github/actions/avalanchego-build-action/action.yml @@ -46,50 +46,40 @@ runs: ref: ${{ inputs.avalanchego }} path: ${{ inputs.checkout-path }} - name: Setup Go for project - uses: ./.github/actions/setup-go-for-project # Note: If Nix-specific functionality is needed, consumer should install Nix as a prerequisite to this action + uses: ./.github/actions/setup-go-for-project - name: Setup Firewood FFI if: inputs.firewood != '' id: firewood uses: ava-labs/firewood/.github/actions/build-action@composable-ci-action with: version: ${{ inputs.firewood }} - - name: Checkout Coreth - if: inputs.coreth != '' && inputs.coreth != 'master' - uses: actions/checkout@v4 - with: - repository: 'ava-labs/coreth' - ref: ${{ inputs.coreth }} - path: 'coreth' - - name: Checkout LibEVM - if: inputs.libevm != '' && inputs.libevm != 'main' - uses: actions/checkout@v4 - with: - repository: 'ava-labs/libevm' - ref: ${{ inputs.libevm }} - path: 'libevm' - - name: Replace dependencies with local checkouts + - name: Update Coreth dependency + if: inputs.coreth != '' + shell: bash + working-directory: ./${{ inputs.checkout-path }} + run: | + echo "Updating Coreth to version: ${{ inputs.coreth }}" + go get github.com/ava-labs/coreth@${{ inputs.coreth }} + - name: Update LibEVM dependency + if: inputs.libevm != '' + shell: bash + working-directory: ./${{ inputs.checkout-path }} + run: | + echo "Updating LibEVM to version: ${{ inputs.libevm }}" + go get github.com/ava-labs/libevm@${{ inputs.libevm }} + - name: Update Firewood FFI + if: inputs.firewood != '' + shell: bash + working-directory: ./${{ inputs.checkout-path }} + run: | + echo "Replacing Firewood FFI with: ${{ steps.firewood.outputs.ffi-path }}" + go mod edit -replace github.com/ava-labs/firewood-go-ethhash/ffi=${{ steps.firewood.outputs.ffi-path }} + - name: Finalize dependencies if: ${{ inputs.firewood != '' || inputs.coreth != '' || inputs.libevm != '' }} shell: bash working-directory: ./${{ inputs.checkout-path }} run: | - # Replace Firewood FFI if provided - if [ "${{ inputs.firewood }}" != "" ]; then - echo "Replacing Firewood FFI with: ${{ steps.firewood.outputs.ffi-path }}" - go mod edit -replace github.com/ava-labs/firewood-go-ethhash/ffi=${{ steps.firewood.outputs.ffi-path }} - fi - - # Replace Coreth if provided and not default - if [ "${{ inputs.coreth }}" != "" ] && [ "${{ inputs.coreth }}" != "master" ]; then - echo "Replacing Coreth with local checkout: ../coreth" - go mod edit -replace github.com/ava-labs/coreth=../coreth - fi - - # Replace LibEVM if provided and not default - if [ "${{ inputs.libevm }}" != "" ] && [ "${{ inputs.libevm }}" != "main" ]; then - echo "Replacing LibEVM with local checkout: ../libevm" - go mod edit -replace github.com/ava-labs/libevm=../libevm - fi - + echo "Finalizing Go module dependencies" go mod tidy go mod download - name: Build and run target (BUILD mode) @@ -107,6 +97,12 @@ runs: # Extract binary path from script output BINARY_PATH=$(echo "$OUTPUT" | grep "BINARY_PATH=" | cut -d'=' -f2) + # Verify binary path was found + if [ -z "$BINARY_PATH" ]; then + echo "Error: Could not extract binary path from build output" + exit 1 + fi + # Convert to absolute path to avoid relative pathing issues ABSOLUTE_BINARY_PATH=$(realpath "$BINARY_PATH") From 26443d977e41fd51655685cd57bf0aa39ab26a99 Mon Sep 17 00:00:00 2001 From: "Elvis S." Date: Mon, 29 Sep 2025 18:46:22 +0400 Subject: [PATCH 27/36] feat(build): extend build with Firewood --- Taskfile.yml | 6 ++++ scripts/build.sh | 22 ++++++++++--- scripts/setup_firewood.sh | 68 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 92 insertions(+), 4 deletions(-) create mode 100755 scripts/setup_firewood.sh diff --git a/Taskfile.yml b/Taskfile.yml index 962deb68d583..50f62f8e917b 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -11,6 +11,12 @@ tasks: desc: Builds avalanchego cmd: ./scripts/build.sh + build-with-firewood: + desc: Builds avalanchego with Firewood FFI (specify version with FIREWOOD_VERSION) + vars: + FIREWOOD_VERSION: '{{.FIREWOOD_VERSION | default "ffi/v0.0.12"}}' + cmd: ./scripts/build.sh -f {{.FIREWOOD_VERSION}} + build-antithesis-images-avalanchego: desc: Builds docker images for antithesis for the avalanchego test setup env: diff --git a/scripts/build.sh b/scripts/build.sh index 9ca888030cd0..d5df89a00a04 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -9,19 +9,29 @@ print_usage() { Options: - -r Build with race detector + -r Build with race detector + -f VERSION Build with Firewood FFI + VERSION format: ffi/vX.Y.Z for pre-built, commit/branch for source " } race='' -while getopts 'r' flag; do +firewood_version='' + +while getopts 'rf:' flag; do case "${flag}" in r) echo "Building with race detection enabled" race='-race' ;; - *) print_usage - exit 1 ;; + f) + firewood_version="${OPTARG}" + echo "Building with Firewood version: ${firewood_version}" + ;; + *) + print_usage + exit 1 + ;; esac done @@ -31,6 +41,10 @@ source "${REPO_ROOT}"/scripts/constants.sh # Determine the git commit hash to use for the build source "${REPO_ROOT}"/scripts/git_commit.sh +if [ -n "${firewood_version}" ]; then + "${REPO_ROOT}/scripts/setup_firewood.sh" "${firewood_version}" "${REPO_ROOT}" +fi + echo "Building AvalancheGo with [$(go version)]..." go build ${race} -o "${avalanchego_path}" \ -ldflags "-X github.com/ava-labs/avalanchego/version.GitCommit=$git_commit $static_ld_flags" \ diff --git a/scripts/setup_firewood.sh b/scripts/setup_firewood.sh new file mode 100755 index 000000000000..902b983d203d --- /dev/null +++ b/scripts/setup_firewood.sh @@ -0,0 +1,68 @@ +#!/usr/bin/env bash + +# Setup Firewood FFI +# +# Clones Firewood repository, builds/fetches the FFI, and updates go.mod +# +# Usage: +# setup_firewood.sh +# +# Arguments: +# version Firewood version (ffi/vX.Y.Z for pre-built, commit/branch for source) +# +# Output: +# Prints FFI path to stdout on success + +set -euo pipefail + +if [ $# -lt 1 ]; then + echo "Usage: $0 " >&2 + exit 1 +fi + +FIREWOOD_VERSION="$1" +AVALANCHE_PATH=$( cd "$( dirname "${BASH_SOURCE[0]}" )"; cd .. && pwd ) +FIREWOOD_CLONE_DIR="${AVALANCHE_PATH}/firewood" + +if [ -d "${FIREWOOD_CLONE_DIR}" ]; then + echo "Removing existing Firewood directory..." >&2 + rm -rf "${FIREWOOD_CLONE_DIR}" +fi + +echo "Setting up Firewood FFI version: ${FIREWOOD_VERSION}" >&2 + +git clone https://github.com/ava-labs/firewood "${FIREWOOD_CLONE_DIR}" \ + --quiet --depth 1 --branch composable-ci-action + +SETUP_FIREWOOD_SCRIPT="${FIREWOOD_CLONE_DIR}/.github/scripts/build.sh" + +if [ ! -f "${SETUP_FIREWOOD_SCRIPT}" ]; then + echo "Error: Setup Firewood script not found at ${SETUP_FIREWOOD_SCRIPT}" >&2 + exit 1 +fi + +# Build or fetch Firewood FFI +# Capture only the last line which is the FFI path +FFI_PATH=$("${SETUP_FIREWOOD_SCRIPT}" "${FIREWOOD_VERSION}" 2>&1 | tail -n 1) + +if [ -z "${FFI_PATH}" ]; then + echo "Error: Failed to build/fetch Firewood FFI" >&2 + exit 1 +fi + +cd "${AVALANCHE_PATH}" + +# Verify go.mod exists +if [ ! -f "go.mod" ]; then + echo "Error: go.mod not found in ${AVALANCHE_PATH}" >&2 + exit 1 +fi + +echo "Updating go.mod with FFI path: ${FFI_PATH}" >&2 +go mod edit -replace github.com/ava-labs/firewood-go-ethhash/ffi="${FFI_PATH}" + +go mod tidy +go mod download + +# Output FFI path to stdout for consumption by other scripts +echo "${FFI_PATH}" From 833f844d0562cbf1c57030dd073155f3b46a0795 Mon Sep 17 00:00:00 2001 From: "Elvis S." Date: Mon, 29 Sep 2025 18:47:30 +0400 Subject: [PATCH 28/36] ci(avalanche-go-setup): - remove build mode in favor of composability - use scripts allowing both local and ci workflow --- .../avalanchego-build-action/README.md | 101 --------------- .../avalanchego-build-action/action.yml | 116 ------------------ .../avalanchego-build-action/build_target.sh | 52 -------- .../avalanchego-setup-action/README.md | 44 +++++++ .../avalanchego-setup-action/action.yml | 69 +++++++++++ 5 files changed, 113 insertions(+), 269 deletions(-) delete mode 100644 .github/actions/avalanchego-build-action/README.md delete mode 100644 .github/actions/avalanchego-build-action/action.yml delete mode 100755 .github/actions/avalanchego-build-action/build_target.sh create mode 100644 .github/actions/avalanchego-setup-action/README.md create mode 100644 .github/actions/avalanchego-setup-action/action.yml diff --git a/.github/actions/avalanchego-build-action/README.md b/.github/actions/avalanchego-build-action/README.md deleted file mode 100644 index 89137f6de368..000000000000 --- a/.github/actions/avalanchego-build-action/README.md +++ /dev/null @@ -1,101 +0,0 @@ -# AvalancheGo Build Action - -## Overview -This action provides composable CI capabilities for building AvalancheGo with custom dependency versions. - -### Why this exists? -Solves CI composability problems by enabling repositories to build AvalancheGo with specific dependency versions without complex setup or cross-repository coordination. - -## Modes - -**BUILD Mode** (target specified): Produces a ready-to-use binary with custom dependencies - for teams that need the executable. - -When `target` parameter is provided, the action: -1. Checks out AvalancheGo at specified version -2. Replaces dependencies with custom versions -3. Builds the specified binary -4. Makes binary available via both output parameter AND artifact upload -5. Optionally executes binary with provided args - -**SETUP Mode** (no target): Prepares the build environment with custom dependencies - for teams that need custom build workflows. - -When `target` parameter is empty, the action: -1. Checks out AvalancheGo at specified version -2. Replaces dependencies with custom versions -3. Sets up build environment for consumer's custom workflow - -## Security Model -- Repository Restriction: Only allows dependencies from `github.com/ava-labs/*` repositories -- No Custom Forks: Prevents supply chain attacks from malicious forks -- Commit Validation: Validates dependency versions reference ava-labs repositories only - -## Inputs - -| Input | Description | Required | Default | -|-------|-------------|----------|---------| -| `target` | Which binary to build (`avalanchego`, `reexecution`). Determines BUILD vs SETUP mode | No | `''` | -| `args` | Command-line arguments for target executable (BUILD mode only) | No | `''` | -| `checkout-path` | Directory path where AvalancheGo will be checked out | No | `'avalanchego'` | -| `avalanchego` | AvalancheGo version (commit SHA, branch, tag) | No | `'main'` | -| `firewood` | Firewood version. Consumer should run Firewood shared workflow first | No | `''` | -| `coreth` | Coreth version (commit SHA, branch, tag) | No | `'main'` | -| `libevm` | LibEVM version (commit SHA, branch, tag) | No | `'main'` | - -## Outputs - -| Output | Description | -|--------|-------------| -| `binary-path` | Absolute path to built binary (BUILD mode only) | - -## Usage Examples - -### BUILD Mode - Binary Available for Consumer - -```yaml -- name: Build AvalancheGo - id: build - uses: ./.github/actions/avalanchego-build-action - with: - target: "avalanchego" - coreth: "v0.12.5" - libevm: "v1.0.0" - -- name: Use binary via output parameter - run: ${{ steps.build.outputs.binary-path }} --network-id=local - -- name: Or download as artifact - uses: actions/download-artifact@v4 - with: - name: avalanchego-avalanchego_main-coreth_v0.12.5-libevm_v1.0.0 - -- name: Use downloaded artifact - run: ./avalanchego --network-id=local -``` - -### SETUP Mode - Custom Workflow - -```yaml -- name: Setup AvalancheGo with custom dependencies - uses: ./.github/actions/avalanchego-build-action - with: - checkout-path: "build/avalanchego" - coreth: "my-feature-branch" - libevm: "experimental-branch" - -- name: Run custom build commands - run: | - cd build/avalanchego - ./scripts/run_task.sh reexecute-cchain-range - ./scripts/run_task.sh my-custom-task -``` - -## Artifact Naming - -Artifacts are named with the complete dependency matrix for full traceability: - -**Format:** `{target}-avalanchego_{version}-coreth_{version}-libevm_{version}[-firewood_{version}]` - -**Examples:** -- `avalanchego-avalanchego_main-coreth_main-libevm_main` (default versions) -- `avalanchego-avalanchego_v1.11.0-coreth_v0.12.5-libevm_v1.0.0-firewood_ffi%2Fv0.0.13` (with firewood) -- `reexecution-avalanchego_my-branch-coreth_main-libevm_experimental-firewood_abc123` (mixed versions) diff --git a/.github/actions/avalanchego-build-action/action.yml b/.github/actions/avalanchego-build-action/action.yml deleted file mode 100644 index e0e27288a45e..000000000000 --- a/.github/actions/avalanchego-build-action/action.yml +++ /dev/null @@ -1,116 +0,0 @@ -name: 'AvalancheGo Build Action' -description: 'Build AvalancheGo with custom dependencies. Dual mode: BUILD (with target) creates binary, SETUP (no target) prepares environment.' - -inputs: - target: - description: 'Binary to build (avalanchego, reexecution). If provided: BUILD mode. If empty: SETUP mode.' - required: false - default: '' - args: - description: 'Arguments for target executable (BUILD mode only)' - required: false - default: '' - checkout-path: - description: 'Directory path where AvalancheGo will be checked out' - required: false - default: 'avalanchego' - avalanchego: - description: 'AvalancheGo version (commit SHA, branch name, or tag)' - required: false - default: ${{ github.sha }} - firewood: - description: 'Firewood version (commit SHA, branch, tag, or ffi/vX.Y.Z for pre-built)' - required: false - default: '' - coreth: - description: 'Coreth version (commit SHA, branch name, or tag)' - required: false - default: '' - libevm: - description: 'LibEVM version (commit SHA, branch name, or tag)' - required: false - default: '' - -outputs: - binary-path: - description: 'Absolute path to built binary (BUILD mode only)' - value: ${{ steps.build.outputs.binary-path }} - -runs: - using: 'composite' - steps: - - name: Checkout AvalancheGo - uses: actions/checkout@v4 - with: - repository: 'ava-labs/avalanchego' - ref: ${{ inputs.avalanchego }} - path: ${{ inputs.checkout-path }} - - name: Setup Go for project - uses: ./.github/actions/setup-go-for-project - - name: Setup Firewood FFI - if: inputs.firewood != '' - id: firewood - uses: ava-labs/firewood/.github/actions/build-action@composable-ci-action - with: - version: ${{ inputs.firewood }} - - name: Update Coreth dependency - if: inputs.coreth != '' - shell: bash - working-directory: ./${{ inputs.checkout-path }} - run: | - echo "Updating Coreth to version: ${{ inputs.coreth }}" - go get github.com/ava-labs/coreth@${{ inputs.coreth }} - - name: Update LibEVM dependency - if: inputs.libevm != '' - shell: bash - working-directory: ./${{ inputs.checkout-path }} - run: | - echo "Updating LibEVM to version: ${{ inputs.libevm }}" - go get github.com/ava-labs/libevm@${{ inputs.libevm }} - - name: Update Firewood FFI - if: inputs.firewood != '' - shell: bash - working-directory: ./${{ inputs.checkout-path }} - run: | - echo "Replacing Firewood FFI with: ${{ steps.firewood.outputs.ffi-path }}" - go mod edit -replace github.com/ava-labs/firewood-go-ethhash/ffi=${{ steps.firewood.outputs.ffi-path }} - - name: Finalize dependencies - if: ${{ inputs.firewood != '' || inputs.coreth != '' || inputs.libevm != '' }} - shell: bash - working-directory: ./${{ inputs.checkout-path }} - run: | - echo "Finalizing Go module dependencies" - go mod tidy - go mod download - - name: Build and run target (BUILD mode) - if: inputs.target != '' - id: build - shell: bash - working-directory: ./${{ inputs.checkout-path }} - run: | - if [ -n "${{ inputs.args }}" ]; then - OUTPUT=$(./scripts/build_target.sh "${{ inputs.target }}" ${{ inputs.args }}) - else - OUTPUT=$(./scripts/build_target.sh "${{ inputs.target }}") - fi - - # Extract binary path from script output - BINARY_PATH=$(echo "$OUTPUT" | grep "BINARY_PATH=" | cut -d'=' -f2) - - # Verify binary path was found - if [ -z "$BINARY_PATH" ]; then - echo "Error: Could not extract binary path from build output" - exit 1 - fi - - # Convert to absolute path to avoid relative pathing issues - ABSOLUTE_BINARY_PATH=$(realpath "$BINARY_PATH") - - # Set output for consumer use - echo "binary-path=$ABSOLUTE_BINARY_PATH" >> $GITHUB_OUTPUT - - name: Upload binary artifact (BUILD mode) - if: inputs.target != '' - uses: actions/upload-artifact@v4 - with: - name: ${{ inputs.target }}-avalanchego_${{ inputs.avalanchego }}-coreth_${{ inputs.coreth }}-libevm_${{ inputs.libevm }}${{ inputs.firewood != '' && format('-firewood_{0}', inputs.firewood) || '' }} - path: ${{ steps.build.outputs.binary-path }} diff --git a/.github/actions/avalanchego-build-action/build_target.sh b/.github/actions/avalanchego-build-action/build_target.sh deleted file mode 100755 index 0583fd5216f1..000000000000 --- a/.github/actions/avalanchego-build-action/build_target.sh +++ /dev/null @@ -1,52 +0,0 @@ -#!/usr/bin/env bash -# Build AvalancheGo target binary and optionally execute with arguments -# Usage: ./scripts/build_target.sh [args...] - -set -euo pipefail - -if [[ $# -eq 0 ]]; then - echo "Usage: $0 [args...]" - echo "Valid targets: avalanchego, reexecution" - exit 1 -fi - -TARGET="$1" -shift # Remove target from arguments, remaining args are for execution - -case "$TARGET" in - "avalanchego") - if [[ ! -f "./scripts/run_task.sh" || ! -x "./scripts/run_task.sh" ]]; then - echo "Error: ./scripts/run_task.sh not found or not executable" - exit 1 - fi - ./scripts/run_task.sh build - EXECUTABLE="./build/avalanchego" - - if [[ ! -f "$EXECUTABLE" ]]; then - echo "Error: Binary $EXECUTABLE was not created" - exit 1 - fi - - echo "BINARY_PATH=$PWD/$EXECUTABLE" - - if [[ $# -gt 0 ]]; then - "$EXECUTABLE" "$@" - fi - ;; - "reexecution") - # Compile reexecution benchmark test into binary - go test -c github.com/ava-labs/avalanchego/tests/reexecute/c -o reexecute-benchmark - EXECUTABLE="./reexecute-benchmark" - - if [[ ! -f "$EXECUTABLE" ]]; then - echo "Error: Binary $EXECUTABLE was not created" - exit 1 - fi - - echo "BINARY_PATH=$PWD/$EXECUTABLE" - ;; - *) - echo "Error: Invalid target '$TARGET'. Valid targets: avalanchego, reexecution" - exit 1 - ;; -esac diff --git a/.github/actions/avalanchego-setup-action/README.md b/.github/actions/avalanchego-setup-action/README.md new file mode 100644 index 000000000000..a561cf1b8d4a --- /dev/null +++ b/.github/actions/avalanchego-setup-action/README.md @@ -0,0 +1,44 @@ +# AvalancheGo Setup Action + +## Overview +This action provides composable CI capabilities for setting up AvalancheGo with custom dependency versions. + +### Why this exists? +Solves CI composability problems by enabling repositories to setup and build AvalancheGo with specific dependency versions without complex setup or cross-repository coordination. + +### Why is it needed? +Dependencies need AvalancheGo as their integration context for realistic testing. +Without this action, setting up AvalancheGo with custom dependency versions requires build knowledge and manual `go mod` manipulation. +Teams either skip proper testing or dump tests in AvalancheGo (wrong ownership). +This action makes AvalancheGo composable - any repository can pull it in as integration context with one line. + +## Security Model +- Repository Restriction: Only allows dependencies from `github.com/ava-labs/*` repositories +- No Custom Forks: Prevents supply chain attacks from malicious forks +- Commit Validation: Validates dependency versions reference ava-labs repositories only + +## Inputs + +| Input | Description | Required | Default | +|-------|-------------|----------|-----------------------| +| `checkout-path` | Directory path where AvalancheGo will be checked out | No | `'.'` | +| `avalanchego` | AvalancheGo version (commit SHA, branch, tag) | No | `'${{ github.sha }}'` | +| `firewood` | Firewood version. Consumer should run Firewood shared workflow first | No | `''` | +| `coreth` | Coreth version (commit SHA, branch, tag) | No | `''` | +| `libevm` | LibEVM version (commit SHA, branch, tag) | No | `''` | + +## Usage Examples + +```yaml +- name: Setup AvalancheGo with Firewood # This will setup go.mod + uses: ./.github/actions/avalanchego-setup-action + with: + checkout-path: "build/avalanchego" + coreth: "my-feature-branch" + libevm: "experimental-branch" + firewood: "ffi/v0.0.12" +- name: Load test # This will compile and run the load test + uses: ./.github/actions/run-monitored-tmpnet-cmd + with: + run: ./scripts/run_task.sh test-load -- --load-timeout=30m --firewood +``` diff --git a/.github/actions/avalanchego-setup-action/action.yml b/.github/actions/avalanchego-setup-action/action.yml new file mode 100644 index 000000000000..2007d42913cf --- /dev/null +++ b/.github/actions/avalanchego-setup-action/action.yml @@ -0,0 +1,69 @@ +name: 'Setup AvalancheGo' +description: 'Setup AvalancheGo with custom dependencies (Firewood, Coreth, LibEVM)' + +inputs: + checkout-path: + description: 'Directory path where AvalancheGo will be checked out' + required: false + default: '.' + avalanchego: + description: 'AvalancheGo version (commit SHA, branch name, or tag)' + required: false + default: ${{ github.sha }} + firewood: + description: 'Firewood version (commit SHA, branch, tag, or ffi/vX.Y.Z for pre-built)' + required: false + default: '' + coreth: + description: 'Coreth version (commit SHA, branch name, or tag)' + required: false + default: '' + libevm: + description: 'LibEVM version (commit SHA, branch name, or tag)' + required: false + default: '' + +runs: + using: 'composite' + steps: + - name: Checkout AvalancheGo + uses: actions/checkout@v4 + with: + repository: 'ava-labs/avalanchego' + ref: ${{ inputs.avalanchego }} + path: ${{ inputs.checkout-path }} + - name: Setup Firewood FFI + if: inputs.firewood != '' + id: firewood + uses: ava-labs/firewood/.github/actions/build-action@composable-ci-action + with: + version: ${{ inputs.firewood }} + - name: Update Coreth dependency + if: inputs.coreth != '' + shell: bash + working-directory: ${{ inputs.checkout-path }} + run: | + echo "Updating Coreth to version: ${{ inputs.coreth }}" + go get github.com/ava-labs/coreth@${{ inputs.coreth }} + - name: Update LibEVM dependency + if: inputs.libevm != '' + shell: bash + working-directory: ${{ inputs.checkout-path }} + run: | + echo "Updating LibEVM to version: ${{ inputs.libevm }}" + go get github.com/ava-labs/libevm@${{ inputs.libevm }} + - name: Update Firewood FFI + if: inputs.firewood != '' + shell: bash + working-directory: ${{ inputs.checkout-path }} + run: | + echo "Replacing Firewood FFI with: ${{ steps.firewood.outputs.ffi-path }}" + go mod edit -replace github.com/ava-labs/firewood-go-ethhash/ffi=${{ steps.firewood.outputs.ffi-path }} + - name: Finalize dependencies + if: ${{ inputs.firewood != '' || inputs.coreth != '' || inputs.libevm != '' }} + shell: bash + working-directory: ${{ inputs.checkout-path }} + run: | + echo "Finalizing Go module dependencies" + go mod tidy + go mod download From 4257069dceacd942cea33a6c4579d769596277b3 Mon Sep 17 00:00:00 2001 From: "Elvis S." Date: Mon, 29 Sep 2025 19:30:30 +0400 Subject: [PATCH 29/36] ci: test composition --- .../avalanchego-setup-action/action.yml | 20 +- .github/workflows/ci.yml | 558 ++++++++++-------- 2 files changed, 298 insertions(+), 280 deletions(-) diff --git a/.github/actions/avalanchego-setup-action/action.yml b/.github/actions/avalanchego-setup-action/action.yml index 2007d42913cf..7d65c0a1efce 100644 --- a/.github/actions/avalanchego-setup-action/action.yml +++ b/.github/actions/avalanchego-setup-action/action.yml @@ -32,12 +32,6 @@ runs: repository: 'ava-labs/avalanchego' ref: ${{ inputs.avalanchego }} path: ${{ inputs.checkout-path }} - - name: Setup Firewood FFI - if: inputs.firewood != '' - id: firewood - uses: ava-labs/firewood/.github/actions/build-action@composable-ci-action - with: - version: ${{ inputs.firewood }} - name: Update Coreth dependency if: inputs.coreth != '' shell: bash @@ -52,18 +46,8 @@ runs: run: | echo "Updating LibEVM to version: ${{ inputs.libevm }}" go get github.com/ava-labs/libevm@${{ inputs.libevm }} - - name: Update Firewood FFI + - name: Setup Firewood FFI if: inputs.firewood != '' shell: bash working-directory: ${{ inputs.checkout-path }} - run: | - echo "Replacing Firewood FFI with: ${{ steps.firewood.outputs.ffi-path }}" - go mod edit -replace github.com/ava-labs/firewood-go-ethhash/ffi=${{ steps.firewood.outputs.ffi-path }} - - name: Finalize dependencies - if: ${{ inputs.firewood != '' || inputs.coreth != '' || inputs.libevm != '' }} - shell: bash - working-directory: ${{ inputs.checkout-path }} - run: | - echo "Finalizing Go module dependencies" - go mod tidy - go mod download + run: ./scripts/setup_firewood.sh ${{ inputs.firewood }} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index dbfe906bd039..24c3b10b097d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,265 +20,299 @@ concurrency: cancel-in-progress: true jobs: - Unit: - 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 - env: - TIMEOUT: ${{ env.TIMEOUT }} - Fuzz: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: ./.github/actions/setup-go-for-project - - name: test-fuzz - shell: bash - run: ./scripts/run_task.sh test-fuzz - e2e: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: ./.github/actions/setup-go-for-project - - name: Run e2e tests - uses: ./.github/actions/run-monitored-tmpnet-cmd - with: - run: ./scripts/run_task.sh test-e2e-ci - artifact_prefix: e2e - filter_by_owner: avalanchego-e2e - 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 || '' }} - e2e_post_granite: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: ./.github/actions/setup-go-for-project - - name: Run e2e tests - uses: ./.github/actions/run-monitored-tmpnet-cmd - with: - run: ./scripts/run_task.sh test-e2e-ci -- --activate-granite - artifact_prefix: e2e-post-granite - filter_by_owner: avalanchego-e2e - 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 || '' }} - e2e_kube: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: ./.github/actions/setup-go-for-project - - uses: ./.github/actions/run-monitored-tmpnet-cmd - with: - run: ./scripts/run_task.sh test-e2e-kube-ci - runtime: kube - artifact_prefix: e2e-kube - filter_by_owner: avalanchego-e2e - 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 || '' }} - e2e_existing_network: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: ./.github/actions/setup-go-for-project - - name: Run e2e tests with existing network - uses: ./.github/actions/run-monitored-tmpnet-cmd - with: - run: ./scripts/run_task.sh test-e2e-existing-ci - artifact_prefix: e2e-existing-network - 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: - - uses: actions/checkout@v4 - - uses: ./.github/actions/setup-go-for-project - - name: Run e2e tests - uses: ./.github/actions/run-monitored-tmpnet-cmd - with: - run: ./scripts/run_task.sh test-upgrade - artifact_prefix: upgrade - 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 || '' }} - Lint: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: ./.github/actions/setup-go-for-project - - uses: ./.github/actions/install-nix - - name: Runs all lint checks - shell: nix develop --command bash -x {0} - run: ./scripts/run_task.sh lint-all-ci - links-lint: - name: Markdown Links Lint - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: umbrelladocs/action-linkspector@de84085e0f51452a470558693d7d308fbb2fa261 #v1.2.5 - with: - fail_level: any - check_generated_protobuf: - name: Up-to-date protobuf - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: ./.github/actions/setup-go-for-project - # Use the dev shell instead of bufbuild/buf-action to ensure the dev shell provides the expected versions - - uses: ./.github/actions/install-nix - - shell: nix develop --command bash -x {0} - run: ./scripts/run_task.sh check-generate-protobuf - check_mockgen: - name: Up-to-date mocks - 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-mocks - check_canotogen: - name: Up-to-date canoto - 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-canoto - check_contract_bindings: - name: Up-to-date contract bindings - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: ./.github/actions/setup-go-for-project - - uses: ./.github/actions/install-nix - - shell: nix develop --command bash -x {0} - run: task check-generate-load-contract-bindings - go_mod_tidy: - name: Up-to-date go.mod and go.sum - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: ./.github/actions/setup-go-for-project - - shell: bash - run: ./scripts/run_task.sh check-go-mod-tidy - test_build_image: - name: Image build - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Install qemu (required for cross-platform builds) - run: | - sudo apt update - sudo apt -y install qemu-system qemu-user-static - - name: Check image build - shell: bash - run: ./scripts/run_task.sh test-build-image - test_build_antithesis_avalanchego_images: - name: Build Antithesis avalanchego images - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: ./.github/actions/setup-go-for-project - - name: Check image build for avalanchego test setup - shell: bash - run: ./scripts/run_task.sh test-build-antithesis-images-avalanchego - test_build_antithesis_xsvm_images: - name: Build Antithesis xsvm images - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: ./.github/actions/setup-go-for-project - - name: Check image build for xsvm test setup - shell: bash - run: ./scripts/run_task.sh test-build-antithesis-images-xsvm - e2e_bootstrap_monitor: - name: Run bootstrap monitor e2e tests - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: ./.github/actions/setup-go-for-project - - uses: ./.github/actions/install-nix - - name: Run e2e tests - shell: bash - run: nix develop --command ./scripts/run_task.sh test-bootstrap-monitor-e2e - load: - name: Run process-based load test - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: ./.github/actions/setup-go-for-project - - uses: ./.github/actions/run-monitored-tmpnet-cmd - with: - run: ./scripts/run_task.sh test-load -- --load-timeout=30s - artifact_prefix: load - 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 || '' }} - load_kube_kind: - name: Run load test on kind cluster - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: ./.github/actions/setup-go-for-project - - uses: ./.github/actions/run-monitored-tmpnet-cmd - with: - run: ./scripts/run_task.sh test-load-kube-kind -- --load-timeout=30s - runtime: kube - artifact_prefix: load-kube - 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 || '' }} - robustness: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: ./.github/actions/setup-go-for-project - - uses: ./.github/actions/install-nix - # TODO(marun) Extend testing of robustness beyond deploying a suitable test environment - - name: Deploy kind with chaos mesh - shell: bash - run: nix develop --command ./scripts/run_task.sh test-robustness +# Unit: +# 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 +# env: +# TIMEOUT: ${{ env.TIMEOUT }} +# Fuzz: +# runs-on: ubuntu-latest +# steps: +# - uses: actions/checkout@v4 +# - uses: ./.github/actions/setup-go-for-project +# - name: test-fuzz +# shell: bash +# run: ./scripts/run_task.sh test-fuzz +# e2e: +# runs-on: ubuntu-latest +# steps: +# - uses: actions/checkout@v4 +# - uses: ./.github/actions/setup-go-for-project +# - name: Run e2e tests +# uses: ./.github/actions/run-monitored-tmpnet-cmd +# with: +# run: ./scripts/run_task.sh test-e2e-ci +# artifact_prefix: e2e +# filter_by_owner: avalanchego-e2e +# 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 || '' }} +# e2e_post_granite: +# runs-on: ubuntu-latest +# steps: +# - uses: actions/checkout@v4 +# - uses: ./.github/actions/setup-go-for-project +# - name: Run e2e tests +# uses: ./.github/actions/run-monitored-tmpnet-cmd +# with: +# run: ./scripts/run_task.sh test-e2e-ci -- --activate-granite +# artifact_prefix: e2e-post-granite +# filter_by_owner: avalanchego-e2e +# 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 || '' }} +# e2e_kube: +# runs-on: ubuntu-latest +# steps: +# - uses: actions/checkout@v4 +# - uses: ./.github/actions/setup-go-for-project +# - uses: ./.github/actions/run-monitored-tmpnet-cmd +# with: +# run: ./scripts/run_task.sh test-e2e-kube-ci +# runtime: kube +# artifact_prefix: e2e-kube +# filter_by_owner: avalanchego-e2e +# 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 || '' }} +# e2e_existing_network: +# runs-on: ubuntu-latest +# steps: +# - uses: actions/checkout@v4 +# - uses: ./.github/actions/setup-go-for-project +# - name: Run e2e tests with existing network +# uses: ./.github/actions/run-monitored-tmpnet-cmd +# with: +# run: ./scripts/run_task.sh test-e2e-existing-ci +# artifact_prefix: e2e-existing-network +# 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: +# - uses: actions/checkout@v4 +# - uses: ./.github/actions/setup-go-for-project +# - name: Run e2e tests +# uses: ./.github/actions/run-monitored-tmpnet-cmd +# with: +# run: ./scripts/run_task.sh test-upgrade +# artifact_prefix: upgrade +# 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 || '' }} +# Lint: +# runs-on: ubuntu-latest +# steps: +# - uses: actions/checkout@v4 +# - uses: ./.github/actions/setup-go-for-project +# - uses: ./.github/actions/install-nix +# - name: Runs all lint checks +# shell: nix develop --command bash -x {0} +# run: ./scripts/run_task.sh lint-all-ci +# links-lint: +# name: Markdown Links Lint +# runs-on: ubuntu-latest +# steps: +# - uses: actions/checkout@v4 +# - uses: umbrelladocs/action-linkspector@de84085e0f51452a470558693d7d308fbb2fa261 #v1.2.5 +# with: +# fail_level: any +# check_generated_protobuf: +# name: Up-to-date protobuf +# runs-on: ubuntu-latest +# steps: +# - uses: actions/checkout@v4 +# - uses: ./.github/actions/setup-go-for-project +# # Use the dev shell instead of bufbuild/buf-action to ensure the dev shell provides the expected versions +# - uses: ./.github/actions/install-nix +# - shell: nix develop --command bash -x {0} +# run: ./scripts/run_task.sh check-generate-protobuf +# check_mockgen: +# name: Up-to-date mocks +# 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-mocks +# check_canotogen: +# name: Up-to-date canoto +# 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-canoto +# check_contract_bindings: +# name: Up-to-date contract bindings +# runs-on: ubuntu-latest +# steps: +# - uses: actions/checkout@v4 +# - uses: ./.github/actions/setup-go-for-project +# - uses: ./.github/actions/install-nix +# - shell: nix develop --command bash -x {0} +# run: task check-generate-load-contract-bindings +# go_mod_tidy: +# name: Up-to-date go.mod and go.sum +# runs-on: ubuntu-latest +# steps: +# - uses: actions/checkout@v4 +# - uses: ./.github/actions/setup-go-for-project +# - shell: bash +# run: ./scripts/run_task.sh check-go-mod-tidy +# test_build_image: +# name: Image build +# runs-on: ubuntu-latest +# steps: +# - uses: actions/checkout@v4 +# - name: Install qemu (required for cross-platform builds) +# run: | +# sudo apt update +# sudo apt -y install qemu-system qemu-user-static +# - name: Check image build +# shell: bash +# run: ./scripts/run_task.sh test-build-image +# test_build_antithesis_avalanchego_images: +# name: Build Antithesis avalanchego images +# runs-on: ubuntu-latest +# steps: +# - uses: actions/checkout@v4 +# - uses: ./.github/actions/setup-go-for-project +# - name: Check image build for avalanchego test setup +# shell: bash +# run: ./scripts/run_task.sh test-build-antithesis-images-avalanchego +# test_build_antithesis_xsvm_images: +# name: Build Antithesis xsvm images +# runs-on: ubuntu-latest +# steps: +# - uses: actions/checkout@v4 +# - uses: ./.github/actions/setup-go-for-project +# - name: Check image build for xsvm test setup +# shell: bash +# run: ./scripts/run_task.sh test-build-antithesis-images-xsvm +# e2e_bootstrap_monitor: +# name: Run bootstrap monitor e2e tests +# runs-on: ubuntu-latest +# steps: +# - uses: actions/checkout@v4 +# - uses: ./.github/actions/setup-go-for-project +# - uses: ./.github/actions/install-nix +# - name: Run e2e tests +# shell: bash +# run: nix develop --command ./scripts/run_task.sh test-bootstrap-monitor-e2e +# load: +# name: Run process-based load test +# runs-on: ubuntu-latest +# steps: +# - uses: actions/checkout@v4 +# - uses: ./.github/actions/setup-go-for-project +# - uses: ./.github/actions/run-monitored-tmpnet-cmd +# with: +# run: ./scripts/run_task.sh test-load -- --load-timeout=30s +# artifact_prefix: load +# 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 || '' }} +# load_kube_kind: +# name: Run load test on kind cluster +# runs-on: ubuntu-latest +# steps: +# - uses: actions/checkout@v4 +# - uses: ./.github/actions/setup-go-for-project +# - uses: ./.github/actions/run-monitored-tmpnet-cmd +# with: +# run: ./scripts/run_task.sh test-load-kube-kind -- --load-timeout=30s +# runtime: kube +# artifact_prefix: load-kube +# 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 || '' }} +# robustness: +# runs-on: ubuntu-latest +# steps: +# - uses: actions/checkout@v4 +# - uses: ./.github/actions/setup-go-for-project +# - uses: ./.github/actions/install-nix +# # TODO(marun) Extend testing of robustness beyond deploying a suitable test environment +# - name: Deploy kind with chaos mesh +# shell: bash +# run: nix develop --command ./scripts/run_task.sh test-robustness + firewood-12-reexecution: + runs-on: avalanche-avalanchego-runner + container: + image: ghcr.io/actions/actions-runner:2.325.0 + steps: + - uses: actions/checkout@v4 + - uses: ./.github/actions/setup-go-for-project + - uses: ./.github/actions/avalanchego-setup-action + with: + firewood: 'ffi/v0.0.12' + - name: Firewood v0.0.12 Reexecution + uses: ./.github/actions/c-chain-reexecution-benchmark + with: + aws-region: 'us-east-2' + aws-role: ${{ secrets.AWS_S3_READ_ONLY_ROLE }} + github-token: ${{ secrets.GITHUB_TOKEN }} + runner_name: 'self-hosted-runner-0.0.12' + firewood-13-reexecution: + runs-on: avalanche-avalanchego-runner + container: + image: ghcr.io/actions/actions-runner:2.325.0 + steps: + - uses: actions/checkout@v4 + - uses: ./.github/actions/setup-go-for-project + - uses: ./.github/actions/avalanchego-setup-action + with: + firewood: 'ffi/v0.0.13' + - name: Firewood v0.0.13 Reexecution + uses: ./.github/actions/c-chain-reexecution-benchmark + with: + aws-region: 'us-east-2' + aws-role: ${{ secrets.AWS_S3_READ_ONLY_ROLE }} + github-token: ${{ secrets.GITHUB_TOKEN }} + runner_name: 'self-hosted-runner-0.0.13' From 24805ed92c7a7ee79d85b6317f23909060876dec Mon Sep 17 00:00:00 2001 From: "Elvis S." Date: Mon, 29 Sep 2025 19:35:20 +0400 Subject: [PATCH 30/36] ci: test composition - switch AWS role --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 24c3b10b097d..37f2beb286d1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -296,7 +296,7 @@ jobs: uses: ./.github/actions/c-chain-reexecution-benchmark with: aws-region: 'us-east-2' - aws-role: ${{ secrets.AWS_S3_READ_ONLY_ROLE }} + aws-role: ${{ secrets.AWS_S3_RW_ROLE }} github-token: ${{ secrets.GITHUB_TOKEN }} runner_name: 'self-hosted-runner-0.0.12' firewood-13-reexecution: @@ -313,6 +313,6 @@ jobs: uses: ./.github/actions/c-chain-reexecution-benchmark with: aws-region: 'us-east-2' - aws-role: ${{ secrets.AWS_S3_READ_ONLY_ROLE }} + aws-role: ${{ secrets.AWS_S3_RW_ROLE }} github-token: ${{ secrets.GITHUB_TOKEN }} runner_name: 'self-hosted-runner-0.0.13' From 7503a0c75835aedd0d7234607bc166b74f38c501 Mon Sep 17 00:00:00 2001 From: "Elvis S." Date: Mon, 29 Sep 2025 19:42:12 +0400 Subject: [PATCH 31/36] ci: test composition - switch AWS role --- .github/workflows/ci.yml | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 37f2beb286d1..63551cb73eb5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -295,10 +295,14 @@ jobs: - name: Firewood v0.0.12 Reexecution uses: ./.github/actions/c-chain-reexecution-benchmark with: - aws-region: 'us-east-2' - aws-role: ${{ secrets.AWS_S3_RW_ROLE }} + aws-role: ${{ secrets.AWS_S3_READ_ONLY_ROLE }} + aws-region: us-east-2 github-token: ${{ secrets.GITHUB_TOKEN }} - runner_name: 'self-hosted-runner-0.0.12' + push-post-state: '' + runner_name: 'avalanche-avalanchego-runner-v0.0.12' + prometheus-push-url: ${{ secrets.PROMETHEUS_PUSH_URL || '' }} + prometheus-username: ${{ secrets.PROMETHEUS_USERNAME || '' }} + prometheus-password: ${{ secrets.PROMETHEUS_PASSWORD || '' }} firewood-13-reexecution: runs-on: avalanche-avalanchego-runner container: @@ -312,7 +316,11 @@ jobs: - name: Firewood v0.0.13 Reexecution uses: ./.github/actions/c-chain-reexecution-benchmark with: - aws-region: 'us-east-2' - aws-role: ${{ secrets.AWS_S3_RW_ROLE }} + aws-role: ${{ secrets.AWS_S3_READ_ONLY_ROLE }} + aws-region: us-east-2 github-token: ${{ secrets.GITHUB_TOKEN }} - runner_name: 'self-hosted-runner-0.0.13' + push-post-state: '' + runner_name: 'avalanche-avalanchego-runner-v0.0.13' + prometheus-push-url: ${{ secrets.PROMETHEUS_PUSH_URL || '' }} + prometheus-username: ${{ secrets.PROMETHEUS_USERNAME || '' }} + prometheus-password: ${{ secrets.PROMETHEUS_PASSWORD || '' }} From 9f82ca877fe05d79dbf49f88563574a6d57ee6aa Mon Sep 17 00:00:00 2001 From: "Elvis S." Date: Mon, 29 Sep 2025 19:45:55 +0400 Subject: [PATCH 32/36] ci: test composition - set permissions --- .github/workflows/ci.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 63551cb73eb5..684f9cf33cf2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -286,6 +286,9 @@ jobs: runs-on: avalanche-avalanchego-runner container: image: ghcr.io/actions/actions-runner:2.325.0 + permissions: + id-token: write + contents: read steps: - uses: actions/checkout@v4 - uses: ./.github/actions/setup-go-for-project @@ -307,6 +310,9 @@ jobs: runs-on: avalanche-avalanchego-runner container: image: ghcr.io/actions/actions-runner:2.325.0 + permissions: + id-token: write + contents: read steps: - uses: actions/checkout@v4 - uses: ./.github/actions/setup-go-for-project From db1bbc5c1a16f785623f16a89d9beb64e2178317 Mon Sep 17 00:00:00 2001 From: "Elvis S." Date: Mon, 29 Sep 2025 19:48:19 +0400 Subject: [PATCH 33/36] ci: test composition - set permissions --- .github/workflows/ci.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 684f9cf33cf2..9ef1cc6cb6df 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -290,6 +290,14 @@ jobs: id-token: write contents: read steps: + - name: Install ARC Dependencies + shell: bash + run: | + # xz-utils might be present on some containers. Install if not present. + if ! command -v xz &> /dev/null; then + sudo apt-get update + sudo apt-get install -y xz-utils + fi - uses: actions/checkout@v4 - uses: ./.github/actions/setup-go-for-project - uses: ./.github/actions/avalanchego-setup-action @@ -314,6 +322,14 @@ jobs: id-token: write contents: read steps: + - name: Install ARC Dependencies + shell: bash + run: | + # xz-utils might be present on some containers. Install if not present. + if ! command -v xz &> /dev/null; then + sudo apt-get update + sudo apt-get install -y xz-utils + fi - uses: actions/checkout@v4 - uses: ./.github/actions/setup-go-for-project - uses: ./.github/actions/avalanchego-setup-action From 4df4b98dd5d9930be8d95912d8264fa516cb729e Mon Sep 17 00:00:00 2001 From: "Elvis S." Date: Mon, 29 Sep 2025 19:54:01 +0400 Subject: [PATCH 34/36] ci: test composition, set `config: firewood` to reexec bench --- .github/workflows/ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9ef1cc6cb6df..e703712dd26e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -306,6 +306,7 @@ jobs: - name: Firewood v0.0.12 Reexecution uses: ./.github/actions/c-chain-reexecution-benchmark with: + config: 'firewood' aws-role: ${{ secrets.AWS_S3_READ_ONLY_ROLE }} aws-region: us-east-2 github-token: ${{ secrets.GITHUB_TOKEN }} @@ -338,6 +339,7 @@ jobs: - name: Firewood v0.0.13 Reexecution uses: ./.github/actions/c-chain-reexecution-benchmark with: + config: 'firewood' aws-role: ${{ secrets.AWS_S3_READ_ONLY_ROLE }} aws-region: us-east-2 github-token: ${{ secrets.GITHUB_TOKEN }} From 1674dfaf1135cc21d63c4a8a6bfbaee6c915b36a Mon Sep 17 00:00:00 2001 From: "Elvis S." Date: Mon, 29 Sep 2025 20:02:22 +0400 Subject: [PATCH 35/36] ci: set current state dir src to firewood 100 --- .github/workflows/ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e703712dd26e..e5fcc209a1f4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -307,6 +307,7 @@ jobs: uses: ./.github/actions/c-chain-reexecution-benchmark with: config: 'firewood' + current-state-dir-src: 's3://avalanchego-bootstrap-testing/cchain-current-state-firewood-100/**' aws-role: ${{ secrets.AWS_S3_READ_ONLY_ROLE }} aws-region: us-east-2 github-token: ${{ secrets.GITHUB_TOKEN }} @@ -340,6 +341,7 @@ jobs: uses: ./.github/actions/c-chain-reexecution-benchmark with: config: 'firewood' + current-state-dir-src: 's3://avalanchego-bootstrap-testing/cchain-current-state-firewood-100/**' aws-role: ${{ secrets.AWS_S3_READ_ONLY_ROLE }} aws-region: us-east-2 github-token: ${{ secrets.GITHUB_TOKEN }} From 6de7ef24da194951a670ad8f3c96999471a15e7f Mon Sep 17 00:00:00 2001 From: "Elvis S." Date: Mon, 29 Sep 2025 20:11:05 +0400 Subject: [PATCH 36/36] ci: revert to default --- .github/workflows/ci.yml | 592 +++++++++++++++++---------------------- 1 file changed, 262 insertions(+), 330 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e5fcc209a1f4..dbfe906bd039 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,333 +20,265 @@ concurrency: cancel-in-progress: true jobs: -# Unit: -# 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 -# env: -# TIMEOUT: ${{ env.TIMEOUT }} -# Fuzz: -# runs-on: ubuntu-latest -# steps: -# - uses: actions/checkout@v4 -# - uses: ./.github/actions/setup-go-for-project -# - name: test-fuzz -# shell: bash -# run: ./scripts/run_task.sh test-fuzz -# e2e: -# runs-on: ubuntu-latest -# steps: -# - uses: actions/checkout@v4 -# - uses: ./.github/actions/setup-go-for-project -# - name: Run e2e tests -# uses: ./.github/actions/run-monitored-tmpnet-cmd -# with: -# run: ./scripts/run_task.sh test-e2e-ci -# artifact_prefix: e2e -# filter_by_owner: avalanchego-e2e -# 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 || '' }} -# e2e_post_granite: -# runs-on: ubuntu-latest -# steps: -# - uses: actions/checkout@v4 -# - uses: ./.github/actions/setup-go-for-project -# - name: Run e2e tests -# uses: ./.github/actions/run-monitored-tmpnet-cmd -# with: -# run: ./scripts/run_task.sh test-e2e-ci -- --activate-granite -# artifact_prefix: e2e-post-granite -# filter_by_owner: avalanchego-e2e -# 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 || '' }} -# e2e_kube: -# runs-on: ubuntu-latest -# steps: -# - uses: actions/checkout@v4 -# - uses: ./.github/actions/setup-go-for-project -# - uses: ./.github/actions/run-monitored-tmpnet-cmd -# with: -# run: ./scripts/run_task.sh test-e2e-kube-ci -# runtime: kube -# artifact_prefix: e2e-kube -# filter_by_owner: avalanchego-e2e -# 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 || '' }} -# e2e_existing_network: -# runs-on: ubuntu-latest -# steps: -# - uses: actions/checkout@v4 -# - uses: ./.github/actions/setup-go-for-project -# - name: Run e2e tests with existing network -# uses: ./.github/actions/run-monitored-tmpnet-cmd -# with: -# run: ./scripts/run_task.sh test-e2e-existing-ci -# artifact_prefix: e2e-existing-network -# 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: -# - uses: actions/checkout@v4 -# - uses: ./.github/actions/setup-go-for-project -# - name: Run e2e tests -# uses: ./.github/actions/run-monitored-tmpnet-cmd -# with: -# run: ./scripts/run_task.sh test-upgrade -# artifact_prefix: upgrade -# 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 || '' }} -# Lint: -# runs-on: ubuntu-latest -# steps: -# - uses: actions/checkout@v4 -# - uses: ./.github/actions/setup-go-for-project -# - uses: ./.github/actions/install-nix -# - name: Runs all lint checks -# shell: nix develop --command bash -x {0} -# run: ./scripts/run_task.sh lint-all-ci -# links-lint: -# name: Markdown Links Lint -# runs-on: ubuntu-latest -# steps: -# - uses: actions/checkout@v4 -# - uses: umbrelladocs/action-linkspector@de84085e0f51452a470558693d7d308fbb2fa261 #v1.2.5 -# with: -# fail_level: any -# check_generated_protobuf: -# name: Up-to-date protobuf -# runs-on: ubuntu-latest -# steps: -# - uses: actions/checkout@v4 -# - uses: ./.github/actions/setup-go-for-project -# # Use the dev shell instead of bufbuild/buf-action to ensure the dev shell provides the expected versions -# - uses: ./.github/actions/install-nix -# - shell: nix develop --command bash -x {0} -# run: ./scripts/run_task.sh check-generate-protobuf -# check_mockgen: -# name: Up-to-date mocks -# 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-mocks -# check_canotogen: -# name: Up-to-date canoto -# 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-canoto -# check_contract_bindings: -# name: Up-to-date contract bindings -# runs-on: ubuntu-latest -# steps: -# - uses: actions/checkout@v4 -# - uses: ./.github/actions/setup-go-for-project -# - uses: ./.github/actions/install-nix -# - shell: nix develop --command bash -x {0} -# run: task check-generate-load-contract-bindings -# go_mod_tidy: -# name: Up-to-date go.mod and go.sum -# runs-on: ubuntu-latest -# steps: -# - uses: actions/checkout@v4 -# - uses: ./.github/actions/setup-go-for-project -# - shell: bash -# run: ./scripts/run_task.sh check-go-mod-tidy -# test_build_image: -# name: Image build -# runs-on: ubuntu-latest -# steps: -# - uses: actions/checkout@v4 -# - name: Install qemu (required for cross-platform builds) -# run: | -# sudo apt update -# sudo apt -y install qemu-system qemu-user-static -# - name: Check image build -# shell: bash -# run: ./scripts/run_task.sh test-build-image -# test_build_antithesis_avalanchego_images: -# name: Build Antithesis avalanchego images -# runs-on: ubuntu-latest -# steps: -# - uses: actions/checkout@v4 -# - uses: ./.github/actions/setup-go-for-project -# - name: Check image build for avalanchego test setup -# shell: bash -# run: ./scripts/run_task.sh test-build-antithesis-images-avalanchego -# test_build_antithesis_xsvm_images: -# name: Build Antithesis xsvm images -# runs-on: ubuntu-latest -# steps: -# - uses: actions/checkout@v4 -# - uses: ./.github/actions/setup-go-for-project -# - name: Check image build for xsvm test setup -# shell: bash -# run: ./scripts/run_task.sh test-build-antithesis-images-xsvm -# e2e_bootstrap_monitor: -# name: Run bootstrap monitor e2e tests -# runs-on: ubuntu-latest -# steps: -# - uses: actions/checkout@v4 -# - uses: ./.github/actions/setup-go-for-project -# - uses: ./.github/actions/install-nix -# - name: Run e2e tests -# shell: bash -# run: nix develop --command ./scripts/run_task.sh test-bootstrap-monitor-e2e -# load: -# name: Run process-based load test -# runs-on: ubuntu-latest -# steps: -# - uses: actions/checkout@v4 -# - uses: ./.github/actions/setup-go-for-project -# - uses: ./.github/actions/run-monitored-tmpnet-cmd -# with: -# run: ./scripts/run_task.sh test-load -- --load-timeout=30s -# artifact_prefix: load -# 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 || '' }} -# load_kube_kind: -# name: Run load test on kind cluster -# runs-on: ubuntu-latest -# steps: -# - uses: actions/checkout@v4 -# - uses: ./.github/actions/setup-go-for-project -# - uses: ./.github/actions/run-monitored-tmpnet-cmd -# with: -# run: ./scripts/run_task.sh test-load-kube-kind -- --load-timeout=30s -# runtime: kube -# artifact_prefix: load-kube -# 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 || '' }} -# robustness: -# runs-on: ubuntu-latest -# steps: -# - uses: actions/checkout@v4 -# - uses: ./.github/actions/setup-go-for-project -# - uses: ./.github/actions/install-nix -# # TODO(marun) Extend testing of robustness beyond deploying a suitable test environment -# - name: Deploy kind with chaos mesh -# shell: bash -# run: nix develop --command ./scripts/run_task.sh test-robustness - firewood-12-reexecution: - runs-on: avalanche-avalanchego-runner - container: - image: ghcr.io/actions/actions-runner:2.325.0 - permissions: - id-token: write - contents: read - steps: - - name: Install ARC Dependencies - shell: bash - run: | - # xz-utils might be present on some containers. Install if not present. - if ! command -v xz &> /dev/null; then - sudo apt-get update - sudo apt-get install -y xz-utils - fi - - uses: actions/checkout@v4 - - uses: ./.github/actions/setup-go-for-project - - uses: ./.github/actions/avalanchego-setup-action - with: - firewood: 'ffi/v0.0.12' - - name: Firewood v0.0.12 Reexecution - uses: ./.github/actions/c-chain-reexecution-benchmark - with: - config: 'firewood' - current-state-dir-src: 's3://avalanchego-bootstrap-testing/cchain-current-state-firewood-100/**' - aws-role: ${{ secrets.AWS_S3_READ_ONLY_ROLE }} - aws-region: us-east-2 - github-token: ${{ secrets.GITHUB_TOKEN }} - push-post-state: '' - runner_name: 'avalanche-avalanchego-runner-v0.0.12' - prometheus-push-url: ${{ secrets.PROMETHEUS_PUSH_URL || '' }} - prometheus-username: ${{ secrets.PROMETHEUS_USERNAME || '' }} - prometheus-password: ${{ secrets.PROMETHEUS_PASSWORD || '' }} - firewood-13-reexecution: - runs-on: avalanche-avalanchego-runner - container: - image: ghcr.io/actions/actions-runner:2.325.0 - permissions: - id-token: write - contents: read - steps: - - name: Install ARC Dependencies - shell: bash - run: | - # xz-utils might be present on some containers. Install if not present. - if ! command -v xz &> /dev/null; then - sudo apt-get update - sudo apt-get install -y xz-utils - fi - - uses: actions/checkout@v4 - - uses: ./.github/actions/setup-go-for-project - - uses: ./.github/actions/avalanchego-setup-action - with: - firewood: 'ffi/v0.0.13' - - name: Firewood v0.0.13 Reexecution - uses: ./.github/actions/c-chain-reexecution-benchmark - with: - config: 'firewood' - current-state-dir-src: 's3://avalanchego-bootstrap-testing/cchain-current-state-firewood-100/**' - aws-role: ${{ secrets.AWS_S3_READ_ONLY_ROLE }} - aws-region: us-east-2 - github-token: ${{ secrets.GITHUB_TOKEN }} - push-post-state: '' - runner_name: 'avalanche-avalanchego-runner-v0.0.13' - prometheus-push-url: ${{ secrets.PROMETHEUS_PUSH_URL || '' }} - prometheus-username: ${{ secrets.PROMETHEUS_USERNAME || '' }} - prometheus-password: ${{ secrets.PROMETHEUS_PASSWORD || '' }} + Unit: + 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 + env: + TIMEOUT: ${{ env.TIMEOUT }} + Fuzz: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: ./.github/actions/setup-go-for-project + - name: test-fuzz + shell: bash + run: ./scripts/run_task.sh test-fuzz + e2e: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: ./.github/actions/setup-go-for-project + - name: Run e2e tests + uses: ./.github/actions/run-monitored-tmpnet-cmd + with: + run: ./scripts/run_task.sh test-e2e-ci + artifact_prefix: e2e + filter_by_owner: avalanchego-e2e + 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 || '' }} + e2e_post_granite: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: ./.github/actions/setup-go-for-project + - name: Run e2e tests + uses: ./.github/actions/run-monitored-tmpnet-cmd + with: + run: ./scripts/run_task.sh test-e2e-ci -- --activate-granite + artifact_prefix: e2e-post-granite + filter_by_owner: avalanchego-e2e + 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 || '' }} + e2e_kube: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: ./.github/actions/setup-go-for-project + - uses: ./.github/actions/run-monitored-tmpnet-cmd + with: + run: ./scripts/run_task.sh test-e2e-kube-ci + runtime: kube + artifact_prefix: e2e-kube + filter_by_owner: avalanchego-e2e + 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 || '' }} + e2e_existing_network: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: ./.github/actions/setup-go-for-project + - name: Run e2e tests with existing network + uses: ./.github/actions/run-monitored-tmpnet-cmd + with: + run: ./scripts/run_task.sh test-e2e-existing-ci + artifact_prefix: e2e-existing-network + 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: + - uses: actions/checkout@v4 + - uses: ./.github/actions/setup-go-for-project + - name: Run e2e tests + uses: ./.github/actions/run-monitored-tmpnet-cmd + with: + run: ./scripts/run_task.sh test-upgrade + artifact_prefix: upgrade + 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 || '' }} + Lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: ./.github/actions/setup-go-for-project + - uses: ./.github/actions/install-nix + - name: Runs all lint checks + shell: nix develop --command bash -x {0} + run: ./scripts/run_task.sh lint-all-ci + links-lint: + name: Markdown Links Lint + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: umbrelladocs/action-linkspector@de84085e0f51452a470558693d7d308fbb2fa261 #v1.2.5 + with: + fail_level: any + check_generated_protobuf: + name: Up-to-date protobuf + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: ./.github/actions/setup-go-for-project + # Use the dev shell instead of bufbuild/buf-action to ensure the dev shell provides the expected versions + - uses: ./.github/actions/install-nix + - shell: nix develop --command bash -x {0} + run: ./scripts/run_task.sh check-generate-protobuf + check_mockgen: + name: Up-to-date mocks + 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-mocks + check_canotogen: + name: Up-to-date canoto + 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-canoto + check_contract_bindings: + name: Up-to-date contract bindings + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: ./.github/actions/setup-go-for-project + - uses: ./.github/actions/install-nix + - shell: nix develop --command bash -x {0} + run: task check-generate-load-contract-bindings + go_mod_tidy: + name: Up-to-date go.mod and go.sum + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: ./.github/actions/setup-go-for-project + - shell: bash + run: ./scripts/run_task.sh check-go-mod-tidy + test_build_image: + name: Image build + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Install qemu (required for cross-platform builds) + run: | + sudo apt update + sudo apt -y install qemu-system qemu-user-static + - name: Check image build + shell: bash + run: ./scripts/run_task.sh test-build-image + test_build_antithesis_avalanchego_images: + name: Build Antithesis avalanchego images + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: ./.github/actions/setup-go-for-project + - name: Check image build for avalanchego test setup + shell: bash + run: ./scripts/run_task.sh test-build-antithesis-images-avalanchego + test_build_antithesis_xsvm_images: + name: Build Antithesis xsvm images + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: ./.github/actions/setup-go-for-project + - name: Check image build for xsvm test setup + shell: bash + run: ./scripts/run_task.sh test-build-antithesis-images-xsvm + e2e_bootstrap_monitor: + name: Run bootstrap monitor e2e tests + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: ./.github/actions/setup-go-for-project + - uses: ./.github/actions/install-nix + - name: Run e2e tests + shell: bash + run: nix develop --command ./scripts/run_task.sh test-bootstrap-monitor-e2e + load: + name: Run process-based load test + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: ./.github/actions/setup-go-for-project + - uses: ./.github/actions/run-monitored-tmpnet-cmd + with: + run: ./scripts/run_task.sh test-load -- --load-timeout=30s + artifact_prefix: load + 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 || '' }} + load_kube_kind: + name: Run load test on kind cluster + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: ./.github/actions/setup-go-for-project + - uses: ./.github/actions/run-monitored-tmpnet-cmd + with: + run: ./scripts/run_task.sh test-load-kube-kind -- --load-timeout=30s + runtime: kube + artifact_prefix: load-kube + 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 || '' }} + robustness: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: ./.github/actions/setup-go-for-project + - uses: ./.github/actions/install-nix + # TODO(marun) Extend testing of robustness beyond deploying a suitable test environment + - name: Deploy kind with chaos mesh + shell: bash + run: nix develop --command ./scripts/run_task.sh test-robustness