Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
d0155dd
ci(c-chain-reexecution-firewood)
Elvis339 Dec 3, 2025
e851903
lint
Elvis339 Dec 3, 2025
49b7fc3
Merge branch 'master' into es/enable-firewood-dev-workflow
Elvis339 Dec 4, 2025
2feeda4
Merge branch 'master' into es/enable-firewood-dev-workflow
Elvis339 Dec 8, 2025
6f21231
ci(firewood-benchmark): try go get first, fall back to Nix on failure
Elvis339 Dec 9, 2025
b3cc8ed
Merge branch 'es/enable-firewood-dev-workflow' of github.com:ava-labs…
Elvis339 Dec 9, 2025
e437658
refactor(build-firewood): move default config to script, simplify task
Elvis339 Dec 9, 2025
15b52ee
ci(firewood-benchmark): test workflow without the commit step
Elvis339 Dec 9, 2025
999c3f4
Merge branch 'master' into es/enable-firewood-dev-workflow
Elvis339 Dec 9, 2025
34a331f
Merge branch 'master' into es/enable-firewood-dev-workflow
Elvis339 Dec 10, 2025
cb5e59a
ci(c-chain-reexecution): add custom firewood/libevm support to reexec…
Elvis339 Dec 12, 2025
e0e784b
Merge branch 'es/enable-firewood-dev-workflow' of github.com:ava-labs…
Elvis339 Dec 12, 2025
cab333e
fix(c-chain-reexecution): add nix build env vars for self-hosted runners
Elvis339 Dec 12, 2025
c131420
lint(c-chain-reexecution): set 10 input params per gh workflow limit
Elvis339 Dec 15, 2025
f79c8d5
docs
Elvis339 Dec 15, 2025
c4561be
Merge branch 'master' into es/enable-firewood-dev-workflow
Elvis339 Dec 15, 2025
a89c44e
ci(c-chain-reexecution): skip benchmark comparison for custom firewoo…
Elvis339 Dec 15, 2025
d428155
ci(c-chain-reexecution): rename libevm and firewood inputs to libevm-…
Elvis339 Dec 15, 2025
87b3d4c
docs
Elvis339 Dec 15, 2025
6f5502b
Merge branch 'master' into es/enable-firewood-dev-workflow
Elvis339 Dec 15, 2025
6493598
ci(c-chain-reexecution): clarify firewood-ref skips benchmark comparison
Elvis339 Dec 15, 2025
0451870
Merge branch 'master' into es/enable-firewood-dev-workflow
Elvis339 Dec 16, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .github/actions/c-chain-reexecution-benchmark/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,12 @@ inputs:
push-post-state:
description: 'S3 destination to copy the current-state directory after completing re-execution. If empty, this will be skipped.'
default: ''
libevm-ref:
description: 'libevm commit/branch/tag (optional). If provided, updates libevm dependency before benchmark.'
default: ''
firewood-ref:
description: 'Firewood commit/branch/tag (optional). If provided, builds custom firewood and skips benchmark comparison (Firewood tracks separately).'
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.
Expand Down Expand Up @@ -154,11 +160,15 @@ runs:
if [[ -n "${{ inputs.task }}" ]]; then
# Task-based approach
./scripts/run_task.sh ${{ inputs.task }} \
LIBEVM_REF="${{ inputs.libevm-ref }}" \
FIREWOOD_REF="${{ inputs.firewood-ref }}" \
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 \
LIBEVM_REF="${{ inputs.libevm-ref }}" \
FIREWOOD_REF="${{ inputs.firewood-ref }}" \
CONFIG=${{ inputs.config }} \
EXECUTION_DATA_DIR=${{ env.EXECUTION_DATA_DIR }} \
BLOCK_DIR_SRC=${{ inputs.block-dir-src }} \
Expand All @@ -180,7 +190,13 @@ runs:
GH_RUN_NUMBER: ${{ inputs.run_number }}
GH_RUN_ATTEMPT: ${{ inputs.run_attempt }}
GH_JOB_ID: ${{ inputs.job }}
# Required for Nix builds in CI self-hosted runners (e.g., building Firewood via polyrepo)
TMPDIR: /tmp
NIX_BUILD_TOP: /tmp
# Skip when using custom firewood - Firewood downloads the artifact and
# publishes to their own gh-pages for tracking
- name: Compare Benchmark Results
if: inputs.firewood-ref == ''
uses: benchmark-action/github-action-benchmark@v1
with:
tool: 'go'
Expand Down
27 changes: 20 additions & 7 deletions .github/workflows/c-chain-reexecution-benchmark-container.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,15 @@ on:
runner:
description: 'Runner to execute the benchmark. Input to the runs-on field of the job.'
required: true
push-post-state:
Copy link
Contributor

Choose a reason for hiding this comment

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

I see that the job definitions have been updated to use a matrix field instead of this import parameter, what are the implications of this change?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The main implication is that push-post-state can't be set from manual workflow_dispatch anymore you'd have to add it to the JSON config file instead.

Scheduled runs still work fine since they read from the JSON anyway.

We had to make this trade-off because GitHub has a 10 input limit for workflow_dispatch, and we needed room for firewood-ref and libevm-ref. Figured those are more useful for manual runs (testing custom versions), while push-post-state is typically used in scheduled/automated runs anyway.

If you ever need to manually push state after a run, you can still do it with:

task export-dir-to-s3 SRC=/path/to/current-state DST=s3://bucket/destination

Copy link
Contributor

Choose a reason for hiding this comment

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

@aaronbuchwald Thoughts?

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.'
default: 30
firewood-ref:
description: 'Firewood commit/branch/tag (optional). Builds custom firewood and skips benchmark comparison (Firewood tracks separately).'
default: ''
libevm-ref:
description: 'libevm commit/branch/tag (optional). If provided, updates libevm dependency.'
default: ''

# Disabled because scheduled trigger is empty. To enable, uncomment and add at least one vector to the schedule
# entry in the corresponding JSON file.
Expand Down Expand Up @@ -82,8 +85,6 @@ jobs:
id-token: write
contents: write
runs-on: ${{ matrix.runner }}
container:
image: ghcr.io/actions/actions-runner:2.325.0
steps:
- uses: actions/checkout@v4
- name: Install ARC Dependencies
Expand All @@ -103,13 +104,25 @@ jobs:
end-block: ${{ matrix.end-block }}
block-dir-src: ${{ matrix.block-dir-src }}
current-state-dir-src: ${{ matrix.current-state-dir-src }}
libevm-ref: ${{ inputs.libevm-ref }}
firewood-ref: ${{ inputs.firewood-ref }}
prometheus-url: ${{ secrets.PROMETHEUS_URL || '' }}
prometheus-push-url: ${{ secrets.PROMETHEUS_PUSH_URL || '' }}
prometheus-username: ${{ secrets.PROMETHEUS_USERNAME || '' }}
prometheus-password: ${{ secrets.PROMETHEUS_PASSWORD || '' }}
push-github-action-benchmark: ${{ github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && github.repository == 'ava-labs/avalanchego' && github.ref_name == 'master') }}
aws-role: ${{ github.event.inputs.push-post-state != '' && secrets.AWS_S3_RW_ROLE || secrets.AWS_S3_READ_ONLY_ROLE }}
aws-role: ${{ matrix.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 }}
push-post-state: ${{ matrix.push-post-state || '' }}
runner_name: ${{ matrix.runner }}
- name: Upload benchmark results
# Only upload when using custom firewood - Firewood downloads the artifact
# and publishes to their own gh-pages for tracking
if: inputs.firewood-ref != ''
uses: actions/upload-artifact@v4
with:
name: benchmark-output
path: ${{ github.workspace }}/benchmark-output.txt
retention-days: 30
if-no-files-found: error
25 changes: 20 additions & 5 deletions .github/workflows/c-chain-reexecution-benchmark-gh-native.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,15 @@ on:
runner:
description: 'Runner to execute the benchmark. Input to the runs-on field of the job.'
required: true
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.'
default: 30
firewood-ref:
description: 'Firewood commit/branch/tag (optional). Builds custom firewood and skips benchmark comparison (Firewood tracks separately).'
default: ''
libevm-ref:
description: 'libevm commit/branch/tag (optional). If provided, updates libevm dependency.'
default: ''

# Disabled because scheduled trigger is empty. To enable, uncomment and add at least one vector to the schedule
# entry in the corresponding JSON file.
Expand Down Expand Up @@ -93,13 +96,25 @@ jobs:
end-block: ${{ matrix.end-block }}
block-dir-src: ${{ matrix.block-dir-src }}
current-state-dir-src: ${{ matrix.current-state-dir-src }}
libevm-ref: ${{ inputs.libevm-ref }}
firewood-ref: ${{ inputs.firewood-ref }}
prometheus-url: ${{ secrets.PROMETHEUS_URL || '' }}
prometheus-push-url: ${{ secrets.PROMETHEUS_PUSH_URL || '' }}
prometheus-username: ${{ secrets.PROMETHEUS_USERNAME || '' }}
prometheus-password: ${{ secrets.PROMETHEUS_PASSWORD || '' }}
push-github-action-benchmark: ${{ github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && github.repository == 'ava-labs/avalanchego' && github.ref_name == 'master') }}
aws-role: ${{ github.event.inputs.push-post-state != '' && secrets.AWS_S3_RW_ROLE || secrets.AWS_S3_READ_ONLY_ROLE }}
aws-role: ${{ matrix.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 }}
push-post-state: ${{ matrix.push-post-state || '' }}
runner_name: ${{ matrix.runner }}
- name: Upload benchmark results
# Only upload when using custom firewood - Firewood downloads the artifact
# and publishes to their own gh-pages for tracking
if: inputs.firewood-ref != ''
uses: actions/upload-artifact@v4
with:
name: benchmark-output
path: ${{ github.workspace }}/benchmark-output.txt
retention-days: 30
if-no-files-found: error
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -66,5 +66,9 @@ vendor
# debug files
__debug_*

# polyrepo
polyrepo.log
firewood

# solc downloads from setup-solc GitHub Action
setup-solc_downloads/
24 changes: 24 additions & 0 deletions Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,19 @@ tasks:

reexecute-cchain-range-with-copied-data:
desc: Combines import-cchain-reexecute-range and reexecute-cchain-range
summary: |
Optionally accepts LIBEVM_REF and FIREWOOD_REF to test with custom versions.
If not provided, uses versions from go.mod.

Examples:
# Use go.mod versions
task c-chain-reexecution-firewood-101-250k

# Use custom firewood
task c-chain-reexecution-firewood-101-250k FIREWOOD_REF=abc123

# Use custom both
task c-chain-reexecution-firewood-101-250k FIREWOOD_REF=abc123 LIBEVM_REF=v1.2.3
vars:
TASK_NAME: '{{.TASK_NAME}}'
BLOCK_DIR_SRC: '{{.BLOCK_DIR_SRC}}'
Expand All @@ -243,6 +256,17 @@ tasks:
TIMESTAMP: '{{.TIMESTAMP | default (now | date "20060102-150405")}}'
EXECUTION_DATA_DIR: '{{.EXECUTION_DATA_DIR | default (printf "/tmp/%s-%s" .TASK_NAME .TIMESTAMP)}}'
cmds:
- cmd: |
if [[ -n "{{.LIBEVM_REF}}" ]]; then
echo "Updating libevm to: {{.LIBEVM_REF}}"
go get github.com/ava-labs/libevm@{{.LIBEVM_REF}}
cd graft/coreth && go get github.com/ava-labs/libevm@{{.LIBEVM_REF}}
fi
- cmd: |
if [[ -n "{{.FIREWOOD_REF}}" && "{{.CONFIG}}" == "firewood" ]]; then
echo "Setting up firewood at: {{.FIREWOOD_REF}}"
./scripts/run_polyrepo.sh sync firewood@{{.FIREWOOD_REF}} --force
fi
- task: import-cchain-reexecute-range
vars:
BLOCK_DIR_SRC: '{{.S3_BOOTSTRAP_BUCKET}}/{{.BLOCK_DIR_SRC}}/**'
Expand Down
7 changes: 7 additions & 0 deletions scripts/run_polyrepo.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env bash

set -euo pipefail

POLYREPO_REVISION=6239973c9b
echo "Running polyrepo@${POLYREPO_REVISION} via go run..."
go run github.com/ava-labs/avalanchego/tests/fixture/polyrepo@"${POLYREPO_REVISION}" "${@}"
52 changes: 52 additions & 0 deletions tests/reexecute/c/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,39 @@ To execute a benchmark with any of these options, you must use a compatible `CUR

The `CONFIG` parameter currently only supports pre-defined configs and not passing a full JSON blob in, so that we can define corresponding names for each config option. The config name is attached as a label to the exported metrics and included in the name of the sub-benchmark (used by GitHub Action Benchmark to separate historical results with different configs).

## Testing with Custom Dependency Versions

The benchmarks support testing with custom versions of `libevm` and `firewood` dependencies. This is useful for:
- Testing unreleased versions before merging
- Benchmarking performance changes in dependencies
- Reproducing issues with specific dependency versions

### Local Usage

**Prerequisite**: You must be in a nix shell (`nix develop`) to run benchmark tasks (`c-chain-reexecution-*`) .

Pass `LIBEVM_REF` and/or `FIREWOOD_REF` to any benchmark task:

```bash
# Test with custom firewood version
./scripts/run_task.sh c-chain-reexecution-firewood-101-250k FIREWOOD_REF=abc123def

# Test with custom libevm version
./scripts/run_task.sh c-chain-reexecution-firewood-101-250k LIBEVM_REF=v1.2.3

# Test with both custom versions
./scripts/run_task.sh c-chain-reexecution-firewood-101-250k \
FIREWOOD_REF=abc123def \
LIBEVM_REF=v1.2.3
```

**Note**: `FIREWOOD_REF` only takes effect when `CONFIG=firewood`. For hashdb benchmarks, it will be ignored.

### How It Works

- **`LIBEVM_REF`**: Runs `go get github.com/ava-labs/libevm@<ref>` to update the dependency
- **`FIREWOOD_REF`**: Uses [polyrepo](../../../scripts/run_polyrepo.sh) to clone, build (via Nix), and configure firewood at the specified ref

## Metrics

The C-Chain benchmarks export VM metrics to the same Grafana instance as AvalancheGo CI: https://grafana-poc.avax-dev.network/.
Expand Down Expand Up @@ -320,6 +353,25 @@ gh workflow run "C-Chain Re-Execution Benchmark GH Native" \
-f timeout-minutes=60
```

### Using Custom Dependency Versions

```bash
# Test with custom firewood commit
gh workflow run "C-Chain Re-Execution Benchmark GH Native" \
-f task=c-chain-reexecution-firewood-101-250k \
-f firewood-ref=abc123def \
-f runner=blacksmith-4vcpu-ubuntu-2404 \
-f timeout-minutes=60

# Test with custom libevm and firewood
gh workflow run "C-Chain Re-Execution Benchmark GH Native" \
-f task=c-chain-reexecution-firewood-101-250k \
-f libevm-ref=v1.2.3 \
-f firewood-ref=abc123def \
-f runner=blacksmith-4vcpu-ubuntu-2404 \
-f timeout-minutes=60
```

### Using Custom Parameters

```bash
Expand Down