Skip to content

Conversation

@maru-ava
Copy link
Contributor

@maru-ava maru-ava commented Dec 17, 2025

Why this should be merged

Doing anything non-trivial in tasks is not recommended. This change moves the reexec logic to a new script for ease of maintenance and to simplify usage.

How this was tested

  • CI

Need to be documented in RELEASES.md?

N/A

@maru-ava maru-ava self-assigned this Dec 17, 2025
@maru-ava maru-ava added the ci This focuses on changes to the CI process label Dec 17, 2025
description: 'The password for the Prometheus instance.'
required: true
default: ''
workspace:
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I noticed this was unused.

role-to-assume: ${{ inputs.aws-role }}
aws-region: ${{ inputs.aws-region }}
role-duration-seconds: ${{ inputs.aws-role-duration-seconds }}
- name: Validate inputs
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Validation moved to the script so its defined once for use locally and in CI and it can be subject to shellcheck linting.

run: echo "BENCHMARK_OUTPUT_FILE=${GITHUB_WORKSPACE}/benchmark-output.json" >> "$GITHUB_ENV"
- name: Run C-Chain Re-execution Benchmark
shell: nix develop --impure --command bash -x {0}
run: |
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Moved this configuration to the script

- name: Set task env
- name: Set benchmark output file
shell: bash
run: |
Copy link
Contributor Author

Choose a reason for hiding this comment

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

EXECUTION_DATA_DIR is now set in the script

@maru-ava maru-ava moved this to Ready 🚦 in avalanchego Dec 17, 2025
@maru-ava maru-ava marked this pull request as ready for review December 17, 2025 17:45
@maru-ava maru-ava requested a review from a team as a code owner December 17, 2025 17:45
Copilot AI review requested due to automatic review settings December 17, 2025 17:45
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 consolidates C-Chain re-execution logic from multiple Taskfile tasks into a single unified shell script to simplify maintenance and usage.

Key Changes:

  • Introduces reexecute_cchain.sh script with preset test configurations and custom test support
  • Removes complex Taskfile orchestration in favor of direct script execution
  • Simplifies GitHub Actions workflows by replacing task-based invocation with direct script calls

Reviewed changes

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

Show a summary per file
File Description
scripts/reexecute_cchain.sh New unified script that handles test presets, S3 data import, execution, and optional post-state pushing
Taskfile.yml Removes reexecution-related tasks and adds simplified test-c-chain-reexecution entry point; simplifies export-cchain-block-range task
.github/workflows/c-chain-reexecution-benchmark-gh-native.yml Updates workflow to use test parameter instead of task parameter
.github/workflows/c-chain-reexecution-benchmark-gh-native.json Updates matrix configuration to use test instead of task
.github/workflows/c-chain-reexecution-benchmark-container.yml Updates workflow to use test parameter instead of task parameter
.github/workflows/c-chain-reexecution-benchmark-container.json Updates matrix configuration to use test instead of task
.github/actions/c-chain-reexecution-benchmark/action.yml Simplifies action inputs and logic to call script directly with environment variable overrides

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

Comment on lines 14 to 15
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
S3_BOOTSTRAP_BUCKET="${S3_BOOTSTRAP_BUCKET:-s3://avalanchego-bootstrap-testing}"
Copy link
Collaborator

Choose a reason for hiding this comment

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

If I'm not mistaken, we switched to turning each of these sets of parameters into tasks to comply with the notion that tasks should be fully encompassed within the task instead of passing in a bunch of parameters.

I'd argue that a wide range of different sets of options like this is not as common to place within a bash script.

Would you still push to keep each of these baked into one configuration options within this script if we are going to move it out of the taskfile?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I intended for tasks to be both discoverable and to serve as entrypoints into CI so that reproducing CI was as simple as possible. The goal was not to implement anything non-trivial directly in the tasks, though, and I think that the reexec task logic is better maintained outside of the taskfile as I've proposed in this PR.

I think creating a task per reexec test configuration makes about as much sense as creating a task per e2e test. It's still possible to target the execution of an e2e test but it's the e2e test suite that's responsible for enabling that rather than something we need to do in the taskfile. I think it similarly makes sense for there to be an entrypoint in the taskfile for executing reexec tests, and that the entrypoint be responsible for defining both common test configurations and enabling ad-hoc configuration.

@aaronbuchwald
Copy link
Collaborator

Could you please validate the change by stepping through the README and updating it as needed?

@maru-ava
Copy link
Contributor Author

Could you please validate the change by stepping through the README and updating it as needed?

Done

@maru-ava maru-ava force-pushed the maru/simplify-reexec-tasks branch 3 times, most recently from 91851f9 to 0df3f05 Compare December 18, 2025 15:47
@maru-ava
Copy link
Contributor Author

Not ideal that we have a README with complex instructions that have to be manually verified when things change. Mental note: prefer an executable script in future with inline comments instead of a static README.

@maru-ava maru-ava force-pushed the maru/simplify-reexec-tasks branch from 0df3f05 to 809baac Compare December 19, 2025 20:13
Elvis339 added a commit to ava-labs/firewood that referenced this pull request Dec 30, 2025
…#1580)

## Why this should be merged

Patch is related to #1578

The `aws-launch.sh` script is currently not collecting metrics because
it uses the old avalanchego task interface. The new version of
avalanchego's
[Taskfile.yml](https://github.com/ava-labs/avalanchego/blob/10f374649645f3093023633d60825875c5645589/Taskfile.yml#L204)
changed how metrics configuration is passed:

- Old: `METRICS_ENABLED` passed as a task variable
- New: `METRICS_SERVER_ENABLED` and / or `METRICS_COLLECTOR_ENABLED`
passed as environment variables

This mismatch causes metrics to silently not be configured when running
benchmarks on EC2 instances.

Related PRs:
-
[ava-labs/avalanchego#4761](ava-labs/avalanchego#4761)
- [Move from task vars to
env](https://github.com/ava-labs/avalanchego/blob/0eebefb80b34849c44c7657a431b57b50e194300/scripts/benchmark_cchain_range.sh#L15)
-
[ava-labs/avalanchego#4443](ava-labs/avalanchego#4443)

## How this works

Changed the bootstrap command from:
```bash
task reexecute-cchain-range ... METRICS_ENABLED=false
```

To:
```bash
METRICS_SERVER_ENABLED=true task reexecute-cchain-range ...
```

This aligns with how avalanchego's `benchmark_cchain_range.sh` now reads
these settings from the environment rather than from task variables.

## How this was tested

### 1. AvalancheGo environment variable behavior

Navigate to or clone AvalancheGo:
```bash
git clone [email protected]:ava-labs/avalanchego.git
cd avalanchego
```

**Default (metrics disabled):**
```bash
./scripts/run_task.sh reexecute-cchain-range \
  BLOCK_DIR=/tmp/test \
  CURRENT_STATE_DIR=/tmp/test \
  START_BLOCK=101 \
  END_BLOCK=102 2>&1 | grep -o '"metrics-server-enabled": "[^"]*"'
```
Expected: `"metrics-server-enabled": "false"`

**With metrics enabled:**
```bash
METRICS_SERVER_ENABLED=true ./scripts/run_task.sh reexecute-cchain-range \
  BLOCK_DIR=/tmp/test \
  CURRENT_STATE_DIR=/tmp/test \
  START_BLOCK=101 \
  END_BLOCK=102 2>&1 | grep -o '"metrics-server-enabled": "[^"]*"'
```
Expected: `"metrics-server-enabled": "true"`

### 2. Firewood `aws-launch.sh` flag behavior

**Default (metrics enabled):**
```bash
./benchmark/bootstrap/aws-launch.sh --dry-run 2>&1 | grep "Metrics Server:"
```
Expected: `Metrics Server: true`

**Disable metrics:**
```bash
./benchmark/bootstrap/aws-launch.sh --dry-run --metrics-server false 2>&1 | grep "Metrics Server:"
```
Expected: `Metrics Server: false`

**Case insensitivity:**
```bash
./benchmark/bootstrap/aws-launch.sh --dry-run --metrics-server TRUE 2>&1 | grep "Metrics Server:"
```
Expected: `Metrics Server: true` (normalized to lowercase)

**Invalid value (fail fast):**
```bash
./benchmark/bootstrap/aws-launch.sh --metrics-server tru 2>&1
```
Expected:
```
Error: Invalid --metrics-server value 'tru'
Valid values: true, false
```
@maru-ava maru-ava force-pushed the maru/simplify-reexec-tasks branch from 0eebefb to b241482 Compare January 2, 2026 15:04
@maru-ava
Copy link
Contributor Author

maru-ava commented Jan 2, 2026

Rebased

Copy link
Contributor

@RodrigoVillar RodrigoVillar left a comment

Choose a reason for hiding this comment

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

LGTM

@maru-ava maru-ava added this pull request to the merge queue Jan 6, 2026
Merged via the queue into master with commit 25d6216 Jan 6, 2026
53 checks passed
@maru-ava maru-ava deleted the maru/simplify-reexec-tasks branch January 6, 2026 13:03
@github-project-automation github-project-automation bot moved this from Ready 🚦 to Done 🎉 in avalanchego Jan 6, 2026
RodrigoVillar added a commit to ava-labs/firewood that referenced this pull request Jan 9, 2026
## Why this should be merged

With ava-labs/avalanchego#4761, invocation of
the reexecution test underwent a major refactor. Running the current
bootstrap script against the latest version of AvalancheGo results in an
error.

## How this works

Updates bootstrapping script to use the new invocation of the
reexecution test.

## How this was tested

Ran `./aws-launch.sh --firewood-branch main --avalanchego-branch master
--libevm-branch b8e76562a300 --nblocks 1m` and observed a successful
reexecution test.
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

Archived in project

Development

Successfully merging this pull request may close these issues.

4 participants