Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
62 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
8cf656d
Merge branch 'master' into es/enable-firewood-dev-workflow
Elvis339 Dec 19, 2025
cfe4960
lint
Elvis339 Dec 20, 2025
1416e52
refactor(ci): combine dep refs into 'with' input, restore push-post-s…
Elvis339 Dec 20, 2025
0a7185a
Merge branch 'master' into es/enable-firewood-dev-workflow
Elvis339 Dec 20, 2025
48bdef7
Merge branch 'master' into es/enable-firewood-dev-workflow
Elvis339 Dec 23, 2025
279e120
Merge branch 'master' into es/enable-firewood-dev-workflow
Elvis339 Dec 23, 2025
325e42b
Merge branch 'es/enable-firewood-dev-workflow' of github.com:ava-labs…
Elvis339 Dec 23, 2025
a2d7b8c
Merge branch 'master' into es/enable-firewood-dev-workflow
Elvis339 Dec 29, 2025
73d4057
ci(c-chain-reexecution): rename 'with' input to 'with-dependencies' f…
Elvis339 Dec 30, 2025
4c4d3eb
ci(c-chain-reexecution): reduce diff caused by workflow inputs order
Elvis339 Dec 30, 2025
af62634
Merge branch 'es/enable-firewood-dev-workflow' of github.com:ava-labs…
Elvis339 Dec 30, 2025
b81d12f
docs
Elvis339 Dec 30, 2025
2ecec16
ci(reexecution): support genesis start by making state-dir optional
Elvis339 Dec 30, 2025
cd4a9d7
feat(reexecution): support genesis start for c-chain benchmarks
Elvis339 Dec 30, 2025
1ef0920
Merge branch 'master' into es/enable-firewood-dev-workflow
Elvis339 Jan 2, 2026
05c1b8d
chore(Taskfile): define global genesis sentinel value for c-chain-ree…
Elvis339 Jan 2, 2026
e1be9e1
docs
Elvis339 Jan 2, 2026
5426ee8
Merge branch 'master' into es/enable-firewood-dev-workflow
Elvis339 Jan 5, 2026
2b86559
Merge branch 'master' into es/enable-firewood-dev-workflow
Elvis339 Jan 6, 2026
90fd09a
Merge branch 'es/enable-firewood-dev-workflow' of github.com:ava-labs…
Elvis339 Jan 6, 2026
73c876e
Merge branch 'master' into es/enable-firewood-dev-workflow
Elvis339 Jan 6, 2026
a92e465
ci(c-chain-reexecution): remove unused libevm and firewood refs from …
Elvis339 Jan 21, 2026
81b88b6
chore(Taskfile): add `setup-reexecution-deps` task to configure depen…
Elvis339 Jan 21, 2026
6f944d1
ci(c-chain-reexecution): add `setup-reexecution-deps` step, improve i…
Elvis339 Jan 21, 2026
8a92625
docs
Elvis339 Jan 21, 2026
db41178
Merge branch 'master' into es/enable-firewood-dev-workflow
Elvis339 Jan 21, 2026
f410444
ci(c-chain-reexecution): unique artifact upload name
Elvis339 Jan 21, 2026
d619a21
ci(c-chain-reexecution): unique name
Elvis339 Jan 21, 2026
954121b
refactor(scripts): consolidate dep setup into run_polyrepo.sh
Elvis339 Jan 22, 2026
d9b2717
docs:
Elvis339 Jan 22, 2026
6076c4f
refactor(ci): simplify dependency configuration for benchmarks
Elvis339 Jan 22, 2026
221157a
fix(ci): Simplify artifact name to test + runner_type (sufficient for…
Elvis339 Jan 22, 2026
6aef9df
fix(ci): Simplify artifact name to test + runner_type (sufficient for…
Elvis339 Jan 22, 2026
c28cd33
lint
Elvis339 Jan 22, 2026
2ac5157
fix(reexecution-container): add tmpdir and nix build top to tmp fixin…
Elvis339 Jan 22, 2026
1f06a14
refactor(ci): simplify dependency setup in reexecution benchmarks
Elvis339 Jan 22, 2026
6ad2f13
lint
Elvis339 Jan 22, 2026
e3ab8ad
fix(ci): skip benchmark comparison when using custom dependencies
Elvis339 Jan 22, 2026
01da31a
fix(ci): skip benchmark comparison when custom deps modify go.mod
Elvis339 Jan 22, 2026
e463b6a
fix(ci): add skip-benchmark-comparison input for custom deps
Elvis339 Jan 22, 2026
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
13 changes: 13 additions & 0 deletions .github/actions/c-chain-reexecution-benchmark/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ inputs:
push-github-action-benchmark:
description: 'Whether to push the benchmark result to GitHub.'
required: true
skip-benchmark-comparison:
Copy link
Contributor Author

Choose a reason for hiding this comment

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

When custom dependencies (firewood-ref or libevm-ref) are used,
go.mod/go.sum are modified. This causes github-action-benchmark
to fail when checking out gh-pages.

New input skips comparison step only when custom deps are present,
preserving summary display for normal PR runs.

Copy link
Contributor

Choose a reason for hiding this comment

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

Would it make sense to make this skip automatic with an appropriate warning if the tree is dirty?

description: 'Skip benchmark comparison step (required when custom deps modify go.mod).'
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: ''
Expand Down Expand Up @@ -152,7 +155,17 @@ runs:
GH_RUN_NUMBER: ${{ inputs.run-number }}
GH_RUN_ATTEMPT: ${{ inputs.run-attempt }}
GH_JOB_ID: ${{ inputs.job }}
# Required for Nix builds on self-hosted runners
TMPDIR: /tmp
NIX_BUILD_TOP: /tmp
- name: Upload Benchmark Artifact
uses: actions/upload-artifact@v4
with:
name: benchmark-output-${{ inputs.test }}-${{ inputs.runner_type }}
path: ${{ env.BENCHMARK_OUTPUT_FILE }}
if-no-files-found: error
- name: Compare Benchmark Results
if: inputs.skip-benchmark-comparison != 'true'
uses: benchmark-action/github-action-benchmark@v1
with:
tool: 'customBiggerIsBetter'
Expand Down
31 changes: 26 additions & 5 deletions .github/workflows/c-chain-reexecution-benchmark-container.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ on:
timeout-minutes:
description: 'Timeout in minutes for the job.'
default: 30
with-dependencies:
description: 'Dependencies to use (e.g., "firewood=abc123" or "firewood=abc,libevm=xyz")'
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 All @@ -49,17 +52,22 @@ jobs:
shell: bash -x {0}
run: |
if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
FIREWOOD_REF="" LIBEVM_REF=""
[[ "${{ github.event.inputs.with-dependencies }}" =~ firewood=([^,]+) ]] && FIREWOOD_REF="${BASH_REMATCH[1]}"
[[ "${{ github.event.inputs.with-dependencies }}" =~ libevm=([^,]+) ]] && LIBEVM_REF="${BASH_REMATCH[1]}"
{
echo "matrix<<EOF"
printf '{ "include": [{ "test": "%s", "start-block": "%s", "end-block": "%s", "block-dir-src": "%s", "current-state-dir-src": "%s", "config": "%s", "runner": "%s", "timeout-minutes": %s }] }\n' \
printf '{ "include": [{ "test": "%s", "start-block": "%s", "end-block": "%s", "block-dir-src": "%s", "current-state-dir-src": "%s", "config": "%s", "runner": "%s", "timeout-minutes": %s, "firewood-ref": "%s", "libevm-ref": "%s" }] }\n' \
"${{ github.event.inputs.test }}" \
"${{ github.event.inputs.start-block }}" \
"${{ github.event.inputs.end-block }}" \
"${{ github.event.inputs.block-dir-src }}" \
"${{ github.event.inputs.current-state-dir-src }}" \
"${{ github.event.inputs.config }}" \
"${{ github.event.inputs.runner }}" \
"${{ github.event.inputs.timeout-minutes }}"
"${{ github.event.inputs.timeout-minutes }}" \
"$FIREWOOD_REF" \
"$LIBEVM_REF"
echo EOF
} >> "$GITHUB_OUTPUT"
else
Expand All @@ -82,8 +90,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 @@ -94,6 +100,20 @@ jobs:
sudo apt-get update
sudo apt-get install -y xz-utils
fi
- name: Install Nix
if: matrix.libevm-ref != '' || matrix.firewood-ref != ''
uses: cachix/install-nix-action@02a151ada4993995686f9ed4f1be7cfbb229e56f #v31
with:
github_access_token: ${{ secrets.GITHUB_TOKEN }}
- name: Configure dependency versions
if: matrix.libevm-ref != '' || matrix.firewood-ref != ''
shell: nix develop --command bash {0}
run: ./scripts/run_task.sh polyrepo -- ${{ matrix.firewood-ref != '' && format('sync firewood@{0}', matrix.firewood-ref) || '' }}
env:
LIBEVM_REF: ${{ matrix.libevm-ref }}
# Required for Nix builds on ARC runners
TMPDIR: /tmp
NIX_BUILD_TOP: /tmp
- name: Run C-Chain Re-Execution Benchmark
uses: ./.github/actions/c-chain-reexecution-benchmark
with:
Expand All @@ -107,7 +127,8 @@ jobs:
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') }}
push-github-action-benchmark: ${{ (github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && github.repository == 'ava-labs/avalanchego' && github.ref_name == 'master')) && matrix.firewood-ref == '' }}
skip-benchmark-comparison: ${{ matrix.firewood-ref != '' || matrix.libevm-ref != '' }}
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 }}
Expand Down
27 changes: 24 additions & 3 deletions .github/workflows/c-chain-reexecution-benchmark-gh-native.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ on:
timeout-minutes:
description: 'Timeout in minutes for the job.'
default: 30
with-dependencies:
description: 'Dependencies to use (e.g., "firewood=abc123" or "firewood=abc,libevm=xyz")'
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 All @@ -49,17 +52,23 @@ jobs:
shell: bash -x {0}
run: |
if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
# Parse 'with-dependencies' input for dependency refs
FIREWOOD_REF="" LIBEVM_REF=""
[[ "${{ github.event.inputs.with-dependencies }}" =~ firewood=([^,]+) ]] && FIREWOOD_REF="${BASH_REMATCH[1]}"
[[ "${{ github.event.inputs.with-dependencies }}" =~ libevm=([^,]+) ]] && LIBEVM_REF="${BASH_REMATCH[1]}"
{
echo "matrix<<EOF"
printf '{ "include": [{ "test": "%s", "start-block": "%s", "end-block": "%s", "block-dir-src": "%s", "current-state-dir-src": "%s", "config": "%s", "runner": "%s", "timeout-minutes": %s }] }\n' \
printf '{ "include": [{ "test": "%s", "start-block": "%s", "end-block": "%s", "block-dir-src": "%s", "current-state-dir-src": "%s", "config": "%s", "runner": "%s", "timeout-minutes": %s, "firewood-ref": "%s", "libevm-ref": "%s" }] }\n' \
"${{ github.event.inputs.test }}" \
"${{ github.event.inputs.start-block }}" \
"${{ github.event.inputs.end-block }}" \
"${{ github.event.inputs.block-dir-src }}" \
"${{ github.event.inputs.current-state-dir-src }}" \
"${{ github.event.inputs.config }}" \
"${{ github.event.inputs.runner }}" \
"${{ github.event.inputs.timeout-minutes }}"
"${{ github.event.inputs.timeout-minutes }}" \
"$FIREWOOD_REF" \
"$LIBEVM_REF"
echo EOF
} >> "$GITHUB_OUTPUT"
else
Expand All @@ -84,6 +93,17 @@ jobs:
runs-on: ${{ matrix.runner }}
steps:
- uses: actions/checkout@v4
- name: Install Nix
if: matrix.libevm-ref != '' || matrix.firewood-ref != ''
uses: cachix/install-nix-action@02a151ada4993995686f9ed4f1be7cfbb229e56f #v31
with:
github_access_token: ${{ secrets.GITHUB_TOKEN }}
- name: Configure dependency versions
if: matrix.libevm-ref != '' || matrix.firewood-ref != ''
shell: nix develop --command bash {0}
run: ./scripts/run_task.sh polyrepo -- ${{ matrix.firewood-ref != '' && format('sync firewood@{0}', matrix.firewood-ref) || '' }}
env:
LIBEVM_REF: ${{ matrix.libevm-ref }}
- name: Run C-Chain Re-Execution Benchmark
uses: ./.github/actions/c-chain-reexecution-benchmark
with:
Expand All @@ -97,7 +117,8 @@ jobs:
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') }}
push-github-action-benchmark: ${{ (github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && github.repository == 'ava-labs/avalanchego' && github.ref_name == 'master')) && matrix.firewood-ref == '' }}
skip-benchmark-comparison: ${{ matrix.firewood-ref != '' || matrix.libevm-ref != '' }}
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 }}
Expand Down
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/
4 changes: 4 additions & 0 deletions Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,10 @@ tasks:
desc: Runs shellcheck to check sanity of shell scripts
cmd: ./scripts/shellcheck.sh

polyrepo:
Copy link
Contributor

Choose a reason for hiding this comment

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

Please use an action name e.g. run-polyrepo.

desc: "Run polyrepo for orchestrating local dependencies. Example: LIBEVM_REF=v1.2.3 task polyrepo -- sync firewood@abc123"
cmd: ./scripts/run_polyrepo.sh {{.CLI_ARGS}}

setup-chain-data:
desc: Sets up C-Chain test data (blocks from S3, state from S3 or empty for genesis).
cmd: ./scripts/setup_cchain_data.sh
Expand Down
28 changes: 28 additions & 0 deletions scripts/run_polyrepo.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/usr/bin/env bash

set -euo pipefail

# Run polyrepo tool for managing local dependencies.
#
# Usage:
# ./scripts/run_polyrepo.sh [polyrepo args...]
#
# Environment variables (optional):
# LIBEVM_REF - Git ref for libevm (runs: go get && go mod tidy)
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe use env vars for both args so that the caller has a consistent way of specifying both values?

#
# Examples:
# ./scripts/run_polyrepo.sh sync firewood@abc123 # sync firewood
# ./scripts/run_polyrepo.sh status # check status
# LIBEVM_REF=v1.2.3 ./scripts/run_polyrepo.sh sync firewood@abc123 # both

POLYREPO_REVISION=6239973c9b

if [[ -n "${LIBEVM_REF:-}" ]]; then
echo "Updating libevm to ${LIBEVM_REF}..."
go get "github.com/ava-labs/libevm@${LIBEVM_REF}"
go mod tidy
fi

if [[ $# -gt 0 ]]; then
go run github.com/ava-labs/avalanchego/tests/fixture/polyrepo@"${POLYREPO_REVISION}" "${@}"
fi
64 changes: 64 additions & 0 deletions tests/reexecute/c/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,48 @@ 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`).

Use `run_polyrepo.sh` to set up custom dependencies:
- `LIBEVM_REF=<ref>` env var updates libevm via `go get`
- `sync firewood@<ref>` arg syncs firewood via polyrepo

```bash
Copy link
Contributor

Choose a reason for hiding this comment

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

(No action required) Maybe include a single example with both versions and document that both or either one can be provided? Same comment for the CI invocation examples.

Copy link
Contributor Author

@Elvis339 Elvis339 Jan 22, 2026

Choose a reason for hiding this comment

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

d9b2717

Edit: new commit, updated doc and how polyrepo is being ran 1f06a14

# Both libevm and firewood
LIBEVM_REF=v1.2.3 ./scripts/run_polyrepo.sh sync firewood@abc123def

# Only firewood
./scripts/run_polyrepo.sh sync firewood@abc123def

# Only libevm
LIBEVM_REF=v1.2.3 ./scripts/run_polyrepo.sh

# Then run the benchmark
./scripts/run_task.sh test-cchain-reexecution -- firewood-101-250k
```

### CI Usage

Use `with-dependencies` to specify custom versions. Either or both can be provided:

```bash
gh workflow run "C-Chain Re-Execution Benchmark GH Native" \
-f test=firewood-101-250k \
-f with-dependencies="firewood=abc123,libevm=v1.2.3" \
-f runner=blacksmith-4vcpu-ubuntu-2404
```

See [Trigger Workflow Dispatch with GitHub CLI](#trigger-workflow-dispatch-with-github-cli) for more examples.

## 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 @@ -323,6 +365,18 @@ gh workflow run "C-Chain Re-Execution Benchmark GH Native" \
-f timeout-minutes=60
```

### Using Custom Dependency Versions

Use `with-dependencies` to specify `firewood=<ref>` and/or `libevm=<ref>`:

```bash
gh workflow run "C-Chain Re-Execution Benchmark GH Native" \
-f test=firewood-101-250k \
-f with-dependencies="firewood=abc123def,libevm=v1.2.3" \
-f runner=blacksmith-4vcpu-ubuntu-2404 \
-f timeout-minutes=60
```

### Using Custom Parameters

```bash
Expand All @@ -335,3 +389,13 @@ gh workflow run "C-Chain Re-Execution Benchmark GH Native" \
-f runner=ubuntu-latest \
-f timeout-minutes=360
```

### Pushing Post-Execution State to S3

```bash
gh workflow run "C-Chain Re-Execution Benchmark GH Native" \
-f test=hashdb-101-250k \
-f runner=blacksmith-4vcpu-ubuntu-2404 \
-f push-post-state=s3://avalanchego-bootstrap-testing/cchain-current-state-new/ \
-f timeout-minutes=60
```
Loading