Skip to content

Conversation

@Elvis339
Copy link
Contributor

@Elvis339 Elvis339 commented Dec 3, 2025

Why this should be merged

Enables Firewood to track performance over time by running C-Chain reexecution benchmarks with custom Firewood builds. This establishes the infrastructure for catching performance regressions before they reach production.

ava-labs/firewood#1494

How this works

  1. Firewood triggers the existing C-Chain reexecution workflow via GitHub API with optional firewood and libevm parameters
  2. The workflow passes these to the benchmark task which uses polyrepo to clone, build (via Nix), and configure Firewood
  3. Runs C-Chain reexecution benchmark with the custom build
  4. Optionally uploads results as artifact for Firewood to download and track

The same functionality is available locally for development:

nix develop
./scripts/run_task.sh c-chain-reexecution-firewood-101-250k FIREWOOD_REF=abc123

Changes

  • Add LIBEVM_REF/FIREWOOD_REF support to reexecute-cchain-range-with-copied-data task
  • Update composite action and workflows to pass these inputs
  • Remove redundant c-chain-reexecution-benchmark-firewood.yml workflow
  • Remove build_firewood.sh script (replaced by polyrepo)
  • Add documentation to C-Chain Re-Execution README

How this was tested

gh workflow run "C-Chain Re-Execution Benchmark w/ Container" \
  --ref es/enable-firewood-dev-workflow \
  -f task=c-chain-reexecution-firewood-101-250k \
  -f firewood-ref=v0.0.15 \
  -f runner=avalanche-avalanchego-runner-2ti \
  -f timeout-minutes=60

Need to be documented in RELEASES.md?

No

@Elvis339 Elvis339 self-assigned this Dec 3, 2025
Copilot AI review requested due to automatic review settings December 3, 2025 17:43
@Elvis339 Elvis339 requested review from a team and aaronbuchwald as code owners December 3, 2025 17:43
@Elvis339 Elvis339 added the ci This focuses on changes to the CI process label Dec 3, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR establishes infrastructure for tracking Firewood performance over time by enabling C-Chain reexecution benchmarks with custom Firewood builds. The workflow can be triggered from the Firewood repository with either published versions (for quick testing) or branch/commit references (for comprehensive testing with source builds).

Key changes:

  • Adds a reusable workflow that accepts Firewood version/branch/commit as input
  • Implements intelligent build strategy: uses go get for published versions, builds from source for branches/commits
  • Creates build script for compiling Firewood FFI from source using Nix

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
.github/workflows/c-chain-reexecution-benchmark-firewood.yml New workflow that orchestrates benchmark execution with custom Firewood builds and uploads results as artifacts
graft/coreth/scripts/build_firewood.sh Shell script to clone, build, and optionally integrate Firewood FFI from source
.github/workflows/c-chain-reexecution-benchmark-container.yml Removes container configuration (unrelated cleanup)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Elvis339 Elvis339 requested a review from maru-ava December 9, 2025 18:10
Elvis339 and others added 4 commits December 9, 2025 22:10
…ution benchmarks

Integrate firewood/libevm dependency overrides into existing workflows
using polyrepo, eliminating the need for a separate firewood workflow.

- Add LIBEVM_REF/FIREWOOD_REF to reexecute-cchain-range-with-copied-data
- Update composite action and workflows to pass inputs
- Remove redundant firewood workflow and build_firewood.sh script
…/avalanchego into es/enable-firewood-dev-workflow
@maru-ava
Copy link
Contributor

Functionally this looks ok. Doc question and lint failure will need to be addressed before merge. Also, in addition to the command that you ran to verify that this is working, please include a passing test run that resulted from that command (this is general best practice when manual testing is required).

@maru-ava
Copy link
Contributor

I guess the 10 input params is an indication that this remote execution can't be much more than a stop-gap pending firewood migration to a monorepo?

@Elvis339
Copy link
Contributor Author

I guess the 10 input params is an indication that this remote execution can't be much more than a stop-gap pending firewood migration to a monorepo?

I wasn't aware of the 10 input param limit first time hitting this constraint.
As I see it, we have two options:

  1. Keep as stop-gap - Accept the current limitations until Firewood is grafted into the monorepo
  2. Move orchestration to Firewood remove this from avalanchego and have polyrepo orchestrate the benchmarks from Firewood's side (as we discussed offline)

That said, both options are effectively stop-gaps. (1) is temporary until Firewood joins the monorepo, and (2) would still require cross-repo coordination that becomes unnecessary once Firewood is grafted.

If you're okay with keeping (1) as a stop-gap for now with a GH issue to track the long-term solution, that would unblock the Firewood team to start collecting performance metrics sooner.

@maru-ava
Copy link
Contributor

If you're okay with keeping (1) as a stop-gap for now with a GH issue to track the long-term solution, that would unblock the Firewood team to start collecting performance metrics sooner.

I'm fine with that, as per my use of the term 'stop-gap' - a temporary solution pending a better one.

@Elvis339
Copy link
Contributor Author

Elvis339 commented Dec 15, 2025

Executed:

gh workflow run "C-Chain Re-Execution Benchmark w/ Container" \
  --ref es/enable-firewood-dev-workflow \
  -f task=c-chain-reexecution-firewood-101-250k \
  -f firewood-ref=v0.0.15 \
  -f runner=avalanche-avalanchego-runner-2ti \
  -f timeout-minutes=60

Result: https://github.com/ava-labs/avalanchego/actions/runs/20240259592

Copy link
Contributor

@maru-ava maru-ava left a comment

Choose a reason for hiding this comment

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

The comments I made on the container workflow also apply to the container one.

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?

push-post-state: ${{ matrix.push-post-state || '' }}
runner_name: ${{ matrix.runner }}
- name: Upload benchmark results
if: inputs.firewood != ''
Copy link
Contributor

@maru-ava maru-ava Dec 15, 2025

Choose a reason for hiding this comment

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

Maybe add a command comment here indicating why a value for this parameter should prevent uploading?

Copy link
Contributor Author

@Elvis339 Elvis339 Dec 15, 2025

Choose a reason for hiding this comment

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

Added it here:

# Skip when using custom firewood - Firewood downloads the artifact and
but forgot to add it to concrete implementations, thanks for pointing it out.

d428155 87b3d4c

@Elvis339 Elvis339 requested a review from a team as a code owner December 15, 2025 17:49
@Elvis339
Copy link
Contributor Author

Re: #4650 (comment)

Why are we using this image in the first place? I get that it wasn't working for firewood, but it would be good to know why it's ok to stop using it.

The image was originally used because it was minimal and we didn't want to maintain our own ubuntu base was missing sudo and the initial ARC implementation needed some baseline. SREs and Infra have been iterating on it since then.
As for why it's ok to remove - I ran into io_uring not being available when trying to build Firewood (which uses io_uring for async I/O). Removed the container and it worked. The self-hosted runners already have all the dependencies we need, so the container was just adding constraints without much benefit for our use case.

Copy link
Contributor

@maru-ava maru-ava left a comment

Choose a reason for hiding this comment

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

I'm ok with this, but I think @aaronbuchwald will need to confirm that these changes are in keeping with his expectations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci This focuses on changes to the CI process

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

4 participants