From 966eb570207f6513c2083c8d642ebb44332201c0 Mon Sep 17 00:00:00 2001 From: "Elvis S." Date: Thu, 25 Sep 2025 22:13:40 +0400 Subject: [PATCH 01/69] 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/69] 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/69] 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/69] 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/69] 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/69] 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/69] 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/69] 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/69] 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/69] 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/69] 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/69] 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/69] 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/69] 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/69] 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/69] 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/69] 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/69] 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/69] 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/69] 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/69] 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/69] 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/69] 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/69] 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/69] 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/69] 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/69] 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/69] 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/69] 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/69] 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/69] 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/69] 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/69] 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/69] 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/69] 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/69] 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 From 07ada030da4375d2a180b99d0ef055b7ca625a68 Mon Sep 17 00:00:00 2001 From: "Elvis S." Date: Wed, 1 Oct 2025 18:45:07 +0400 Subject: [PATCH 37/69] ci(avalanchego-setup-action): add `firewood-path` checkout path allowing Firewood runtime to run on nvme --- .../actions/avalanchego-setup-action/action.yml | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/.github/actions/avalanchego-setup-action/action.yml b/.github/actions/avalanchego-setup-action/action.yml index 7d65c0a1efce..4091812cece6 100644 --- a/.github/actions/avalanchego-setup-action/action.yml +++ b/.github/actions/avalanchego-setup-action/action.yml @@ -2,10 +2,6 @@ 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 @@ -14,6 +10,10 @@ inputs: description: 'Firewood version (commit SHA, branch, tag, or ffi/vX.Y.Z for pre-built)' required: false default: '' + firewood-path: + description: 'Directory path where Firewood will be cloned/built (preferably NVMe storage)' + required: false + default: '' coreth: description: 'Coreth version (commit SHA, branch name, or tag)' required: false @@ -50,4 +50,9 @@ runs: if: inputs.firewood != '' shell: bash working-directory: ${{ inputs.checkout-path }} - run: ./scripts/setup_firewood.sh ${{ inputs.firewood }} + run: | + if [ -n "${{ inputs.firewood-path }}" ]; then + ./scripts/setup_firewood.sh ${{ inputs.firewood }} ${{ inputs.firewood-path }} + else + ./scripts/setup_firewood.sh ${{ inputs.firewood }} + fi From 106ee4056f3c65e70f007262ef80f377560914e0 Mon Sep 17 00:00:00 2001 From: "Elvis S." Date: Wed, 1 Oct 2025 20:31:43 +0400 Subject: [PATCH 38/69] ci(avalanchego-setup-action): handle checkout-path --- .github/actions/avalanchego-setup-action/action.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/actions/avalanchego-setup-action/action.yml b/.github/actions/avalanchego-setup-action/action.yml index 4091812cece6..dabcc7dab507 100644 --- a/.github/actions/avalanchego-setup-action/action.yml +++ b/.github/actions/avalanchego-setup-action/action.yml @@ -6,6 +6,10 @@ inputs: description: 'AvalancheGo version (commit SHA, branch name, or tag)' required: false default: ${{ github.sha }} + checkout-path: + description: 'Path where AvalancheGo will be checked out' + required: false + default: '.' firewood: description: 'Firewood version (commit SHA, branch, tag, or ffi/vX.Y.Z for pre-built)' required: false @@ -49,10 +53,9 @@ runs: - name: Setup Firewood FFI if: inputs.firewood != '' shell: bash - working-directory: ${{ inputs.checkout-path }} run: | if [ -n "${{ inputs.firewood-path }}" ]; then - ./scripts/setup_firewood.sh ${{ inputs.firewood }} ${{ inputs.firewood-path }} + ${{ inputs.checkout-path }}/scripts/setup_firewood.sh ${{ inputs.firewood }} ${{ inputs.firewood-path }} else - ./scripts/setup_firewood.sh ${{ inputs.firewood }} + ${{ inputs.checkout-path }}/scripts/setup_firewood.sh ${{ inputs.firewood }} fi From 57329f2072e81bfcd494e21d787b87ecd4ddd831 Mon Sep 17 00:00:00 2001 From: "Elvis S." Date: Wed, 1 Oct 2025 20:32:54 +0400 Subject: [PATCH 39/69] ci(avalanchego-setup-action): handle checkout-path --- .github/actions/avalanchego-setup-action/action.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/actions/avalanchego-setup-action/action.yml b/.github/actions/avalanchego-setup-action/action.yml index dabcc7dab507..1ce539fc2b28 100644 --- a/.github/actions/avalanchego-setup-action/action.yml +++ b/.github/actions/avalanchego-setup-action/action.yml @@ -55,7 +55,7 @@ runs: shell: bash run: | if [ -n "${{ inputs.firewood-path }}" ]; then - ${{ inputs.checkout-path }}/scripts/setup_firewood.sh ${{ inputs.firewood }} ${{ inputs.firewood-path }} + "${{ inputs.checkout-path }}/scripts/setup_firewood.sh" "${{ inputs.firewood }}" "${{ inputs.firewood-path }}" else - ${{ inputs.checkout-path }}/scripts/setup_firewood.sh ${{ inputs.firewood }} + "${{ inputs.checkout-path }}/scripts/setup_firewood.sh" "${{ inputs.firewood }}" fi From daff6b54ceb849df3e8e642b948fdc1a0c7614e3 Mon Sep 17 00:00:00 2001 From: "Elvis S." Date: Wed, 1 Oct 2025 20:41:26 +0400 Subject: [PATCH 40/69] ci(avalanchego-setup-action): correct Firewood setup path --- scripts/setup_firewood.sh | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/scripts/setup_firewood.sh b/scripts/setup_firewood.sh index 902b983d203d..7cf55f63267d 100755 --- a/scripts/setup_firewood.sh +++ b/scripts/setup_firewood.sh @@ -5,10 +5,11 @@ # Clones Firewood repository, builds/fetches the FFI, and updates go.mod # # Usage: -# setup_firewood.sh +# setup_firewood.sh [workspace] # # Arguments: # version Firewood version (ffi/vX.Y.Z for pre-built, commit/branch for source) +# workspace Optional workspace path for Firewood build (default: ${AVALANCHE_PATH}/firewood-workspace) # # Output: # Prints FFI path to stdout on success @@ -16,7 +17,7 @@ set -euo pipefail if [ $# -lt 1 ]; then - echo "Usage: $0 " >&2 + echo "Usage: $0 [workspace]" >&2 exit 1 fi @@ -24,26 +25,34 @@ FIREWOOD_VERSION="$1" AVALANCHE_PATH=$( cd "$( dirname "${BASH_SOURCE[0]}" )"; cd .. && pwd ) FIREWOOD_CLONE_DIR="${AVALANCHE_PATH}/firewood" +# Use provided workspace or default to avalanchego/firewood-workspace +if [ $# -ge 2 ] && [ -n "$2" ]; then + WORKSPACE_PATH="$2" +else + WORKSPACE_PATH="${AVALANCHE_PATH}/firewood-workspace" +fi + 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 +echo "Using workspace: ${WORKSPACE_PATH}" >&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" +SETUP_FIREWOOD_SCRIPT="${FIREWOOD_CLONE_DIR}/benchmark/setup-scripts/build-firewood.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 +# Build or fetch Firewood FFI with custom workspace # Capture only the last line which is the FFI path -FFI_PATH=$("${SETUP_FIREWOOD_SCRIPT}" "${FIREWOOD_VERSION}" 2>&1 | tail -n 1) +FFI_PATH=$("${SETUP_FIREWOOD_SCRIPT}" "${FIREWOOD_VERSION}" --workspace "${WORKSPACE_PATH}" | tail -n 1) if [ -z "${FFI_PATH}" ]; then echo "Error: Failed to build/fetch Firewood FFI" >&2 From 5964641f5cb7575d733c5669223e584ef6228f34 Mon Sep 17 00:00:00 2001 From: "Elvis S." Date: Thu, 30 Oct 2025 15:37:22 -0400 Subject: [PATCH 41/69] chore: externalize c-chain-reexecution json based workflow into tasks --- Taskfile.yml | 104 ++++++++++++++++++++++-------- scripts/benchmark_cchain_range.sh | 24 +++++-- scripts/copy_dir.sh | 18 ++++-- 3 files changed, 112 insertions(+), 34 deletions(-) diff --git a/Taskfile.yml b/Taskfile.yml index fa229d51d012..c69714938034 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -201,44 +201,42 @@ tasks: vars: CURRENT_STATE_DIR: '{{.CURRENT_STATE_DIR}}' BLOCK_DIR: '{{.BLOCK_DIR}}' - RUNNER_NAME: '{{.RUNNER_NAME | default "dev"}}' CONFIG: '{{.CONFIG | default ""}}' START_BLOCK: '{{.START_BLOCK}}' END_BLOCK: '{{.END_BLOCK}}' LABELS: '{{.LABELS | default ""}}' BENCHMARK_OUTPUT_FILE: '{{.BENCHMARK_OUTPUT_FILE | default ""}}' - METRICS_SERVER_ENABLED: '{{.METRICS_SERVER_ENABLED | default "false"}}' - METRICS_SERVER_PORT: '{{.METRICS_SERVER_PORT}}' - METRICS_COLLECTOR_ENABLED: '{{.METRICS_COLLECTOR_ENABLED | default "false"}}' + TIMESTAMP: '{{.TIMESTAMP | default (now | date "20060102-150405")}}' + EXECUTION_DATA_DIR: '{{.EXECUTION_DATA_DIR | default (printf "/tmp/%s-%s" .TASK_NAME .TIMESTAMP)}}' cmd: | CURRENT_STATE_DIR={{.CURRENT_STATE_DIR}} \ BLOCK_DIR={{.BLOCK_DIR}} \ - RUNNER_NAME='{{.RUNNER_NAME | default "dev"}}' \ CONFIG={{.CONFIG}} \ START_BLOCK={{.START_BLOCK}} \ END_BLOCK={{.END_BLOCK}} \ LABELS={{.LABELS}} \ BENCHMARK_OUTPUT_FILE={{.BENCHMARK_OUTPUT_FILE}} \ - METRICS_SERVER_ENABLED={{.METRICS_SERVER_ENABLED}} \ - METRICS_SERVER_PORT={{.METRICS_SERVER_PORT}} \ - METRICS_COLLECTOR_ENABLED={{.METRICS_COLLECTOR_ENABLED}} \ + EXECUTION_DATA_DIR={{.EXECUTION_DATA_DIR}} \ bash -x ./scripts/benchmark_cchain_range.sh + # Runtime context variables are read from environment by the script: + # - RUNNER_NAME (execution environment) + # - METRICS_SERVER_PORT (monitoring config) + # - METRICS_SERVER_ENABLED (runtime monitoring decision) + # - METRICS_COLLECTOR_ENABLED (runtime monitoring decision) + # - PROMETHEUS_URL, PROMETHEUS_USERNAME, PROMETHEUS_PASSWORD (monitoring config) + # - GH_REPO, GH_WORKFLOW, GH_RUN_ID, etc. (GitHub context) reexecute-cchain-range-with-copied-data: desc: Combines import-cchain-reexecute-range and reexecute-cchain-range vars: - EXECUTION_DATA_DIR: '{{.EXECUTION_DATA_DIR}}' - BLOCK_DIR_SRC: '{{.BLOCK_DIR_SRC | default "s3://avalanchego-bootstrap-testing/cchain-mainnet-blocks-1m-ldb/**"}}' - CURRENT_STATE_DIR_SRC: '{{.CURRENT_STATE_DIR_SRC | default "s3://avalanchego-bootstrap-testing/cchain-current-state-hashdb-full-100/**"}}' - RUNNER_NAME: '{{.RUNNER_NAME | default "dev"}}' - CONFIG: '{{.CONFIG | default ""}}' - START_BLOCK: '{{.START_BLOCK | default "101"}}' - END_BLOCK: '{{.END_BLOCK | default "250000"}}' - LABELS: '{{.LABELS | default ""}}' - BENCHMARK_OUTPUT_FILE: '{{.BENCHMARK_OUTPUT_FILE | default ""}}' - METRICS_SERVER_ENABLED: '{{.METRICS_SERVER_ENABLED | default "false"}}' - METRICS_SERVER_PORT: '{{.METRICS_SERVER_PORT}}' - METRICS_COLLECTOR_ENABLED: '{{.METRICS_COLLECTOR_ENABLED | default "false"}}' + TASK_NAME: '{{.TASK_NAME}}' + BLOCK_DIR_SRC: '{{.BLOCK_DIR_SRC}}' + CURRENT_STATE_DIR_SRC: '{{.CURRENT_STATE_DIR_SRC}}' + CONFIG: '{{.CONFIG}}' + START_BLOCK: '{{.START_BLOCK}}' + END_BLOCK: '{{.END_BLOCK}}' + TIMESTAMP: '{{.TIMESTAMP | default (now | date "20060102-150405")}}' + EXECUTION_DATA_DIR: '{{.EXECUTION_DATA_DIR | default (printf "/tmp/%s-%s" .TASK_NAME .TIMESTAMP)}}' cmds: - task: import-cchain-reexecute-range vars: @@ -247,17 +245,71 @@ tasks: EXECUTION_DATA_DIR: '{{.EXECUTION_DATA_DIR}}' - task: reexecute-cchain-range vars: + TASK_NAME: '{{.TASK_NAME}}' BLOCK_DIR: '{{.EXECUTION_DATA_DIR}}/blocks' CURRENT_STATE_DIR: '{{.EXECUTION_DATA_DIR}}/current-state' - RUNNER_NAME: '{{.RUNNER_NAME}}' CONFIG: '{{.CONFIG}}' START_BLOCK: '{{.START_BLOCK}}' END_BLOCK: '{{.END_BLOCK}}' - LABELS: '{{.LABELS}}' - BENCHMARK_OUTPUT_FILE: '{{.BENCHMARK_OUTPUT_FILE}}' - METRICS_SERVER_ENABLED: '{{.METRICS_SERVER_ENABLED}}' - METRICS_SERVER_PORT: '{{.METRICS_SERVER_PORT}}' - METRICS_COLLECTOR_ENABLED: '{{.METRICS_COLLECTOR_ENABLED}}' + EXECUTION_DATA_DIR: '{{.EXECUTION_DATA_DIR}}' + + c-chain-reexecution-hashdb-101-250k: + desc: C-Chain re-execution from block 101 to 250k with hashdb + cmds: + - task: reexecute-cchain-range-with-copied-data + vars: + TASK_NAME: '{{.TASK}}' + START_BLOCK: 101 + END_BLOCK: 250000 + BLOCK_DIR_SRC: 'cchain-mainnet-blocks-1m-ldb' + CURRENT_STATE_DIR_SRC: 'cchain-current-state-hashdb-full-100' + + c-chain-reexecution-hashdb-archive-101-250k: + desc: C-Chain re-execution from block 101 to 250k with hashdb archive + cmds: + - task: reexecute-cchain-range-with-copied-data + vars: + TASK_NAME: '{{.TASK}}' + START_BLOCK: 101 + END_BLOCK: 250000 + BLOCK_DIR_SRC: 'cchain-mainnet-blocks-1m-ldb' + CURRENT_STATE_DIR_SRC: 'cchain-current-state-hashdb-archive-100' + CONFIG: archive + + c-chain-reexecution-hashdb-33m-33m500k: + desc: C-Chain re-execution from block 33m to 33.5m with hashdb + cmds: + - task: reexecute-cchain-range-with-copied-data + vars: + TASK_NAME: '{{.TASK}}' + START_BLOCK: 33000001 + END_BLOCK: 33500000 + BLOCK_DIR_SRC: 'cchain-mainnet-blocks-30m-40m-ldb' + CURRENT_STATE_DIR_SRC: 'cchain-current-state-hashdb-full-33m' + + c-chain-reexecution-firewood-33m-33m500k: + desc: C-Chain re-execution from block 33m to 33.5m with firewood + cmds: + - task: reexecute-cchain-range-with-copied-data + vars: + TASK_NAME: '{{.TASK}}' + START_BLOCK: 33000001 + END_BLOCK: 33500000 + BLOCK_DIR_SRC: 'cchain-mainnet-blocks-30m-40m-ldb' + CURRENT_STATE_DIR_SRC: 'cchain-current-state-firewood-33m' + CONFIG: firewood + + c-chain-reexecution-firewood-101-250k: + desc: C-Chain re-execution from block 101 to 250k with firewood + cmds: + - task: reexecute-cchain-range-with-copied-data + vars: + TASK_NAME: '{{.TASK}}' + START_BLOCK: 101 + END_BLOCK: 250000 + BLOCK_DIR_SRC: 'cchain-mainnet-blocks-1m-ldb' + CURRENT_STATE_DIR_SRC: 'cchain-current-state-firewood-100' + CONFIG: firewood test-bootstrap-monitor-e2e: desc: Runs bootstrap monitor e2e tests diff --git a/scripts/benchmark_cchain_range.sh b/scripts/benchmark_cchain_range.sh index 0d9d951e7194..6d630f89157a 100755 --- a/scripts/benchmark_cchain_range.sh +++ b/scripts/benchmark_cchain_range.sh @@ -8,18 +8,34 @@ set -euo pipefail # CURRENT_STATE_DIR: Path or S3 URL to the current state directory or zip. # START_BLOCK: The starting block height (exclusive). # END_BLOCK: The ending block height (inclusive). +# RUNNER_NAME (optional): Name of the runner (defaults to "dev"). +# CONFIG (optional): Configuration name (defaults to "default"). # LABELS (optional): Comma-separated key=value pairs for metric labels. # BENCHMARK_OUTPUT_FILE (optional): If set, benchmark output is also written to this file. -# METRICS_SERVER_ENABLED (optional): If set, enables the metrics server. -# METRICS_SERVER_PORT (optional): If set, determines the port the metrics server will listen to. -# METRICS_COLLECTOR_ENABLED (optional): If set, enables the metrics collector. +# METRICS_SERVER_ENABLED (optional): If set to "true", enables the metrics server (defaults to "false"). +# METRICS_SERVER_PORT (optional): Port for the metrics server (defaults to "0"). +# METRICS_COLLECTOR_ENABLED (optional): If set to "true", enables the metrics collector (defaults to "false"). : "${BLOCK_DIR:?BLOCK_DIR must be set}" : "${CURRENT_STATE_DIR:?CURRENT_STATE_DIR must be set}" -: "${RUNNER_NAME:?RUNNER_NAME must be set}" : "${START_BLOCK:?START_BLOCK must be set}" : "${END_BLOCK:?END_BLOCK must be set}" +# Set defaults for optional variables +: "${RUNNER_NAME:=dev}" +: "${CONFIG:=default}" +: "${METRICS_SERVER_ENABLED:=false}" +: "${METRICS_SERVER_PORT:=0}" +: "${METRICS_COLLECTOR_ENABLED:=false}" + +echo "=== C-Chain Re-execution Benchmark Environment Variables ===" +echo "Runner: ${RUNNER_NAME}" +echo "Config: ${CONFIG}" +echo "Blocks: ${START_BLOCK} to ${END_BLOCK}" +echo "Metrics server: ${METRICS_SERVER_ENABLED}" +echo "Metrics server port: ${METRICS_SERVER_PORT}" +echo "Metrics collector: ${METRICS_COLLECTOR_ENABLED}" + cmd="go test -timeout=0 -v -benchtime=1x -bench=BenchmarkReexecuteRange -run=^$ github.com/ava-labs/avalanchego/tests/reexecute/c \ --block-dir=\"${BLOCK_DIR}\" \ --current-state-dir=\"${CURRENT_STATE_DIR}\" \ diff --git a/scripts/copy_dir.sh b/scripts/copy_dir.sh index 874b53c74769..5bdafc3dc2c4 100755 --- a/scripts/copy_dir.sh +++ b/scripts/copy_dir.sh @@ -3,13 +3,17 @@ set -euo pipefail # Usage: ./scripts/copy_dir.sh source_directory destination_directory -# Sources can be S3 URLs (s3://bucket/path) or a local file path +# Sources can be: +# - S3 URLs (s3://bucket/path) +# - S3 object keys (will be expanded to s3://avalanchego-bootstrap-testing//**) +# - Local file paths # Assumes s5cmd has been installed and is available in the PATH. # s5cmd is included in the nix dev shell. if [ $# -ne 2 ]; then echo "Usage: $0 " - echo "Import from S3 Example: $0 's3://bucket1/path1' /dest/dir" + echo "Import from S3 URL Example: $0 's3://bucket1/path1' /dest/dir" + echo "Import from S3 object key Example: $0 'cchain-mainnet-blocks-1m-ldb' /dest/dir" echo "Export to S3 Example: $0 '/local/path1' 's3://bucket2/path2'" echo "Local Example: $0 '/local/path1' /dest/dir" exit 1 @@ -18,11 +22,17 @@ fi SRC="$1" DST="$2" +# If SRC doesn't start with s3:// or /, assume it's an S3 object key +if [[ "$SRC" != s3://* ]] && [[ "$SRC" != /* ]]; then + SRC="s3://avalanchego-bootstrap-testing/${SRC}/**" + echo "Expanded object key to: $SRC" +fi + # Function to copy from a single source to destination function copy_source() { local source="$1" local dest="$2" - + # Check if source starts with s3:// if [[ "$source" == s3://* || "$dest" == s3://* ]]; then # Use s5cmd to copy from S3 @@ -30,7 +40,7 @@ function copy_source() { time s5cmd cp --show-progress "$source" "$dest" else # Use cp for local filesystem with recursive support - + # Ensure destination directory exists mkdir -p "$dest" From 70fbc9f143ef1c6ee05b193f6e5551ba7d16797a Mon Sep 17 00:00:00 2001 From: "Elvis S." Date: Thu, 30 Oct 2025 16:06:12 -0400 Subject: [PATCH 42/69] ci(c-chain-reexecution): remove relative imports to make this action reusable --- .../c-chain-reexecution-benchmark/action.yml | 154 +++++++++++------- .../output-metrics-url.sh | 23 +++ .../output-metrics-url.sh | 4 + 3 files changed, 126 insertions(+), 55 deletions(-) create mode 100755 .github/actions/c-chain-reexecution-benchmark/output-metrics-url.sh diff --git a/.github/actions/c-chain-reexecution-benchmark/action.yml b/.github/actions/c-chain-reexecution-benchmark/action.yml index 3385ff50a0c1..d19528969429 100644 --- a/.github/actions/c-chain-reexecution-benchmark/action.yml +++ b/.github/actions/c-chain-reexecution-benchmark/action.yml @@ -2,30 +2,18 @@ name: 'C-Chain Re-Execution Benchmark' description: 'Run C-Chain re-execution benchmark' inputs: + task: + description: 'Task name to execute from Taskfile.yml' + required: true runner_name: description: 'The name of the runner to use and include in the Golang Benchmark name.' required: true - config: - description: 'The config to pass to the VM for the benchmark. See BenchmarkReexecuteRange for details.' - default: '' - start-block: - description: 'The start block for the benchmark.' - default: '101' - end-block: - description: 'The end block for the benchmark.' - default: '250000' - block-dir-src: - description: 'The source block directory. Supports S3 directory/zip and local directories.' - default: 's3://avalanchego-bootstrap-testing/cchain-mainnet-blocks-1m-ldb/**' - current-state-dir-src: - description: 'The current state directory. Supports S3 directory/zip and local directories.' - default: 's3://avalanchego-bootstrap-testing/cchain-current-state-hashdb-full-100/**' aws-role: description: 'AWS role to assume for S3 access.' required: true aws-region: description: 'AWS region to use for S3 access.' - required: true + default: 'us-east-2' aws-role-duration-seconds: description: 'The duration of the AWS role to assume for S3 access.' required: true @@ -56,64 +44,120 @@ inputs: push-github-action-benchmark: description: 'Whether to push the benchmark result to GitHub.' required: true - default: false push-post-state: description: 'S3 destination to copy the current-state directory after completing re-execution. If empty, this will be skipped.' default: '' + # The following inputs need never be provided by the caller. They + # default to context values that the action's steps are unable to + # access directly. + repository-owner: + default: ${{ github.repository_owner }} + repository-name: + default: ${{ github.event.repository.name }} + workflow: + default: ${{ github.workflow }} + run-id: + default: ${{ github.run_id }} + run-number: + default: ${{ github.run_number }} + run-attempt: + default: ${{ github.run_attempt }} + job: + default: ${{ github.job }} + grafana-dashboard-id: + default: 'Gl1I20mnk/c-chain' runs: using: composite steps: - - name: Set task env + - uses: cachix/install-nix-action@02a151ada4993995686f9ed4f1be7cfbb229e56f #v31 + with: + github_access_token: ${{ inputs.github-token }} + - run: nix develop --command echo "dependencies installed" + shell: bash + # Cache Go modules (architecture-independent) + - uses: actions/cache@v4 + id: go-mod-cache + with: + path: ~/go/pkg/mod + key: ${{ runner.os }}-go-mod-${{ hashFiles('go.sum') }} + restore-keys: ${{ runner.os }}-go-mod- + # Cache Go build cache (architecture-specific) + - uses: actions/cache@v4 + with: + path: ~/.cache/go-build + key: ${{ runner.os }}-${{ runner.arch }}-go-build-${{ hashFiles('go.sum') }} + restore-keys: ${{ runner.os }}-${{ runner.arch }}-go-build- + # Download modules only on cache miss + - run: $GITHUB_ACTION_PATH/nix-develop.sh --command go mod download + if: steps.go-mod-cache.outputs.cache-hit != 'true' + shell: bash + - run: | + if [[ -f tools/go.mod ]]; then + nix develop --command go mod download -modfile=tools/go.mod + fi + if: steps.go-mod-cache.outputs.cache-hit != 'true' + shell: bash + - name: Notify of metrics availability + if: inputs.prometheus-username != '' shell: bash run: | - { - echo "EXECUTION_DATA_DIR=${{ inputs.workspace }}/reexecution-data" - echo "BENCHMARK_OUTPUT_FILE=output.txt" - echo "START_BLOCK=${{ inputs.start-block }}" - echo "END_BLOCK=${{ inputs.end-block }}" - echo "BLOCK_DIR_SRC=${{ inputs.block-dir-src }}" - echo "CURRENT_STATE_DIR_SRC=${{ inputs.current-state-dir-src }}" - } >> $GITHUB_ENV + metrics_url=$($GITHUB_ACTION_PATH/output-metrics-url.sh) + echo "Grafana: ${metrics_url}" + echo "🔗 [View Grafana Dashboard](${metrics_url})" >> "$GITHUB_STEP_SUMMARY" + env: + GRAFANA_URL: https://grafana-poc.avax-dev.network/d/${{ inputs.grafana_dashboard_id }}?orgId=1&refresh=10s&var-filter=is_ephemeral_node%7C%3D%7Cfalse&var-filter=gh_repo%7C%3D%7C${{ inputs.repository_owner }}%2F${{ inputs.repository_name }}&var-filter=gh_run_id%7C%3D%7C${{ inputs.run_id }}&var-filter=gh_run_attempt%7C%3D%7C${{ inputs.run_attempt }} + GH_JOB_ID: ${{ inputs.job }} + - name: Warn that collection of metrics and logs will not be performed + if: inputs.prometheus-username == '' + shell: bash + run: echo "::warning::Monitoring credentials not found. Skipping collector start. Is the PR from a fork branch?" - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v4 with: role-to-assume: ${{ inputs.aws-role }} aws-region: ${{ inputs.aws-region }} role-duration-seconds: ${{ inputs.aws-role-duration-seconds }} - - name: Run C-Chain Re-Execution - uses: ./.github/actions/run-monitored-tmpnet-cmd - with: - run: | - ./scripts/run_task.sh reexecute-cchain-range-with-copied-data \ - CONFIG=${{ inputs.config }} \ - EXECUTION_DATA_DIR=${{ env.EXECUTION_DATA_DIR }} \ - BLOCK_DIR_SRC=${{ env.BLOCK_DIR_SRC }} \ - CURRENT_STATE_DIR_SRC=${{ env.CURRENT_STATE_DIR_SRC }} \ - START_BLOCK=${{ env.START_BLOCK }} \ - END_BLOCK=${{ env.END_BLOCK }} \ - LABELS=${{ env.LABELS }} \ - BENCHMARK_OUTPUT_FILE=${{ env.BENCHMARK_OUTPUT_FILE }} \ - RUNNER_NAME=${{ inputs.runner_name }} \ - METRICS_SERVER_ENABLED=true \ - METRICS_COLLECTOR_ENABLED=true - prometheus_url: ${{ inputs.prometheus-url }} - prometheus_push_url: ${{ inputs.prometheus-push-url }} - prometheus_username: ${{ inputs.prometheus-username }} - prometheus_password: ${{ inputs.prometheus-password }} - grafana_dashboard_id: 'Gl1I20mnk/c-chain' - runtime: "" # Set runtime input to empty string to disable log collection - + - name: Set task env + shell: bash + run: | + TIMESTAMP=$(date '+%Y%m%d-%H%M%S') + EXEC_DIR="/tmp/reexecution-data-${TIMESTAMP}" + echo "EXECUTION_DATA_DIR=${EXEC_DIR}" >> "$GITHUB_ENV" + - name: Run C-Chain Re-execution Benchmark + shell: nix develop --impure --command bash -x {0} + run: ./scripts/run_task.sh ${{ inputs.task }} \ + BENCHMARK_OUTPUT_FILE="benchmark-output.txt" \ + EXECUTION_DATA_DIR="${EXEC_DIR}" + env: + RUNNER_NAME: ${{ inputs.runner_name }} + TMPNET_START_METRICS_COLLECTOR: ${{ inputs.prometheus-username != '' }} + TMPNET_CHECK_METRICS_COLLECTED: ${{ inputs.prometheus-username != '' }} + METRICS_SERVER_ENABLED: ${{ inputs.prometheus-username != '' }} + METRICS_COLLECTOR_ENABLED: ${{ inputs.prometheus-username != '' }} + PROMETHEUS_URL: ${{ inputs.prometheus-url }} + PROMETHEUS_PUSH_URL: ${{ inputs.prometheus-push-url }} + PROMETHEUS_USERNAME: ${{ inputs.prometheus-username }} + PROMETHEUS_PASSWORD: ${{ inputs.prometheus-password }} + GH_REPO: ${{ inputs.repository_owner }}/${{ inputs.repository_name }} + GH_WORKFLOW: ${{ inputs.workflow }} + GH_RUN_ID: ${{ inputs.run_id }} + GH_RUN_NUMBER: ${{ inputs.run_number }} + GH_RUN_ATTEMPT: ${{ inputs.run_attempt }} + GH_JOB_ID: ${{ inputs.job }} - name: Compare Benchmark Results uses: benchmark-action/github-action-benchmark@v1 with: tool: 'go' - output-file-path: ${{ env.BENCHMARK_OUTPUT_FILE }} + output-file-path: benchmark-output.txt summary-always: true github-token: ${{ inputs.github-token }} auto-push: ${{ inputs.push-github-action-benchmark }} - - - name: Push Post-State to S3 (if not exists) - if: ${{ inputs.push-post-state != '' }} - shell: nix develop --command bash -x {0} - run: ./scripts/run_task.sh export-dir-to-s3 SRC=${{ env.EXECUTION_DATA_DIR }}/current-state/ DST=${{ inputs.push-post-state }} + - name: Push Post-State to S3 + if: inputs.push-post-state != '' + shell: bash + run: | + $GITHUB_ACTION_PATH/nix-develop.sh --command bash -x \ + ./scripts/run_task.sh export-dir-to-s3 \ + SRC=${{ env.EXECUTION_DATA_DIR }}/current-state/ \ + DST=${{ inputs.push-post-state }} diff --git a/.github/actions/c-chain-reexecution-benchmark/output-metrics-url.sh b/.github/actions/c-chain-reexecution-benchmark/output-metrics-url.sh new file mode 100755 index 000000000000..428971dec97a --- /dev/null +++ b/.github/actions/c-chain-reexecution-benchmark/output-metrics-url.sh @@ -0,0 +1,23 @@ +#!/usr/bin/env bash + +# WARNING: This file is duplication of: +# - .github/actions/run-monitored-tmpnet-cmd/output-metrics-url.sh (source of truth) +# Changes must be made to BOTH files. + +set -euo pipefail + +# Timestamps are in seconds +from_timestamp="$(date '+%s')" +monitoring_period=900 # 15 minutes +to_timestamp="$((from_timestamp + monitoring_period))" + +# Grafana expects microseconds, so pad timestamps with 3 zeros +metrics_url="${GRAFANA_URL}&var-filter=gh_job_id%7C%3D%7C${GH_JOB_ID}&from=${from_timestamp}000&to=${to_timestamp}000" + +# Optionally ensure that the link displays metrics only for the shared +# network rather than mixing it with the results for private networks. +if [[ -n "${FILTER_BY_OWNER:-}" ]]; then + metrics_url="${metrics_url}&var-filter=network_owner%7C%3D%7C${FILTER_BY_OWNER}" +fi + +echo "${metrics_url}" diff --git a/.github/actions/run-monitored-tmpnet-cmd/output-metrics-url.sh b/.github/actions/run-monitored-tmpnet-cmd/output-metrics-url.sh index ccecc34ac09c..5d2e8d59e8d1 100755 --- a/.github/actions/run-monitored-tmpnet-cmd/output-metrics-url.sh +++ b/.github/actions/run-monitored-tmpnet-cmd/output-metrics-url.sh @@ -1,5 +1,9 @@ #!/usr/bin/env bash +# WARNING: This file is duplicated at: +# - .github/actions/c-chain-reexecution-benchmark/output-metrics-url.sh (copy) +# Changes must be made to BOTH files. + set -euo pipefail # Timestamps are in seconds From d5bc2272911839feeecd2f56c2a72513455dc1ba Mon Sep 17 00:00:00 2001 From: "Elvis S." Date: Thu, 30 Oct 2025 16:13:43 -0400 Subject: [PATCH 43/69] ci(c-chain-reexecution): use correct shells --- .../c-chain-reexecution-benchmark/action.yml | 23 +++++++------------ 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/.github/actions/c-chain-reexecution-benchmark/action.yml b/.github/actions/c-chain-reexecution-benchmark/action.yml index d19528969429..e88351992d5d 100644 --- a/.github/actions/c-chain-reexecution-benchmark/action.yml +++ b/.github/actions/c-chain-reexecution-benchmark/action.yml @@ -73,8 +73,8 @@ runs: - uses: cachix/install-nix-action@02a151ada4993995686f9ed4f1be7cfbb229e56f #v31 with: github_access_token: ${{ inputs.github-token }} - - run: nix develop --command echo "dependencies installed" - shell: bash + - run: echo "dependencies installed" + shell: nix develop --command bash {0} # Cache Go modules (architecture-independent) - uses: actions/cache@v4 id: go-mod-cache @@ -89,15 +89,9 @@ runs: key: ${{ runner.os }}-${{ runner.arch }}-go-build-${{ hashFiles('go.sum') }} restore-keys: ${{ runner.os }}-${{ runner.arch }}-go-build- # Download modules only on cache miss - - run: $GITHUB_ACTION_PATH/nix-develop.sh --command go mod download - if: steps.go-mod-cache.outputs.cache-hit != 'true' - shell: bash - - run: | - if [[ -f tools/go.mod ]]; then - nix develop --command go mod download -modfile=tools/go.mod - fi + - run: go mod download if: steps.go-mod-cache.outputs.cache-hit != 'true' - shell: bash + shell: nix develop --command bash -x {0} - name: Notify of metrics availability if: inputs.prometheus-username != '' shell: bash @@ -127,8 +121,8 @@ runs: - name: Run C-Chain Re-execution Benchmark shell: nix develop --impure --command bash -x {0} run: ./scripts/run_task.sh ${{ inputs.task }} \ - BENCHMARK_OUTPUT_FILE="benchmark-output.txt" \ - EXECUTION_DATA_DIR="${EXEC_DIR}" + BENCHMARK_OUTPUT_FILE="benchmark-output.txt" \ + EXECUTION_DATA_DIR="${EXEC_DIR}" env: RUNNER_NAME: ${{ inputs.runner_name }} TMPNET_START_METRICS_COLLECTOR: ${{ inputs.prometheus-username != '' }} @@ -155,9 +149,8 @@ runs: auto-push: ${{ inputs.push-github-action-benchmark }} - name: Push Post-State to S3 if: inputs.push-post-state != '' - shell: bash + shell: nix develop --impure --command bash -x {0} run: | - $GITHUB_ACTION_PATH/nix-develop.sh --command bash -x \ - ./scripts/run_task.sh export-dir-to-s3 \ + ./scripts/run_task.sh export-dir-to-s3 \ SRC=${{ env.EXECUTION_DATA_DIR }}/current-state/ \ DST=${{ inputs.push-post-state }} From ff86c392f70ee4aaa14adb647f5293dcc327ebd0 Mon Sep 17 00:00:00 2001 From: "Elvis S." Date: Thu, 30 Oct 2025 16:24:02 -0400 Subject: [PATCH 44/69] ci(c-chain-reexecution)!: --- ...chain-reexecution-benchmark-container.json | 24 ++-------- ...-chain-reexecution-benchmark-container.yml | 47 +++++-------------- ...chain-reexecution-benchmark-gh-native.json | 22 ++------- ...-chain-reexecution-benchmark-gh-native.yml | 47 +++++-------------- 4 files changed, 31 insertions(+), 109 deletions(-) diff --git a/.github/workflows/c-chain-reexecution-benchmark-container.json b/.github/workflows/c-chain-reexecution-benchmark-container.json index aa8edb0aac70..2ccfac027111 100644 --- a/.github/workflows/c-chain-reexecution-benchmark-container.json +++ b/.github/workflows/c-chain-reexecution-benchmark-container.json @@ -3,20 +3,12 @@ "include": [ { "runner": "ubuntu-latest", - "config": "default", - "start-block": 101, - "end-block": 250000, - "block-dir-src": "s3://avalanchego-bootstrap-testing/cchain-mainnet-blocks-1m-ldb/**", - "current-state-dir-src": "s3://avalanchego-bootstrap-testing/cchain-current-state-hashdb-full-100/**", + "task": "c-chain-reexecution-hashdb-101-250k", "timeout-minutes": 30 }, { "runner": "avalanche-avalanchego-runner-2ti", - "config": "default", - "start-block": 101, - "end-block": 250000, - "block-dir-src": "s3://avalanchego-bootstrap-testing/cchain-mainnet-blocks-1m-ldb/**", - "current-state-dir-src": "s3://avalanchego-bootstrap-testing/cchain-current-state-hashdb-full-100/**", + "task": "c-chain-reexecution-hashdb-101-250k", "timeout-minutes": 30 } ] @@ -25,20 +17,12 @@ "include": [ { "runner": "avago-runner-m6i-4xlarge-ebs-fast", - "config": "default", - "start-block": 33000001, - "end-block": 33500000, - "block-dir-src": "s3://avalanchego-bootstrap-testing/cchain-mainnet-blocks-30m-40m-ldb/**", - "current-state-dir-src": "s3://avalanchego-bootstrap-testing/cchain-current-state-hashdb-full-33m/**", + "task": "c-chain-reexecution-hashdb-33m-33m500k", "timeout-minutes": 1440 }, { "runner": "avago-runner-i4i-4xlarge-local-ssd", - "config": "default", - "start-block": 33000001, - "end-block": 33500000, - "block-dir-src": "s3://avalanchego-bootstrap-testing/cchain-mainnet-blocks-30m-40m-ldb/**", - "current-state-dir-src": "s3://avalanchego-bootstrap-testing/cchain-current-state-hashdb-full-33m/**", + "task": "c-chain-reexecution-hashdb-33m-33m500k", "timeout-minutes": 1440 } ] diff --git a/.github/workflows/c-chain-reexecution-benchmark-container.yml b/.github/workflows/c-chain-reexecution-benchmark-container.yml index db12a98ad703..e90787ffd3ac 100644 --- a/.github/workflows/c-chain-reexecution-benchmark-container.yml +++ b/.github/workflows/c-chain-reexecution-benchmark-container.yml @@ -4,30 +4,13 @@ on: pull_request: workflow_dispatch: inputs: - config: - description: 'The config to pass to the VM for the benchmark. See BenchmarkReexecuteRange for details.' - required: false - default: '' - start-block: - description: 'The start block for the benchmark.' - required: false - default: 101 - end-block: - description: 'The end block for the benchmark.' - required: false - default: 250000 - block-dir-src: - description: 'The source block directory. Supports S3 directory/zip and local directories.' - required: false - default: s3://avalanchego-bootstrap-testing/cchain-mainnet-blocks-1m-ldb/** - current-state-dir-src: - description: 'The current state directory. Supports S3 directory/zip and local directories.' - required: false - default: s3://avalanchego-bootstrap-testing/cchain-current-state-hashdb-full-100/** runner: description: 'Runner to execute the benchmark. Input to the runs-on field of the job.' required: false default: ubuntu-latest + task: + description: 'Taskfile task to execute (e.g., c-chain-reexecution-hashdb-101-250k)' + required: true push-post-state: description: 'S3 location to push post-execution state directory. Skips this step if left unpopulated.' default: '' @@ -55,12 +38,8 @@ jobs: if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then { echo "matrix< Date: Thu, 30 Oct 2025 16:27:52 -0400 Subject: [PATCH 45/69] copilot PR comments --- .github/actions/c-chain-reexecution-benchmark/action.yml | 2 +- .../actions/c-chain-reexecution-benchmark/output-metrics-url.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/actions/c-chain-reexecution-benchmark/action.yml b/.github/actions/c-chain-reexecution-benchmark/action.yml index e88351992d5d..2c915e8b3d53 100644 --- a/.github/actions/c-chain-reexecution-benchmark/action.yml +++ b/.github/actions/c-chain-reexecution-benchmark/action.yml @@ -122,7 +122,7 @@ runs: shell: nix develop --impure --command bash -x {0} run: ./scripts/run_task.sh ${{ inputs.task }} \ BENCHMARK_OUTPUT_FILE="benchmark-output.txt" \ - EXECUTION_DATA_DIR="${EXEC_DIR}" + EXECUTION_DATA_DIR="${{ env.EXECUTION_DATA_DIR }}" env: RUNNER_NAME: ${{ inputs.runner_name }} TMPNET_START_METRICS_COLLECTOR: ${{ inputs.prometheus-username != '' }} diff --git a/.github/actions/c-chain-reexecution-benchmark/output-metrics-url.sh b/.github/actions/c-chain-reexecution-benchmark/output-metrics-url.sh index 428971dec97a..875f7d7fdb8d 100755 --- a/.github/actions/c-chain-reexecution-benchmark/output-metrics-url.sh +++ b/.github/actions/c-chain-reexecution-benchmark/output-metrics-url.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -# WARNING: This file is duplication of: +# WARNING: This file is a duplication of: # - .github/actions/run-monitored-tmpnet-cmd/output-metrics-url.sh (source of truth) # Changes must be made to BOTH files. From c753cf9b15fe20a991577d6e8477644796d6a8df Mon Sep 17 00:00:00 2001 From: "Elvis S." Date: Thu, 30 Oct 2025 16:39:46 -0400 Subject: [PATCH 46/69] ci(c-chain-reexecution): set absolute path to benchmark output file resolving error on compare benchmark results job --- .github/actions/c-chain-reexecution-benchmark/action.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/actions/c-chain-reexecution-benchmark/action.yml b/.github/actions/c-chain-reexecution-benchmark/action.yml index 2c915e8b3d53..61278707e330 100644 --- a/.github/actions/c-chain-reexecution-benchmark/action.yml +++ b/.github/actions/c-chain-reexecution-benchmark/action.yml @@ -117,11 +117,13 @@ runs: run: | TIMESTAMP=$(date '+%Y%m%d-%H%M%S') EXEC_DIR="/tmp/reexecution-data-${TIMESTAMP}" + BENCHMARK_FILE="${GITHUB_WORKSPACE}/benchmark-output.txt" echo "EXECUTION_DATA_DIR=${EXEC_DIR}" >> "$GITHUB_ENV" + echo "BENCHMARK_OUTPUT_FILE=${BENCHMARK_FILE}" >> "$GITHUB_ENV" - name: Run C-Chain Re-execution Benchmark shell: nix develop --impure --command bash -x {0} run: ./scripts/run_task.sh ${{ inputs.task }} \ - BENCHMARK_OUTPUT_FILE="benchmark-output.txt" \ + BENCHMARK_OUTPUT_FILE="${{ env.BENCHMARK_OUTPUT_FILE }}" \ EXECUTION_DATA_DIR="${{ env.EXECUTION_DATA_DIR }}" env: RUNNER_NAME: ${{ inputs.runner_name }} From 7b3a23187bb2d2ce3ae833e07e6f961b26d97452 Mon Sep 17 00:00:00 2001 From: "Elvis S." Date: Mon, 3 Nov 2025 09:06:21 -0500 Subject: [PATCH 47/69] address pr review --- .../c-chain-reexecution-benchmark/action.yml | 8 ++------ .../c-chain-reexecution-benchmark-container.yml | 16 ++++++++-------- .../c-chain-reexecution-benchmark-gh-native.yml | 10 +++++----- 3 files changed, 15 insertions(+), 19 deletions(-) diff --git a/.github/actions/c-chain-reexecution-benchmark/action.yml b/.github/actions/c-chain-reexecution-benchmark/action.yml index 61278707e330..dca62b086053 100644 --- a/.github/actions/c-chain-reexecution-benchmark/action.yml +++ b/.github/actions/c-chain-reexecution-benchmark/action.yml @@ -64,8 +64,6 @@ inputs: default: ${{ github.run_attempt }} job: default: ${{ github.job }} - grafana-dashboard-id: - default: 'Gl1I20mnk/c-chain' runs: using: composite @@ -100,7 +98,7 @@ runs: echo "Grafana: ${metrics_url}" echo "🔗 [View Grafana Dashboard](${metrics_url})" >> "$GITHUB_STEP_SUMMARY" env: - GRAFANA_URL: https://grafana-poc.avax-dev.network/d/${{ inputs.grafana_dashboard_id }}?orgId=1&refresh=10s&var-filter=is_ephemeral_node%7C%3D%7Cfalse&var-filter=gh_repo%7C%3D%7C${{ inputs.repository_owner }}%2F${{ inputs.repository_name }}&var-filter=gh_run_id%7C%3D%7C${{ inputs.run_id }}&var-filter=gh_run_attempt%7C%3D%7C${{ inputs.run_attempt }} + GRAFANA_URL: https://grafana-poc.avax-dev.network/d/Gl1I20mnk/c-chain?orgId=1&refresh=10s&var-filter=is_ephemeral_node%7C%3D%7Cfalse&var-filter=gh_repo%7C%3D%7C${{ inputs.repository_owner }}%2F${{ inputs.repository_name }}&var-filter=gh_run_id%7C%3D%7C${{ inputs.run_id }}&var-filter=gh_run_attempt%7C%3D%7C${{ inputs.run_attempt }} GH_JOB_ID: ${{ inputs.job }} - name: Warn that collection of metrics and logs will not be performed if: inputs.prometheus-username == '' @@ -128,8 +126,6 @@ runs: env: RUNNER_NAME: ${{ inputs.runner_name }} TMPNET_START_METRICS_COLLECTOR: ${{ inputs.prometheus-username != '' }} - TMPNET_CHECK_METRICS_COLLECTED: ${{ inputs.prometheus-username != '' }} - METRICS_SERVER_ENABLED: ${{ inputs.prometheus-username != '' }} METRICS_COLLECTOR_ENABLED: ${{ inputs.prometheus-username != '' }} PROMETHEUS_URL: ${{ inputs.prometheus-url }} PROMETHEUS_PUSH_URL: ${{ inputs.prometheus-push-url }} @@ -151,7 +147,7 @@ runs: auto-push: ${{ inputs.push-github-action-benchmark }} - name: Push Post-State to S3 if: inputs.push-post-state != '' - shell: nix develop --impure --command bash -x {0} + shell: nix develop --command bash -x {0} run: | ./scripts/run_task.sh export-dir-to-s3 \ SRC=${{ env.EXECUTION_DATA_DIR }}/current-state/ \ diff --git a/.github/workflows/c-chain-reexecution-benchmark-container.yml b/.github/workflows/c-chain-reexecution-benchmark-container.yml index e90787ffd3ac..80a215062c91 100644 --- a/.github/workflows/c-chain-reexecution-benchmark-container.yml +++ b/.github/workflows/c-chain-reexecution-benchmark-container.yml @@ -4,13 +4,13 @@ on: pull_request: workflow_dispatch: inputs: + task: + description: 'Taskfile task to execute (e.g., c-chain-reexecution-hashdb-101-250k)' + required: true runner: description: 'Runner to execute the benchmark. Input to the runs-on field of the job.' required: false default: ubuntu-latest - task: - description: 'Taskfile task to execute (e.g., c-chain-reexecution-hashdb-101-250k)' - required: true push-post-state: description: 'S3 location to push post-execution state directory. Skips this step if left unpopulated.' default: '' @@ -80,13 +80,13 @@ jobs: uses: ./.github/actions/c-chain-reexecution-benchmark with: task: ${{ matrix.task }} - runner_name: ${{ matrix.runner }} - aws-role: ${{ github.event.inputs.push-post-state != '' && secrets.AWS_S3_RW_ROLE || secrets.AWS_S3_READ_ONLY_ROLE }} - aws-region: 'us-east-2' prometheus-url: ${{ secrets.PROMETHEUS_URL || '' }} prometheus-push-url: ${{ secrets.PROMETHEUS_PUSH_URL || '' }} prometheus-username: ${{ secrets.PROMETHEUS_USERNAME || '' }} prometheus-password: ${{ secrets.PROMETHEUS_PASSWORD || '' }} - github-token: ${{ secrets.GITHUB_TOKEN }} push-github-action-benchmark: ${{ github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && github.repository == 'ava-labs/avalanchego' && github.ref_name == 'master') }} - push-post-state: ${{ github.event.inputs.push-post-state || '' }} + 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 }} + push-post-state: ${{ github.event.inputs.push-post-state }} + runner_name: ${{ matrix.runner }} diff --git a/.github/workflows/c-chain-reexecution-benchmark-gh-native.yml b/.github/workflows/c-chain-reexecution-benchmark-gh-native.yml index d1edfa20162d..fe0ea75cfd0d 100644 --- a/.github/workflows/c-chain-reexecution-benchmark-gh-native.yml +++ b/.github/workflows/c-chain-reexecution-benchmark-gh-native.yml @@ -70,13 +70,13 @@ jobs: uses: ./.github/actions/c-chain-reexecution-benchmark with: task: ${{ matrix.task }} - runner_name: ${{ matrix.runner }} - aws-role: ${{ github.event.inputs.push-post-state != '' && secrets.AWS_S3_RW_ROLE || secrets.AWS_S3_READ_ONLY_ROLE }} - aws-region: 'us-east-2' prometheus-url: ${{ secrets.PROMETHEUS_URL || '' }} prometheus-push-url: ${{ secrets.PROMETHEUS_PUSH_URL || '' }} prometheus-username: ${{ secrets.PROMETHEUS_USERNAME || '' }} prometheus-password: ${{ secrets.PROMETHEUS_PASSWORD || '' }} - github-token: ${{ secrets.GITHUB_TOKEN }} push-github-action-benchmark: ${{ github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && github.repository == 'ava-labs/avalanchego' && github.ref_name == 'master') }} - push-post-state: ${{ github.event.inputs.push-post-state || '' }} + 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 }} + push-post-state: ${{ github.event.inputs.push-post-state }} + runner_name: ${{ matrix.runner }} From c0281edf4c8898a6c76abeaa5aa5e7865649f9ef Mon Sep 17 00:00:00 2001 From: "Elvis S." Date: Mon, 3 Nov 2025 18:38:19 +0400 Subject: [PATCH 48/69] address PR --- scripts/benchmark_cchain_range.sh | 22 ++++------------------ tests/reexecute/c/vm_reexecute_test.go | 6 ++++++ 2 files changed, 10 insertions(+), 18 deletions(-) diff --git a/scripts/benchmark_cchain_range.sh b/scripts/benchmark_cchain_range.sh index 6d630f89157a..9534f12e2d39 100755 --- a/scripts/benchmark_cchain_range.sh +++ b/scripts/benchmark_cchain_range.sh @@ -8,33 +8,19 @@ set -euo pipefail # CURRENT_STATE_DIR: Path or S3 URL to the current state directory or zip. # START_BLOCK: The starting block height (exclusive). # END_BLOCK: The ending block height (inclusive). -# RUNNER_NAME (optional): Name of the runner (defaults to "dev"). -# CONFIG (optional): Configuration name (defaults to "default"). # LABELS (optional): Comma-separated key=value pairs for metric labels. # BENCHMARK_OUTPUT_FILE (optional): If set, benchmark output is also written to this file. -# METRICS_SERVER_ENABLED (optional): If set to "true", enables the metrics server (defaults to "false"). -# METRICS_SERVER_PORT (optional): Port for the metrics server (defaults to "0"). -# METRICS_COLLECTOR_ENABLED (optional): If set to "true", enables the metrics collector (defaults to "false"). +# METRICS_SERVER_ENABLED (optional): If set, enables the metrics server. +# METRICS_SERVER_PORT (optional): If set, determines the port the metrics server will listen to. +# METRICS_COLLECTOR_ENABLED (optional): If set, enables the metrics collector. : "${BLOCK_DIR:?BLOCK_DIR must be set}" : "${CURRENT_STATE_DIR:?CURRENT_STATE_DIR must be set}" : "${START_BLOCK:?START_BLOCK must be set}" : "${END_BLOCK:?END_BLOCK must be set}" -# Set defaults for optional variables +# Defaults to "dev" set at vm_reexecute_test.go `runnerNameArg` : "${RUNNER_NAME:=dev}" -: "${CONFIG:=default}" -: "${METRICS_SERVER_ENABLED:=false}" -: "${METRICS_SERVER_PORT:=0}" -: "${METRICS_COLLECTOR_ENABLED:=false}" - -echo "=== C-Chain Re-execution Benchmark Environment Variables ===" -echo "Runner: ${RUNNER_NAME}" -echo "Config: ${CONFIG}" -echo "Blocks: ${START_BLOCK} to ${END_BLOCK}" -echo "Metrics server: ${METRICS_SERVER_ENABLED}" -echo "Metrics server port: ${METRICS_SERVER_PORT}" -echo "Metrics collector: ${METRICS_COLLECTOR_ENABLED}" cmd="go test -timeout=0 -v -benchtime=1x -bench=BenchmarkReexecuteRange -run=^$ github.com/ava-labs/avalanchego/tests/reexecute/c \ --block-dir=\"${BLOCK_DIR}\" \ diff --git a/tests/reexecute/c/vm_reexecute_test.go b/tests/reexecute/c/vm_reexecute_test.go index 124ad589e571..7f0b538e359a 100644 --- a/tests/reexecute/c/vm_reexecute_test.go +++ b/tests/reexecute/c/vm_reexecute_test.go @@ -208,6 +208,12 @@ func benchmarkReexecuteRange( ) log.Info("re-executing block range with params", + zap.String("runner", runnerNameArg), + zap.String("config", configNameArg), + zap.String("labels", labelsArg), + zap.String("metrics-server-enabled", strconv.FormatBool(metricsServerEnabled)), + zap.Uint64("metrics-server-port", metricsPort), + zap.String("metrics-collector-enabled", strconv.FormatBool(metricsCollectorEnabled)), zap.String("block-dir", blockDir), zap.String("vm-db-dir", vmDBDir), zap.String("chain-data-dir", chainDataDir), From 10c5ef7d8c84b840479a3b2470b32ebe2bb3f290 Mon Sep 17 00:00:00 2001 From: "Elvis S." Date: Mon, 3 Nov 2025 18:48:33 +0400 Subject: [PATCH 49/69] ci(c-chain-reexecution-benchmark): revert change on `Push Post-State to S3` --- .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 dca62b086053..61073546086d 100644 --- a/.github/actions/c-chain-reexecution-benchmark/action.yml +++ b/.github/actions/c-chain-reexecution-benchmark/action.yml @@ -147,7 +147,7 @@ runs: auto-push: ${{ inputs.push-github-action-benchmark }} - name: Push Post-State to S3 if: inputs.push-post-state != '' - shell: nix develop --command bash -x {0} + shell: nix develop --impure --command bash -x {0} run: | ./scripts/run_task.sh export-dir-to-s3 \ SRC=${{ env.EXECUTION_DATA_DIR }}/current-state/ \ From c5b650a615e1e1c12c3a3c437ff8b70af6dbca93 Mon Sep 17 00:00:00 2001 From: "Elvis S." Date: Thu, 6 Nov 2025 00:05:48 +0400 Subject: [PATCH 50/69] chore(benchamrk_cchain_range): avoid duplicating the default of `RUNNER_NAME` --- scripts/benchmark_cchain_range.sh | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/scripts/benchmark_cchain_range.sh b/scripts/benchmark_cchain_range.sh index 9534f12e2d39..0eb0fe9ccb50 100755 --- a/scripts/benchmark_cchain_range.sh +++ b/scripts/benchmark_cchain_range.sh @@ -8,6 +8,7 @@ set -euo pipefail # CURRENT_STATE_DIR: Path or S3 URL to the current state directory or zip. # START_BLOCK: The starting block height (exclusive). # END_BLOCK: The ending block height (inclusive). +# RUNNER_NAME (optional): Runner name for the benchmark (defaults to "dev" in Go code). # LABELS (optional): Comma-separated key=value pairs for metric labels. # BENCHMARK_OUTPUT_FILE (optional): If set, benchmark output is also written to this file. # METRICS_SERVER_ENABLED (optional): If set, enables the metrics server. @@ -19,13 +20,10 @@ set -euo pipefail : "${START_BLOCK:?START_BLOCK must be set}" : "${END_BLOCK:?END_BLOCK must be set}" -# Defaults to "dev" set at vm_reexecute_test.go `runnerNameArg` -: "${RUNNER_NAME:=dev}" - cmd="go test -timeout=0 -v -benchtime=1x -bench=BenchmarkReexecuteRange -run=^$ github.com/ava-labs/avalanchego/tests/reexecute/c \ --block-dir=\"${BLOCK_DIR}\" \ --current-state-dir=\"${CURRENT_STATE_DIR}\" \ - --runner=\"${RUNNER_NAME}\" \ + ${RUNNER_NAME:+--runner=\"${RUNNER_NAME}\"} \ ${CONFIG:+--config=\"${CONFIG}\"} \ --start-block=\"${START_BLOCK}\" \ --end-block=\"${END_BLOCK}\" \ From 20c4ad057233afe5b8cd7ff4e9a06c78a0480a0c Mon Sep 17 00:00:00 2001 From: "Elvis S." Date: Thu, 6 Nov 2025 00:17:26 +0400 Subject: [PATCH 51/69] ci(c-chain-reexecution): - inline set task env - remove unrelated `TMPNET_START_METRICS_COLLECTOR` env var --- .github/actions/c-chain-reexecution-benchmark/action.yml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/actions/c-chain-reexecution-benchmark/action.yml b/.github/actions/c-chain-reexecution-benchmark/action.yml index 61073546086d..2b7c38067fb7 100644 --- a/.github/actions/c-chain-reexecution-benchmark/action.yml +++ b/.github/actions/c-chain-reexecution-benchmark/action.yml @@ -114,10 +114,8 @@ runs: shell: bash run: | TIMESTAMP=$(date '+%Y%m%d-%H%M%S') - EXEC_DIR="/tmp/reexecution-data-${TIMESTAMP}" - BENCHMARK_FILE="${GITHUB_WORKSPACE}/benchmark-output.txt" - echo "EXECUTION_DATA_DIR=${EXEC_DIR}" >> "$GITHUB_ENV" - echo "BENCHMARK_OUTPUT_FILE=${BENCHMARK_FILE}" >> "$GITHUB_ENV" + echo "EXECUTION_DATA_DIR=/tmp/reexecution-data-${TIMESTAMP}" >> "$GITHUB_ENV" + echo "BENCHMARK_OUTPUT_FILE=${GITHUB_WORKSPACE}/benchmark-output.txt" >> "$GITHUB_ENV" - name: Run C-Chain Re-execution Benchmark shell: nix develop --impure --command bash -x {0} run: ./scripts/run_task.sh ${{ inputs.task }} \ @@ -125,7 +123,6 @@ runs: EXECUTION_DATA_DIR="${{ env.EXECUTION_DATA_DIR }}" env: RUNNER_NAME: ${{ inputs.runner_name }} - TMPNET_START_METRICS_COLLECTOR: ${{ inputs.prometheus-username != '' }} METRICS_COLLECTOR_ENABLED: ${{ inputs.prometheus-username != '' }} PROMETHEUS_URL: ${{ inputs.prometheus-url }} PROMETHEUS_PUSH_URL: ${{ inputs.prometheus-push-url }} From 519e92a31da42f30d251edbc293b1f6ec90612d8 Mon Sep 17 00:00:00 2001 From: "Elvis S." Date: Thu, 6 Nov 2025 00:18:23 +0400 Subject: [PATCH 52/69] chore: rm doc --- scripts/benchmark_cchain_range.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/scripts/benchmark_cchain_range.sh b/scripts/benchmark_cchain_range.sh index 0eb0fe9ccb50..896e68f8a559 100755 --- a/scripts/benchmark_cchain_range.sh +++ b/scripts/benchmark_cchain_range.sh @@ -8,7 +8,6 @@ set -euo pipefail # CURRENT_STATE_DIR: Path or S3 URL to the current state directory or zip. # START_BLOCK: The starting block height (exclusive). # END_BLOCK: The ending block height (inclusive). -# RUNNER_NAME (optional): Runner name for the benchmark (defaults to "dev" in Go code). # LABELS (optional): Comma-separated key=value pairs for metric labels. # BENCHMARK_OUTPUT_FILE (optional): If set, benchmark output is also written to this file. # METRICS_SERVER_ENABLED (optional): If set, enables the metrics server. From a800ff1545c0fedb598f686d4369ef21ab788925 Mon Sep 17 00:00:00 2001 From: "Elvis S." Date: Fri, 7 Nov 2025 00:33:31 +0400 Subject: [PATCH 53/69] ci(c-chain-reexecution): support alternative approach to task based operations --- .../c-chain-reexecution-benchmark/action.yml | 57 +++++++++++++++++-- 1 file changed, 52 insertions(+), 5 deletions(-) diff --git a/.github/actions/c-chain-reexecution-benchmark/action.yml b/.github/actions/c-chain-reexecution-benchmark/action.yml index 2b7c38067fb7..6ac3741ef37d 100644 --- a/.github/actions/c-chain-reexecution-benchmark/action.yml +++ b/.github/actions/c-chain-reexecution-benchmark/action.yml @@ -3,8 +3,24 @@ description: 'Run C-Chain re-execution benchmark' inputs: task: - description: 'Task name to execute from Taskfile.yml' - required: true + description: 'Task name to execute from Taskfile.yml. Leave empty to use granular inputs below.' + default: '' + # Custom inputs (alternative to task-based approach) + config: + description: 'The config to pass to the VM for the benchmark. See BenchmarkReexecuteRange for details.' + default: '' + start-block: + description: 'The start block for the benchmark.' + default: '' + end-block: + description: 'The end block for the benchmark.' + default: '' + block-dir-src: + description: 'The source block directory. Supports S3 directory/zip and local directories.' + default: '' + current-state-dir-src: + description: 'The current state directory. Supports S3 directory/zip and local directories.' + default: '' runner_name: description: 'The name of the runner to use and include in the Golang Benchmark name.' required: true @@ -110,6 +126,22 @@ runs: role-to-assume: ${{ inputs.aws-role }} aws-region: ${{ inputs.aws-region }} role-duration-seconds: ${{ inputs.aws-role-duration-seconds }} + - name: Validate inputs + shell: bash + run: | + if [[ -z "${{ inputs.task }}" ]]; then + # Granular mode - validate required inputs + missing=() + [[ -z "${{ inputs.block-dir-src }}" ]] && missing+=("block-dir-src") + [[ -z "${{ inputs.current-state-dir-src }}" ]] && missing+=("current-state-dir-src") + [[ -z "${{ inputs.start-block }}" ]] && missing+=("start-block") + [[ -z "${{ inputs.end-block }}" ]] && missing+=("end-block") + + if [[ ${#missing[@]} -gt 0 ]]; then + echo "::error::When 'task' is empty, the following inputs are required: ${missing[*]}" + exit 1 + fi + fi - name: Set task env shell: bash run: | @@ -118,9 +150,24 @@ runs: echo "BENCHMARK_OUTPUT_FILE=${GITHUB_WORKSPACE}/benchmark-output.txt" >> "$GITHUB_ENV" - name: Run C-Chain Re-execution Benchmark shell: nix develop --impure --command bash -x {0} - run: ./scripts/run_task.sh ${{ inputs.task }} \ - BENCHMARK_OUTPUT_FILE="${{ env.BENCHMARK_OUTPUT_FILE }}" \ - EXECUTION_DATA_DIR="${{ env.EXECUTION_DATA_DIR }}" + run: | + if [[ -n "${{ inputs.task }}" ]]; then + # Task-based approach + ./scripts/run_task.sh ${{ inputs.task }} \ + BENCHMARK_OUTPUT_FILE="${{ env.BENCHMARK_OUTPUT_FILE }}" \ + EXECUTION_DATA_DIR="${{ env.EXECUTION_DATA_DIR }}" + else + # Granular approach + ./scripts/run_task.sh reexecute-cchain-range-with-copied-data \ + CONFIG=${{ inputs.config }} \ + EXECUTION_DATA_DIR=${{ env.EXECUTION_DATA_DIR }} \ + BLOCK_DIR_SRC=${{ inputs.block-dir-src }} \ + CURRENT_STATE_DIR_SRC=${{ inputs.current-state-dir-src }} \ + START_BLOCK=${{ inputs.start-block }} \ + END_BLOCK=${{ inputs.end-block }} \ + BENCHMARK_OUTPUT_FILE="${{ env.BENCHMARK_OUTPUT_FILE }}" \ + TASK_NAME="custom-reexecution" + fi env: RUNNER_NAME: ${{ inputs.runner_name }} METRICS_COLLECTOR_ENABLED: ${{ inputs.prometheus-username != '' }} From f7f0ccfb0fcf27bedecad55cd7ffaf76a6998ca2 Mon Sep 17 00:00:00 2001 From: "Elvis S." Date: Fri, 7 Nov 2025 00:35:21 +0400 Subject: [PATCH 54/69] ci(c-chain-reexecution): support both container and native altenrative (custom) approach to task based operations --- ...-chain-reexecution-benchmark-container.yml | 85 ++++++++++++++++++- ...-chain-reexecution-benchmark-gh-native.yml | 35 ++++++-- 2 files changed, 112 insertions(+), 8 deletions(-) diff --git a/.github/workflows/c-chain-reexecution-benchmark-container.yml b/.github/workflows/c-chain-reexecution-benchmark-container.yml index 80a215062c91..bda5dadc539c 100644 --- a/.github/workflows/c-chain-reexecution-benchmark-container.yml +++ b/.github/workflows/c-chain-reexecution-benchmark-container.yml @@ -4,19 +4,93 @@ on: pull_request: workflow_dispatch: inputs: + config: + description: 'The config to pass to the VM for the benchmark. See BenchmarkReexecuteRange for details.' + default: '' + start-block: + description: 'The start block for the benchmark.' + default: '' + end-block: + description: 'The end block for the benchmark.' + default: '' + block-dir-src: + description: 'The source block directory. Supports S3 directory/zip and local directories.' + type: choice + default: '' + options: + - '' + - cchain-mainnet-blocks-200-ldb + - cchain-mainnet-blocks-10k-ldb + - cchain-mainnet-blocks-1m-ldb + - cchain-mainnet-blocks-1-10m-ldb + - cchain-mainnet-blocks-10m-20m-ldb + - cchain-mainnet-blocks-20m-30m-ldb + - cchain-mainnet-blocks-30m-40m-ldb + - cchain-mainnet-blocks-40m-50m-ldb + - cchain-mainnet-blocks-50m-ldb + - cchain-mainnet-blocks-50m-60m-ldb + - cchain-mainnet-blocks-60m-69m-ldb + - cchain-mainnet-blocks-69m-ldb + - cchain-mainnet-blocks-69m-70m-ldb + current-state-dir-src: + description: 'The current state directory. Supports S3 directory/zip and local directories.' + default: '' + type: choice + options: + - '' + - cchain-current-state-firewood-100 + - cchain-current-state-firewood-1m + - cchain-current-state-firewood-10m + - cchain-current-state-firewood-20m + - cchain-current-state-firewood-30m + - cchain-current-state-firewood-33m + - cchain-current-state-firewood-40m + - cchain-current-state-firewood-50m + - cchain-current-state-hashdb-full-100 + - cchain-current-state-hashdb-full-1k + - cchain-current-state-hashdb-full-1m + - cchain-current-state-hashdb-full-10m + - cchain-current-state-hashdb-full-20m + - cchain-current-state-hashdb-full-30m + - cchain-current-state-hashdb-full-33m + - cchain-current-state-hashdb-full-40m + - cchain-current-state-hashdb-full-50m + - cchain-current-state-hashdb-full-55m + - cchain-current-state-hashdb-full-60m + - cchain-current-state-hashdb-full-65m + - cchain-current-state-hashdb-full-68m + - cchain-current-state-hashdb-full-69m + - cchain-current-state-hashdb-archive-100 + - cchain-current-state-hashdb-archive-1k + - cchain-current-state-hashdb-archive-2k + - cchain-current-state-hashdb-archive-3k + - cchain-current-state-hashdb-archive-1m + - cchain-current-state-hashdb-archive-10m + - cchain-current-state-hashdb-archive-20m + - cchain-current-state-hashdb-archive-30m + - cchain-current-state-hashdb-archive-33m + - cchain-current-state-hashdb-archive-40m + - cchain-current-state-hashdb-archive-50m + - cchain-current-state-hashdb-archive-60m + - cchain-current-state-hashdb-archive-69m task: description: 'Taskfile task to execute (e.g., c-chain-reexecution-hashdb-101-250k)' - required: true + default: '' runner: description: 'Runner to execute the benchmark. Input to the runs-on field of the job.' - required: false default: ubuntu-latest + type: choice + options: + - ubuntu-latest + - blacksmith-4vcpu-ubuntu-2404 + - avalanche-avalanchego-runner-2ti + - avago-runner-m6i-4xlarge-ebs-fast + - avago-runner-i4i-4xlarge-local-ssd push-post-state: description: 'S3 location to push post-execution state directory. Skips this step if left unpopulated.' default: '' timeout-minutes: description: 'Timeout in minutes for the job.' - required: false default: 30 # Disabled because scheduled trigger is empty. To enable, uncomment and add at least one vector to the schedule @@ -80,6 +154,11 @@ jobs: uses: ./.github/actions/c-chain-reexecution-benchmark with: task: ${{ matrix.task }} + config: ${{ inputs.config }} + start-block: ${{ inputs.start-block }} + end-block: ${{ inputs.end-block }} + block-dir-src: ${{ inputs.block-dir-src }} + current-state-dir-src: ${{ inputs.current-state-dir-src }} prometheus-url: ${{ secrets.PROMETHEUS_URL || '' }} prometheus-push-url: ${{ secrets.PROMETHEUS_PUSH_URL || '' }} prometheus-username: ${{ secrets.PROMETHEUS_USERNAME || '' }} diff --git a/.github/workflows/c-chain-reexecution-benchmark-gh-native.yml b/.github/workflows/c-chain-reexecution-benchmark-gh-native.yml index fe0ea75cfd0d..df298a7c141c 100644 --- a/.github/workflows/c-chain-reexecution-benchmark-gh-native.yml +++ b/.github/workflows/c-chain-reexecution-benchmark-gh-native.yml @@ -4,19 +4,39 @@ on: pull_request: workflow_dispatch: inputs: + config: + description: 'The config to pass to the VM for the benchmark. See BenchmarkReexecuteRange for details.' + default: '' + start-block: + description: 'The start block for the benchmark.' + default: '' + end-block: + description: 'The end block for the benchmark.' + default: '' + block-dir-src: + description: 'The source block directory. Supports S3 directory/zip and local directories.' + default: '' + current-state-dir-src: + description: 'The current state directory. Supports S3 directory/zip and local directories.' + default: '' + task: + description: 'Taskfile task to execute (e.g., c-chain-reexecution-hashdb-101-250k)' + default: '' runner: description: 'Runner to execute the benchmark. Input to the runs-on field of the job.' - required: false default: ubuntu-latest - task: - description: 'Taskfile task to execute (e.g., c-chain-reexecution-hashdb-101-250k)' - required: true + type: choice + options: + - ubuntu-latest + - blacksmith-4vcpu-ubuntu-2404 + - avalanche-avalanchego-runner-2ti + - avago-runner-m6i-4xlarge-ebs-fast + - avago-runner-i4i-4xlarge-local-ssd push-post-state: description: 'S3 location to push post-execution state directory. Skips this step if left unpopulated.' default: '' timeout-minutes: description: 'Timeout in minutes for the job.' - required: false default: 30 # Disabled because scheduled trigger is empty. To enable, uncomment and add at least one vector to the schedule @@ -70,6 +90,11 @@ jobs: uses: ./.github/actions/c-chain-reexecution-benchmark with: task: ${{ matrix.task }} + config: ${{ inputs.config }} + start-block: ${{ inputs.start-block }} + end-block: ${{ inputs.end-block }} + block-dir-src: ${{ inputs.block-dir-src }} + current-state-dir-src: ${{ inputs.current-state-dir-src }} prometheus-url: ${{ secrets.PROMETHEUS_URL || '' }} prometheus-push-url: ${{ secrets.PROMETHEUS_PUSH_URL || '' }} prometheus-username: ${{ secrets.PROMETHEUS_USERNAME || '' }} From 7921a03484ab48b639ba7cf26a50c99f1cbd24c2 Mon Sep 17 00:00:00 2001 From: "Elvis S." Date: Fri, 7 Nov 2025 00:44:20 +0400 Subject: [PATCH 55/69] lint --- .../c-chain-reexecution-benchmark/action.yml | 2 +- ...-chain-reexecution-benchmark-container.yml | 54 ------------------- 2 files changed, 1 insertion(+), 55 deletions(-) diff --git a/.github/actions/c-chain-reexecution-benchmark/action.yml b/.github/actions/c-chain-reexecution-benchmark/action.yml index 6ac3741ef37d..bd628f322134 100644 --- a/.github/actions/c-chain-reexecution-benchmark/action.yml +++ b/.github/actions/c-chain-reexecution-benchmark/action.yml @@ -3,7 +3,7 @@ description: 'Run C-Chain re-execution benchmark' inputs: task: - description: 'Task name to execute from Taskfile.yml. Leave empty to use granular inputs below.' + description: 'Task name to execute from Taskfile.yml. Leave empty to use custom inputs below.' default: '' # Custom inputs (alternative to task-based approach) config: diff --git a/.github/workflows/c-chain-reexecution-benchmark-container.yml b/.github/workflows/c-chain-reexecution-benchmark-container.yml index bda5dadc539c..361eebe840b6 100644 --- a/.github/workflows/c-chain-reexecution-benchmark-container.yml +++ b/.github/workflows/c-chain-reexecution-benchmark-container.yml @@ -15,64 +15,10 @@ on: default: '' block-dir-src: description: 'The source block directory. Supports S3 directory/zip and local directories.' - type: choice default: '' - options: - - '' - - cchain-mainnet-blocks-200-ldb - - cchain-mainnet-blocks-10k-ldb - - cchain-mainnet-blocks-1m-ldb - - cchain-mainnet-blocks-1-10m-ldb - - cchain-mainnet-blocks-10m-20m-ldb - - cchain-mainnet-blocks-20m-30m-ldb - - cchain-mainnet-blocks-30m-40m-ldb - - cchain-mainnet-blocks-40m-50m-ldb - - cchain-mainnet-blocks-50m-ldb - - cchain-mainnet-blocks-50m-60m-ldb - - cchain-mainnet-blocks-60m-69m-ldb - - cchain-mainnet-blocks-69m-ldb - - cchain-mainnet-blocks-69m-70m-ldb current-state-dir-src: description: 'The current state directory. Supports S3 directory/zip and local directories.' default: '' - type: choice - options: - - '' - - cchain-current-state-firewood-100 - - cchain-current-state-firewood-1m - - cchain-current-state-firewood-10m - - cchain-current-state-firewood-20m - - cchain-current-state-firewood-30m - - cchain-current-state-firewood-33m - - cchain-current-state-firewood-40m - - cchain-current-state-firewood-50m - - cchain-current-state-hashdb-full-100 - - cchain-current-state-hashdb-full-1k - - cchain-current-state-hashdb-full-1m - - cchain-current-state-hashdb-full-10m - - cchain-current-state-hashdb-full-20m - - cchain-current-state-hashdb-full-30m - - cchain-current-state-hashdb-full-33m - - cchain-current-state-hashdb-full-40m - - cchain-current-state-hashdb-full-50m - - cchain-current-state-hashdb-full-55m - - cchain-current-state-hashdb-full-60m - - cchain-current-state-hashdb-full-65m - - cchain-current-state-hashdb-full-68m - - cchain-current-state-hashdb-full-69m - - cchain-current-state-hashdb-archive-100 - - cchain-current-state-hashdb-archive-1k - - cchain-current-state-hashdb-archive-2k - - cchain-current-state-hashdb-archive-3k - - cchain-current-state-hashdb-archive-1m - - cchain-current-state-hashdb-archive-10m - - cchain-current-state-hashdb-archive-20m - - cchain-current-state-hashdb-archive-30m - - cchain-current-state-hashdb-archive-33m - - cchain-current-state-hashdb-archive-40m - - cchain-current-state-hashdb-archive-50m - - cchain-current-state-hashdb-archive-60m - - cchain-current-state-hashdb-archive-69m task: description: 'Taskfile task to execute (e.g., c-chain-reexecution-hashdb-101-250k)' default: '' From e703fe0a5bd411b5b1d01086cd84374abb0449d9 Mon Sep 17 00:00:00 2001 From: "Elvis S." Date: Fri, 7 Nov 2025 00:58:51 +0400 Subject: [PATCH 56/69] refactor(scripts): extract S3 bucket config from copy_dir.sh to Taskfile env making copy_dir.sh reusable for any S3 bucket --- Taskfile.yml | 19 +++++++++++++++++-- scripts/copy_dir.sh | 9 +++------ 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/Taskfile.yml b/Taskfile.yml index c69714938034..8939d782b803 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -4,6 +4,9 @@ version: '3' +env: + S3_BOOTSTRAP_BUCKET: 's3://avalanchego-bootstrap-testing' + tasks: default: ./scripts/run_task.sh --list @@ -142,8 +145,8 @@ tasks: desc: Imports the C-Chain block and state data to re-execute. Defaults to import the first 200 and the current state created with the default config of the C-Chain (hashdb). vars: EXECUTION_DATA_DIR: '{{.EXECUTION_DATA_DIR}}' - BLOCK_DIR_SRC: '{{.BLOCK_DIR_SRC | default "s3://avalanchego-bootstrap-testing/cchain-mainnet-blocks-200-ldb/**"}}' - CURRENT_STATE_DIR_SRC: '{{.CURRENT_STATE_DIR_SRC | default "s3://avalanchego-bootstrap-testing/cchain-current-state-hashdb-full-100/**"}}' + BLOCK_DIR_SRC: '{{.BLOCK_DIR_SRC | default (printf "%s/cchain-mainnet-blocks-200-ldb/**" .S3_BOOTSTRAP_BUCKET)}}' + CURRENT_STATE_DIR_SRC: '{{.CURRENT_STATE_DIR_SRC | default (printf "%s/cchain-current-state-hashdb-full-100/**" .S3_BOOTSTRAP_BUCKET)}}' cmds: - task: import-s3-to-dir vars: @@ -299,6 +302,18 @@ tasks: CURRENT_STATE_DIR_SRC: 'cchain-current-state-firewood-33m' CONFIG: firewood + c-chain-reexecution-firewood-33m-40m: + desc: C-Chain re-execution from block 33m to 40m with firewood + cmds: + - task: reexecute-cchain-range-with-copied-data + vars: + TASK_NAME: '{{.TASK}}' + START_BLOCK: 33000001 + END_BLOCK: 40000000 + BLOCK_DIR_SRC: 'cchain-mainnet-blocks-30m-40m-ldb' + CURRENT_STATE_DIR_SRC: 'cchain-current-state-firewood-33m' + CONFIG: firewood + c-chain-reexecution-firewood-101-250k: desc: C-Chain re-execution from block 101 to 250k with firewood cmds: diff --git a/scripts/copy_dir.sh b/scripts/copy_dir.sh index 5bdafc3dc2c4..a6de180c1dc7 100755 --- a/scripts/copy_dir.sh +++ b/scripts/copy_dir.sh @@ -3,10 +3,6 @@ set -euo pipefail # Usage: ./scripts/copy_dir.sh source_directory destination_directory -# Sources can be: -# - S3 URLs (s3://bucket/path) -# - S3 object keys (will be expanded to s3://avalanchego-bootstrap-testing//**) -# - Local file paths # Assumes s5cmd has been installed and is available in the PATH. # s5cmd is included in the nix dev shell. @@ -24,8 +20,9 @@ DST="$2" # If SRC doesn't start with s3:// or /, assume it's an S3 object key if [[ "$SRC" != s3://* ]] && [[ "$SRC" != /* ]]; then - SRC="s3://avalanchego-bootstrap-testing/${SRC}/**" - echo "Expanded object key to: $SRC" + echo "Error: SRC must be either an S3 URL (s3://...), a local path (/...), or already expanded" + echo "If using an object key, expand it before calling this script" + exit 1 fi # Function to copy from a single source to destination From d359c7aeedbc02394db783eeb845d22c2049931b Mon Sep 17 00:00:00 2001 From: "Elvis S." Date: Fri, 7 Nov 2025 01:12:25 +0400 Subject: [PATCH 57/69] fix --- Taskfile.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Taskfile.yml b/Taskfile.yml index 8939d782b803..746271999568 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -243,8 +243,8 @@ tasks: cmds: - task: import-cchain-reexecute-range vars: - BLOCK_DIR_SRC: '{{.BLOCK_DIR_SRC}}' - CURRENT_STATE_DIR_SRC: '{{.CURRENT_STATE_DIR_SRC}}' + BLOCK_DIR_SRC: '{{.S3_BOOTSTRAP_BUCKET}}/{{.BLOCK_DIR_SRC}}/**' + CURRENT_STATE_DIR_SRC: '{{.S3_BOOTSTRAP_BUCKET}}/{{.CURRENT_STATE_DIR_SRC}}/**' EXECUTION_DATA_DIR: '{{.EXECUTION_DATA_DIR}}' - task: reexecute-cchain-range vars: From 0cb04dc9def691259e08d66b93bff267985f74fe Mon Sep 17 00:00:00 2001 From: "Elvis S." Date: Wed, 12 Nov 2025 13:30:32 +0400 Subject: [PATCH 58/69] ci(c-chain-reexecution): use dynamic env variable for benchmark output file path --- .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 bd628f322134..85a7c952af10 100644 --- a/.github/actions/c-chain-reexecution-benchmark/action.yml +++ b/.github/actions/c-chain-reexecution-benchmark/action.yml @@ -185,7 +185,7 @@ runs: uses: benchmark-action/github-action-benchmark@v1 with: tool: 'go' - output-file-path: benchmark-output.txt + output-file-path: ${{ env.BENCHMARK_OUTPUT_FILE }} summary-always: true github-token: ${{ inputs.github-token }} auto-push: ${{ inputs.push-github-action-benchmark }} From 3b2a82f1c8bc213b0aaa8371557aeb6001039b9f Mon Sep 17 00:00:00 2001 From: "Elvis S." Date: Wed, 12 Nov 2025 13:38:22 +0400 Subject: [PATCH 59/69] ci(c-chain-reexecution): remove unused `TASK_NAME` environment variable --- .github/actions/c-chain-reexecution-benchmark/action.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/actions/c-chain-reexecution-benchmark/action.yml b/.github/actions/c-chain-reexecution-benchmark/action.yml index 85a7c952af10..6217ba3824d3 100644 --- a/.github/actions/c-chain-reexecution-benchmark/action.yml +++ b/.github/actions/c-chain-reexecution-benchmark/action.yml @@ -165,8 +165,7 @@ runs: CURRENT_STATE_DIR_SRC=${{ inputs.current-state-dir-src }} \ START_BLOCK=${{ inputs.start-block }} \ END_BLOCK=${{ inputs.end-block }} \ - BENCHMARK_OUTPUT_FILE="${{ env.BENCHMARK_OUTPUT_FILE }}" \ - TASK_NAME="custom-reexecution" + BENCHMARK_OUTPUT_FILE="${{ env.BENCHMARK_OUTPUT_FILE }}" fi env: RUNNER_NAME: ${{ inputs.runner_name }} From 3483737ff9af4ab0287822da1c0e51a5a403d6f8 Mon Sep 17 00:00:00 2001 From: "Elvis S." Date: Wed, 12 Nov 2025 14:17:27 +0400 Subject: [PATCH 60/69] ci(c-chain-reexecution): enforce required `runner` parameter by removing default options --- .../c-chain-reexecution-benchmark-container.yml | 9 +-------- .../c-chain-reexecution-benchmark-gh-native.yml | 9 +-------- 2 files changed, 2 insertions(+), 16 deletions(-) diff --git a/.github/workflows/c-chain-reexecution-benchmark-container.yml b/.github/workflows/c-chain-reexecution-benchmark-container.yml index 361eebe840b6..83f0d16bd560 100644 --- a/.github/workflows/c-chain-reexecution-benchmark-container.yml +++ b/.github/workflows/c-chain-reexecution-benchmark-container.yml @@ -24,14 +24,7 @@ on: default: '' runner: description: 'Runner to execute the benchmark. Input to the runs-on field of the job.' - default: ubuntu-latest - type: choice - options: - - ubuntu-latest - - blacksmith-4vcpu-ubuntu-2404 - - avalanche-avalanchego-runner-2ti - - avago-runner-m6i-4xlarge-ebs-fast - - avago-runner-i4i-4xlarge-local-ssd + required: true push-post-state: description: 'S3 location to push post-execution state directory. Skips this step if left unpopulated.' default: '' diff --git a/.github/workflows/c-chain-reexecution-benchmark-gh-native.yml b/.github/workflows/c-chain-reexecution-benchmark-gh-native.yml index df298a7c141c..d84033ee5232 100644 --- a/.github/workflows/c-chain-reexecution-benchmark-gh-native.yml +++ b/.github/workflows/c-chain-reexecution-benchmark-gh-native.yml @@ -24,14 +24,7 @@ on: default: '' runner: description: 'Runner to execute the benchmark. Input to the runs-on field of the job.' - default: ubuntu-latest - type: choice - options: - - ubuntu-latest - - blacksmith-4vcpu-ubuntu-2404 - - avalanche-avalanchego-runner-2ti - - avago-runner-m6i-4xlarge-ebs-fast - - avago-runner-i4i-4xlarge-local-ssd + required: true push-post-state: description: 'S3 location to push post-execution state directory. Skips this step if left unpopulated.' default: '' From bb3d233b221973b6892b0848abb8ab5f5bef8b4b Mon Sep 17 00:00:00 2001 From: "Elvis S." Date: Thu, 13 Nov 2025 14:01:29 +0400 Subject: [PATCH 61/69] chore: setup firewood --- scripts/setup_firewood.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/setup_firewood.sh b/scripts/setup_firewood.sh index 7cf55f63267d..ab8afea46c6e 100755 --- a/scripts/setup_firewood.sh +++ b/scripts/setup_firewood.sh @@ -41,9 +41,9 @@ echo "Setting up Firewood FFI version: ${FIREWOOD_VERSION}" >&2 echo "Using workspace: ${WORKSPACE_PATH}" >&2 git clone https://github.com/ava-labs/firewood "${FIREWOOD_CLONE_DIR}" \ - --quiet --depth 1 --branch composable-ci-action + --quiet --depth 1 -SETUP_FIREWOOD_SCRIPT="${FIREWOOD_CLONE_DIR}/benchmark/setup-scripts/build-firewood.sh" +SETUP_FIREWOOD_SCRIPT="${FIREWOOD_CLONE_DIR}/scripts/build-firewood.sh" if [ ! -f "${SETUP_FIREWOOD_SCRIPT}" ]; then echo "Error: Setup Firewood script not found at ${SETUP_FIREWOOD_SCRIPT}" >&2 From 1c8434fad291100805ddf65059662572a54162c9 Mon Sep 17 00:00:00 2001 From: "Elvis S." Date: Thu, 13 Nov 2025 14:07:57 +0400 Subject: [PATCH 62/69] chore(setup-firewood): use correct branch for cloning --- scripts/setup_firewood.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/setup_firewood.sh b/scripts/setup_firewood.sh index ab8afea46c6e..99cad6f71300 100755 --- a/scripts/setup_firewood.sh +++ b/scripts/setup_firewood.sh @@ -41,7 +41,7 @@ echo "Setting up Firewood FFI version: ${FIREWOOD_VERSION}" >&2 echo "Using workspace: ${WORKSPACE_PATH}" >&2 git clone https://github.com/ava-labs/firewood "${FIREWOOD_CLONE_DIR}" \ - --quiet --depth 1 + --quiet --depth 1 --branch composable-ci-action SETUP_FIREWOOD_SCRIPT="${FIREWOOD_CLONE_DIR}/scripts/build-firewood.sh" From a1485bbdbf5e413afccfaf0d154ca3d7dd582202 Mon Sep 17 00:00:00 2001 From: "Elvis S." Date: Thu, 13 Nov 2025 16:24:12 +0400 Subject: [PATCH 63/69] ci: disable ci jobs --- .../avalanchego-setup-action/action.yml | 18 +- .github/workflows/ci.yml | 406 +++++++++--------- .github/workflows/firewood-ab-test.yaml | 77 ++++ 3 files changed, 293 insertions(+), 208 deletions(-) create mode 100644 .github/workflows/firewood-ab-test.yaml diff --git a/.github/actions/avalanchego-setup-action/action.yml b/.github/actions/avalanchego-setup-action/action.yml index 1ce539fc2b28..0807e822505c 100644 --- a/.github/actions/avalanchego-setup-action/action.yml +++ b/.github/actions/avalanchego-setup-action/action.yml @@ -51,11 +51,19 @@ runs: echo "Updating LibEVM to version: ${{ inputs.libevm }}" go get github.com/ava-labs/libevm@${{ inputs.libevm }} - name: Setup Firewood FFI + if: inputs.firewood != '' + id: setup-firewood + uses: ava-labs/firewood/.github/actions/build-action@composable-ci-action + with: + version: ${{ inputs.firewood }} + workspace-path: ${{ inputs.firewood-path }} + - name: Configure Go modules with Firewood FFI if: inputs.firewood != '' shell: bash + working-directory: ${{ inputs.checkout-path }} run: | - if [ -n "${{ inputs.firewood-path }}" ]; then - "${{ inputs.checkout-path }}/scripts/setup_firewood.sh" "${{ inputs.firewood }}" "${{ inputs.firewood-path }}" - else - "${{ inputs.checkout-path }}/scripts/setup_firewood.sh" "${{ inputs.firewood }}" - fi + FFI_PATH="${{ steps.setup-firewood.outputs.ffi-path }}" + echo "Updating go.mod with FFI path: ${FFI_PATH}" + go mod edit -replace github.com/ava-labs/firewood-go-ethhash/ffi="${FFI_PATH}" + go mod tidy + go mod download diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7552ac424d19..cb1eaf850a7f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,100 +20,100 @@ 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 - - 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 - - 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/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 - - 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: + # 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 + # - 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 + # - 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/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 + # - 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 @@ -138,40 +138,40 @@ jobs: - 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 - # 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: + # 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 + # # 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: @@ -187,81 +187,81 @@ jobs: - 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/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/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/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: + # 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/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/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/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 diff --git a/.github/workflows/firewood-ab-test.yaml b/.github/workflows/firewood-ab-test.yaml new file mode 100644 index 000000000000..2ef673ee1fe3 --- /dev/null +++ b/.github/workflows/firewood-ab-test.yaml @@ -0,0 +1,77 @@ +name: Firewood A/B Test + +on: + workflow_dispatch: + inputs: + firewood-version: + description: 'Firewood version (commit, branch, tag, or ffi/vX.Y.Z)' + required: true + default: 'composable-ci-action' + coreth-version: + description: 'Coreth version (optional)' + required: false + default: '' + task-name: + description: 'Reexecution task to run' + required: true + default: 'c-chain-reexecution-firewood-101-250k' + type: choice + options: + - c-chain-reexecution-firewood-101-250k + - c-chain-reexecution-firewood-33m-33m500k + - c-chain-reexecution-firewood-33m-40m + runner: + description: 'GitHub runner type' + required: true + +env: + AVALANCHEGO_CHECKOUT_PATH: '.' + FIREWOOD_WORKSPACE_PATH: '${{ github.workspace }}/firewood-workspace' + +jobs: + test: + runs-on: ${{ inputs.runner }} + timeout-minutes: 180 + permissions: + id-token: write + contents: write + steps: + - name: Checkout AvalancheGo + uses: actions/checkout@v4 + + - name: Setup AvalancheGo with Custom Firewood + uses: ./.github/actions/avalanchego-setup-action + with: + checkout-path: ${{ env.AVALANCHEGO_CHECKOUT_PATH }} + avalanchego: ${{ github.ref_name }} + firewood: ${{ inputs.firewood-version }} + firewood-path: ${{ env.FIREWOOD_WORKSPACE_PATH }} + coreth: ${{ inputs.coreth-version }} + + - name: Run C-Chain Reexecution Benchmark + uses: ./.github/actions/c-chain-reexecution-benchmark + with: + task: ${{ inputs.task-name }} + runner_name: ${{ inputs.runner }} + aws-role: ${{ secrets.AWS_S3_READ_ONLY_ROLE }} + aws-region: 'us-east-2' + prometheus-url: ${{ secrets.PROMETHEUS_URL || '' }} + prometheus-push-url: ${{ secrets.PROMETHEUS_PUSH_URL || '' }} + prometheus-username: ${{ secrets.PROMETHEUS_USERNAME || '' }} + prometheus-password: ${{ secrets.PROMETHEUS_PASSWORD || '' }} + github-token: ${{ secrets.GITHUB_TOKEN }} + push-github-action-benchmark: false + + - name: Upload benchmark output + if: always() + uses: actions/upload-artifact@v4 + with: + name: benchmark-output-${{ inputs.task-name }}-${{ github.run_id }} + path: | + benchmark-output.txt + **/*.log + **/*.prof + /tmp/reexecution-data-*/**/*.log + retention-days: 7 + if-no-files-found: ignore + From c32a622919da620e0ab9537890fd1a36a0922af1 Mon Sep 17 00:00:00 2001 From: "Elvis S." Date: Thu, 13 Nov 2025 16:34:13 +0400 Subject: [PATCH 64/69] run on pull request --- .github/workflows/firewood-ab-test.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/firewood-ab-test.yaml b/.github/workflows/firewood-ab-test.yaml index 2ef673ee1fe3..b5c27225be2e 100644 --- a/.github/workflows/firewood-ab-test.yaml +++ b/.github/workflows/firewood-ab-test.yaml @@ -1,6 +1,7 @@ name: Firewood A/B Test on: + pull_request: workflow_dispatch: inputs: firewood-version: From 8fd517e9d58c02ea8a4aaeb014e0ebba00e6e51d Mon Sep 17 00:00:00 2001 From: "Elvis S." Date: Thu, 13 Nov 2025 16:36:00 +0400 Subject: [PATCH 65/69] t --- .github/workflows/c-chain-reexecution-benchmark-container.yml | 2 +- .github/workflows/c-chain-reexecution-benchmark-gh-native.yml | 2 +- .github/workflows/firewood-ab-test.yaml | 1 - 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/c-chain-reexecution-benchmark-container.yml b/.github/workflows/c-chain-reexecution-benchmark-container.yml index 83f0d16bd560..115975a35324 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 d84033ee5232..1c57de5fe389 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/firewood-ab-test.yaml b/.github/workflows/firewood-ab-test.yaml index b5c27225be2e..2ef673ee1fe3 100644 --- a/.github/workflows/firewood-ab-test.yaml +++ b/.github/workflows/firewood-ab-test.yaml @@ -1,7 +1,6 @@ name: Firewood A/B Test on: - pull_request: workflow_dispatch: inputs: firewood-version: From e51f0fd8711c4d5267033287294d43fd2103ecac Mon Sep 17 00:00:00 2001 From: "Elvis S." Date: Thu, 13 Nov 2025 17:01:40 +0400 Subject: [PATCH 66/69] stash changes --- .github/actions/c-chain-reexecution-benchmark/action.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/actions/c-chain-reexecution-benchmark/action.yml b/.github/actions/c-chain-reexecution-benchmark/action.yml index 6217ba3824d3..25bc95f377f7 100644 --- a/.github/actions/c-chain-reexecution-benchmark/action.yml +++ b/.github/actions/c-chain-reexecution-benchmark/action.yml @@ -180,6 +180,10 @@ runs: GH_RUN_NUMBER: ${{ inputs.run_number }} GH_RUN_ATTEMPT: ${{ inputs.run_attempt }} GH_JOB_ID: ${{ inputs.job }} + - name: Stash local changes before benchmark comparison + shell: bash + run: | + git stash --include-untracked || true - name: Compare Benchmark Results uses: benchmark-action/github-action-benchmark@v1 with: From b689bd33eb851c3825a3805ddcae5275d799fea6 Mon Sep 17 00:00:00 2001 From: "Elvis S." Date: Thu, 13 Nov 2025 17:11:53 +0400 Subject: [PATCH 67/69] fix --- .../c-chain-reexecution-benchmark/action.yml | 15 +++++++++++++++ .../output-metrics-url.sh | 6 ++++++ 2 files changed, 21 insertions(+) diff --git a/.github/actions/c-chain-reexecution-benchmark/action.yml b/.github/actions/c-chain-reexecution-benchmark/action.yml index 25bc95f377f7..35d3452bb133 100644 --- a/.github/actions/c-chain-reexecution-benchmark/action.yml +++ b/.github/actions/c-chain-reexecution-benchmark/action.yml @@ -81,6 +81,14 @@ inputs: job: default: ${{ github.job }} +outputs: + metrics-from-timestamp: + description: 'Start timestamp for metrics monitoring (in seconds)' + value: ${{ steps.export-metrics-timestamps.outputs.from-timestamp }} + metrics-to-timestamp: + description: 'End timestamp for metrics monitoring (in seconds)' + value: ${{ steps.export-metrics-timestamps.outputs.to-timestamp }} + runs: using: composite steps: @@ -116,6 +124,13 @@ runs: env: GRAFANA_URL: https://grafana-poc.avax-dev.network/d/Gl1I20mnk/c-chain?orgId=1&refresh=10s&var-filter=is_ephemeral_node%7C%3D%7Cfalse&var-filter=gh_repo%7C%3D%7C${{ inputs.repository_owner }}%2F${{ inputs.repository_name }}&var-filter=gh_run_id%7C%3D%7C${{ inputs.run_id }}&var-filter=gh_run_attempt%7C%3D%7C${{ inputs.run_attempt }} GH_JOB_ID: ${{ inputs.job }} + - name: Export metrics timestamps + id: export-metrics-timestamps + if: inputs.prometheus-username != '' + shell: bash + run: | + echo "from-timestamp=${METRICS_FROM_TIMESTAMP}" >> "$GITHUB_OUTPUT" + echo "to-timestamp=${METRICS_TO_TIMESTAMP}" >> "$GITHUB_OUTPUT" - name: Warn that collection of metrics and logs will not be performed if: inputs.prometheus-username == '' shell: bash diff --git a/.github/actions/c-chain-reexecution-benchmark/output-metrics-url.sh b/.github/actions/c-chain-reexecution-benchmark/output-metrics-url.sh index 875f7d7fdb8d..e08d2507c2e1 100755 --- a/.github/actions/c-chain-reexecution-benchmark/output-metrics-url.sh +++ b/.github/actions/c-chain-reexecution-benchmark/output-metrics-url.sh @@ -11,6 +11,12 @@ from_timestamp="$(date '+%s')" monitoring_period=900 # 15 minutes to_timestamp="$((from_timestamp + monitoring_period))" +# Export timestamps to GitHub environment +if [ -n "${GITHUB_ENV:-}" ]; then + echo "METRICS_FROM_TIMESTAMP=${from_timestamp}" >> "$GITHUB_ENV" + echo "METRICS_TO_TIMESTAMP=${to_timestamp}" >> "$GITHUB_ENV" +fi + # Grafana expects microseconds, so pad timestamps with 3 zeros metrics_url="${GRAFANA_URL}&var-filter=gh_job_id%7C%3D%7C${GH_JOB_ID}&from=${from_timestamp}000&to=${to_timestamp}000" From 2a69c0e614fd343f72c214ae9886aae5a8b16821 Mon Sep 17 00:00:00 2001 From: "Elvis S." Date: Thu, 20 Nov 2025 12:50:44 +0400 Subject: [PATCH 68/69] ci: support only self-hosted --- .github/workflows/firewood-ab-test.yaml | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/.github/workflows/firewood-ab-test.yaml b/.github/workflows/firewood-ab-test.yaml index 2ef673ee1fe3..3b0052f88beb 100644 --- a/.github/workflows/firewood-ab-test.yaml +++ b/.github/workflows/firewood-ab-test.yaml @@ -31,14 +31,23 @@ env: jobs: test: runs-on: ${{ inputs.runner }} + container: + image: ghcr.io/actions/actions-runner:2.325.0 timeout-minutes: 180 permissions: id-token: write contents: write steps: + - name: Install dependencies + shell: bash + # The xz-utils might be present on some containers + run: | + if ! command -v xz &> /dev/null; then + sudo apt-get update + sudo apt-get install -y xz-utils + fi - name: Checkout AvalancheGo uses: actions/checkout@v4 - - name: Setup AvalancheGo with Custom Firewood uses: ./.github/actions/avalanchego-setup-action with: @@ -47,7 +56,6 @@ jobs: firewood: ${{ inputs.firewood-version }} firewood-path: ${{ env.FIREWOOD_WORKSPACE_PATH }} coreth: ${{ inputs.coreth-version }} - - name: Run C-Chain Reexecution Benchmark uses: ./.github/actions/c-chain-reexecution-benchmark with: @@ -61,7 +69,6 @@ jobs: prometheus-password: ${{ secrets.PROMETHEUS_PASSWORD || '' }} github-token: ${{ secrets.GITHUB_TOKEN }} push-github-action-benchmark: false - - name: Upload benchmark output if: always() uses: actions/upload-artifact@v4 From 665eaf842a88e0e931214470885f90af6d838a75 Mon Sep 17 00:00:00 2001 From: "Elvis S." Date: Thu, 20 Nov 2025 12:56:02 +0400 Subject: [PATCH 69/69] ci: setup go --- .github/workflows/firewood-ab-test.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/firewood-ab-test.yaml b/.github/workflows/firewood-ab-test.yaml index 3b0052f88beb..cbff57cc8af9 100644 --- a/.github/workflows/firewood-ab-test.yaml +++ b/.github/workflows/firewood-ab-test.yaml @@ -48,6 +48,7 @@ jobs: fi - name: Checkout AvalancheGo uses: actions/checkout@v4 + - uses: ./.github/actions/setup-go-for-project - name: Setup AvalancheGo with Custom Firewood uses: ./.github/actions/avalanchego-setup-action with: