Skip to content
Open
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
64 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
dac5262
docs(ci): document Nix installation idempotency in reexec workflows
Elvis339 Jan 23, 2026
a29c22c
ci(reexecution): use env vars for custom dependency setup in reexec b…
Elvis339 Jan 23, 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
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,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 Down
139 changes: 139 additions & 0 deletions .github/workflows/c-chain-reexecution-benchmark-firewood.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
# Firewood Reexecution Benchmark
#
# This workflow runs C-Chain reexecution benchmarks with custom Firewood builds.
# It's designed to be triggered by the Firewood repository to track performance.
#
# Firewood input modes:
# - Versioned (v0.0.15): Uses `go get` to fetch published version (fast)
# - Branch/commit (main, abc123): Builds from source using Nix (slower)
#
# Results are uploaded as artifacts for Firewood to download and publish
# to their own GitHub Pages dashboard.

name: Firewood Reexecution Benchmark

on:
workflow_dispatch:
inputs:
firewood:
description: 'Firewood commit/branch/tag to build and test'
required: true
libevm:
description: 'libevm commit/branch/tag (optional)'
default: ''
task:
description: 'Taskfile task to execute (e.g., c-chain-reexecution-firewood-101-250k, if present custom inputs below are ignored)'
default: 'c-chain-reexecution-firewood-101-250k'
config:
default: ''
start-block:
default: ''
end-block:
default: ''
block-dir-src:
default: ''
current-state-dir-src:
default: ''
runner:
description: 'Runner to execute the benchmark. Input to the runs-on field of the job.'
required: true
push-post-state:
default: ''

jobs:
determine-build-type:
runs-on: ubuntu-latest
outputs:
from-source: ${{ steps.check.outputs.from-source }}
steps:
- name: Check Firewood input
id: check
run: |
# Semantic versions (vX.Y.Z) are published to Go module registry
# Branches/commits need to be built from source using Nix
if [[ "${{ inputs.firewood }}" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "from-source=false" >> "$GITHUB_OUTPUT"
echo "Firewood version detected: ${{ inputs.firewood }}"
else
echo "from-source=true" >> "$GITHUB_OUTPUT"
echo "Firewood branch/commit detected: ${{ inputs.firewood }}"
fi
c-chain-reexecution:
needs: determine-build-type
permissions:
id-token: write
contents: write
runs-on: ${{ inputs.runner }}
steps:
- uses: actions/checkout@v4
- name: Setup Go
uses: ./.github/actions/setup-go-for-project
- name: Install Nix dependencies
shell: bash
run: |
if ! command -v xz &> /dev/null; then
sudo apt-get update
sudo apt-get install -y xz-utils
fi
- name: Install Nix
if: needs.determine-build-type.outputs.from-source == 'true'
uses: cachix/install-nix-action@02a151ada4993995686f9ed4f1be7cfbb229e56f # v31
with:
github_access_token: ${{ secrets.GITHUB_TOKEN }}
- name: Update libevm
if: inputs.libevm != ''
shell: bash
run: |
echo "Updating libevm to: ${{ inputs.libevm }}"
go get github.com/ava-labs/libevm@${{ inputs.libevm }}
cd graft/coreth
go get github.com/ava-labs/libevm@${{ inputs.libevm }}
- name: Fetch Firewood (versioned)
if: needs.determine-build-type.outputs.from-source == 'false'
shell: bash
run: |
cd graft/coreth
echo "Fetching published Firewood: ${{ inputs.firewood }}"
go get github.com/ava-labs/firewood-go-ethhash/ffi@${{ inputs.firewood }}
- name: Build Firewood (from source)
if: needs.determine-build-type.outputs.from-source == 'true'
shell: bash
run: ./scripts/run_task.sh build-firewood FIREWOOD_REF="${{ inputs.firewood }}" DIRTY=true
env:
TMPDIR: /tmp
NIX_BUILD_TOP: /tmp
# Commit go.mod changes locally to keep working tree clean
# (required for github-action-benchmark branch switching)
- name: Commit go.mod changes
shell: bash
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add go.mod go.sum graft/coreth/go.mod graft/coreth/go.sum
git diff --staged --quiet || git commit -m "temp: Firewood/libevm for benchmark"
- name: Run C-Chain Re-Execution Benchmark
uses: ./.github/actions/c-chain-reexecution-benchmark
with:
task: ${{ inputs.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 || '' }}
prometheus-password: ${{ secrets.PROMETHEUS_PASSWORD || '' }}
push-github-action-benchmark: false # Firewood downloads artifact and publishes to their gh-pages
aws-role: ${{ 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: ${{ inputs.push-post-state }}
runner_name: ${{ inputs.runner }}
- name: Upload benchmark results
uses: actions/upload-artifact@v4
with:
name: benchmark-output
path: ${{ github.workspace }}/benchmark-output.txt
retention-days: 30
if-no-files-found: error
8 changes: 8 additions & 0 deletions Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,14 @@ tasks:
CURRENT_STATE_DIR_SRC: 'cchain-current-state-firewood-100'
CONFIG: firewood

build-firewood:
desc: Build Firewood FFI from source for testing with Coreth
dir: graft/coreth
vars:
FIREWOOD_REF: '{{.FIREWOOD_REF | default "main"}}'
DIRTY_FLAG: '{{if eq .DIRTY "true"}}--dirty{{end}}'
cmd: ./scripts/build_firewood.sh {{.FIREWOOD_REF}} {{.DIRTY_FLAG}}

test-bootstrap-monitor-e2e:
desc: Runs bootstrap monitor e2e tests
cmd: bash -x ./scripts/tests.e2e.bootstrap_monitor.sh
Expand Down
97 changes: 97 additions & 0 deletions graft/coreth/scripts/build_firewood.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
#!/usr/bin/env bash

set -euo pipefail

print_usage() {
printf "Usage: build_firewood.sh [FIREWOOD_COMMIT] [--dirty]
Build Firewood FFI from source for testing with Coreth.
Arguments:
FIREWOOD_COMMIT Git commit or branch to build (default: main)
Options:
--dirty Update go.mod after building (dirties working tree)
(default: only print path)
Examples:
# Build from commit and capture FFI path
FIREWOOD_FFI_PATH=\$(./scripts/build_firewood.sh abc123def)
# Build from main and update go.mod (dirties tree)
./scripts/build_firewood.sh main --dirty
Note: To use a published Firewood version (e.g., v0.0.15) run go get -u github.com/ava-labs/firewood-go-ethhash/ffi@{version}
"
}

FIREWOOD_COMMIT="main"
UPDATE_GO_MOD=false

while [[ $# -gt 0 ]]; do
case $1 in
-h|--help)
print_usage
exit 0
;;
--dirty)
UPDATE_GO_MOD=true
shift
;;
*)
FIREWOOD_COMMIT="$1"
shift
;;
esac
done

CORETH_PATH=$( cd "$( dirname "${BASH_SOURCE[0]}" )"; cd .. && pwd )
FIREWOOD_DIR="${CORETH_PATH}/build/firewood"

echo "Building Firewood FFI from source at: ${FIREWOOD_COMMIT}" >&2

if ! command -v nix &> /dev/null; then
echo "Error: nix command not found" >&2
echo "Nix is required to build Firewood. To install it, run:" >&2
echo " ./scripts/run_task.sh install-nix" >&2
exit 1
fi

if [ -d "${FIREWOOD_DIR}/.git" ]; then
cd "${FIREWOOD_DIR}"
git fetch origin
git checkout "${FIREWOOD_COMMIT}"
git pull --ff-only 2>/dev/null || true
else
mkdir -p "${CORETH_PATH}/build"
git clone https://github.com/ava-labs/firewood.git "${FIREWOOD_DIR}"
cd "${FIREWOOD_DIR}"
git checkout "${FIREWOOD_COMMIT}"
fi

cd "${FIREWOOD_DIR}/ffi"
nix build 2>&1

FIREWOOD_FFI_PATH="${FIREWOOD_DIR}/ffi/result/ffi"
export FIREWOOD_FFI_PATH

if [ ! -d "${FIREWOOD_FFI_PATH}" ]; then
echo "Error: Build succeeded but result not found at ${FIREWOOD_FFI_PATH}" >&2
exit 1
fi

echo "Firewood built successfully at: ${FIREWOOD_FFI_PATH}" >&2

if [ "${UPDATE_GO_MOD}" = true ]; then
echo "Updating go.mod..." >&2

cd "${CORETH_PATH}"
go mod edit -replace "github.com/ava-labs/firewood-go-ethhash/ffi=${FIREWOOD_FFI_PATH}"
go mod tidy

echo "Updated go.mod successfully" >&2
fi

# Output path to stdout for capture
echo "${FIREWOOD_FFI_PATH}"