Skip to content

ci(l1, l2): create reusable step to install rust#3591

Merged
mpaulucci merged 9 commits into
mainfrom
remove-rust-version-var-from-ci-2
Jul 11, 2025
Merged

ci(l1, l2): create reusable step to install rust#3591
mpaulucci merged 9 commits into
mainfrom
remove-rust-version-var-from-ci-2

Conversation

@mpaulucci

@mpaulucci mpaulucci commented Jul 10, 2025

Copy link
Copy Markdown
Collaborator

Continuation of #3318

Motivation

GitHub Variables are excluded from workflow runs triggered by PRs from forks, so we need to remove this variable dependency in order for external collaborators to send PRs and run the CI properly

Description

  • The Extract Rust version from rust-toolchain.toml step (id: rustver) uses grep and sed to extract the rust version from the rust-toolchain.toml file that is in the root of the repository.
  • The Install Rust step utilizes the output of the previous step to send the version to the toolchain parameter
  • Note that in some cases, I had to move the Checkout step further up (it's also good practice to put it as high up as possible) so the rust-toolchain.toml file is available to be read.

klaus993 and others added 7 commits June 25, 2025 15:17
To remove the usage of the RUST_VERSION GitHub Variable.
GitHub Variables are excluded from workflow runs triggered by PRs from forks,
so we need to remove this variable dependency in order for external
collaborators to send PRs and run the CI
So the rust-toolchain.toml file is present
@mpaulucci mpaulucci changed the title ci(core): create reusable step to install rust ci(l1, l2): create reusable step to install rust Jul 10, 2025
@github-actions

Copy link
Copy Markdown

No significant difference was registered for any benchmark run.

Detailed Results

Benchmark Results: BubbleSort

Command Mean [s] Min [s] Max [s] Relative
main_revm_BubbleSort 3.193 ± 0.029 3.168 3.249 1.00 ± 0.01
main_levm_BubbleSort 4.501 ± 0.092 4.382 4.592 1.41 ± 0.03
pr_revm_BubbleSort 3.189 ± 0.011 3.177 3.202 1.00
pr_levm_BubbleSort 4.484 ± 0.093 4.403 4.641 1.41 ± 0.03

Benchmark Results: ERC20Approval

Command Mean [s] Min [s] Max [s] Relative
main_revm_ERC20Approval 1.055 ± 0.020 1.034 1.086 1.02 ± 0.02
main_levm_ERC20Approval 1.523 ± 0.022 1.509 1.584 1.48 ± 0.02
pr_revm_ERC20Approval 1.030 ± 0.007 1.025 1.048 1.00
pr_levm_ERC20Approval 1.529 ± 0.006 1.520 1.538 1.48 ± 0.01

Benchmark Results: ERC20Mint

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_ERC20Mint 140.3 ± 0.9 139.1 142.3 1.02 ± 0.02
main_levm_ERC20Mint 248.6 ± 3.2 244.2 254.4 1.80 ± 0.04
pr_revm_ERC20Mint 137.7 ± 2.9 135.4 145.1 1.00
pr_levm_ERC20Mint 250.4 ± 9.3 245.1 276.1 1.82 ± 0.08

Benchmark Results: ERC20Transfer

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_ERC20Transfer 247.9 ± 1.6 246.6 252.0 1.02 ± 0.02
main_levm_ERC20Transfer 390.7 ± 1.6 388.4 393.5 1.61 ± 0.02
pr_revm_ERC20Transfer 242.0 ± 3.3 239.9 249.3 1.00
pr_levm_ERC20Transfer 394.0 ± 4.0 390.9 401.6 1.63 ± 0.03

Benchmark Results: Factorial

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_Factorial 232.2 ± 1.4 230.5 235.5 1.00 ± 0.01
main_levm_Factorial 484.6 ± 20.6 476.5 542.9 2.09 ± 0.09
pr_revm_Factorial 232.1 ± 1.4 230.5 235.6 1.00
pr_levm_Factorial 494.1 ± 27.3 475.3 536.4 2.13 ± 0.12

Benchmark Results: FactorialRecursive

Command Mean [s] Min [s] Max [s] Relative
main_revm_FactorialRecursive 1.596 ± 0.090 1.349 1.647 1.00
main_levm_FactorialRecursive 2.854 ± 0.074 2.783 2.979 1.79 ± 0.11
pr_revm_FactorialRecursive 1.596 ± 0.028 1.546 1.631 1.00 ± 0.06
pr_levm_FactorialRecursive 2.831 ± 0.079 2.747 2.955 1.77 ± 0.11

Benchmark Results: Fibonacci

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_Fibonacci 204.7 ± 0.8 202.9 205.7 1.00
main_levm_Fibonacci 466.7 ± 9.2 462.7 492.7 2.28 ± 0.05
pr_revm_Fibonacci 205.1 ± 0.6 204.5 206.6 1.00 ± 0.00
pr_levm_Fibonacci 466.3 ± 5.3 461.8 480.7 2.28 ± 0.03

Benchmark Results: FibonacciRecursive

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_FibonacciRecursive 856.0 ± 15.5 829.8 886.4 1.00 ± 0.02
main_levm_FibonacciRecursive 1492.2 ± 46.2 1445.3 1548.5 1.75 ± 0.06
pr_revm_FibonacciRecursive 852.3 ± 13.8 823.7 873.6 1.00
pr_levm_FibonacciRecursive 1468.3 ± 46.2 1418.7 1538.0 1.72 ± 0.06

Benchmark Results: ManyHashes

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_ManyHashes 8.7 ± 0.1 8.6 8.8 1.01 ± 0.01
main_levm_ManyHashes 13.2 ± 0.1 13.1 13.3 1.52 ± 0.01
pr_revm_ManyHashes 8.6 ± 0.1 8.6 8.8 1.00
pr_levm_ManyHashes 13.2 ± 0.1 13.1 13.2 1.52 ± 0.01

Benchmark Results: MstoreBench

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_MstoreBench 270.3 ± 3.5 266.7 278.8 1.00 ± 0.02
main_levm_MstoreBench 935.8 ± 1.6 933.8 938.7 3.47 ± 0.05
pr_revm_MstoreBench 270.0 ± 3.8 266.9 278.2 1.00
pr_levm_MstoreBench 945.9 ± 33.9 932.9 1041.9 3.50 ± 0.13

Benchmark Results: Push

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_Push 295.6 ± 1.5 293.5 298.6 1.00 ± 0.01
main_levm_Push 1048.9 ± 2.3 1045.4 1053.4 3.56 ± 0.01
pr_revm_Push 295.0 ± 0.8 294.2 296.5 1.00
pr_levm_Push 1053.1 ± 9.8 1045.4 1078.3 3.57 ± 0.03

@mpaulucci mpaulucci marked this pull request as ready for review July 10, 2025 17:41
Copilot AI review requested due to automatic review settings July 10, 2025 17:41
@mpaulucci mpaulucci requested a review from a team as a code owner July 10, 2025 17:41

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 introduces a reusable composite action for setting up Rust across workflows, removing direct dependency on repository variables so that CI runs properly for forked PRs.

  • Added a setup-rust composite action that extracts the Rust version from rust-toolchain.toml, installs the toolchain, and caches dependencies.
  • Updated multiple workflow files to replace individual Rust install and cache steps with Setup Rust Environment.
  • Standardized step naming and ordering in workflows to improve consistency.

Reviewed Changes

Copilot reviewed 18 out of 18 changed files in this pull request and generated no comments.

Show a summary per file
File Description
.github/actions/setup-rust/action.yml New composite action to install Rust and cache dependencies
.github/workflows/pr_perf_trie.yml Replaced Rust install and cache steps with composite action
.github/workflows/pr_perf_levm.yaml Replaced Rust install and cache steps with composite action
.github/workflows/pr_perf_build_block_bench.yml Replaced Rust install and cache steps with composite action
.github/workflows/pr_perf_blocks_exec.yaml Replaced Rust install and cache steps with composite action
.github/workflows/pr_loc.yaml Replaced Rust install and cache steps with composite action
.github/workflows/pr_lint_readme.yaml Replaced Rust install and cache steps with composite action
.github/workflows/pr-main_levm.yaml Replaced Rust install and cache steps with composite action
.github/workflows/pr-main_l2_tdx.yaml Replaced Rust install and cache steps with composite action
.github/workflows/pr-main_l2_contracts.yaml Replaced Rust install and cache steps with composite action
.github/workflows/pr-main_l2.yaml Replaced Rust install and cache steps with composite action
.github/workflows/pr-main_l1.yaml Replaced Rust install and cache steps with composite action
.github/workflows/main_prover_l1.yaml Replaced Rust install and cache steps with composite action
.github/workflows/main_prover.yaml Replaced Rust install and cache steps with composite action
.github/workflows/main_perf_blocks_exec.yml Replaced Rust install and cache steps with composite action
.github/workflows/main_flamegraph_report.yaml Replaced Rust install and cache steps with composite action
.github/workflows/daily_loc.yaml Replaced Rust install and cache steps with composite action
.github/workflows/common_hive_reports.yaml Replaced Rust install and cache steps with composite action
Comments suppressed due to low confidence (2)

.github/workflows/pr_perf_blocks_exec.yaml:26

  • The Setup Rust Environment step is declared before checking out sources, so rust-toolchain.toml won’t be available for version extraction. Move the Checkout sources step above this step.
      - name: Setup Rust Environment

.github/actions/setup-rust/action.yml:26

  • [nitpick] Consider adding an input for cache-on-failure to the composite action so workflows can preserve the previous cache failure behavior when needed.
    - name: Add Rust Cache

@ilitteri ilitteri moved this to In Review in ethrex_l2 Jul 10, 2025
@mpaulucci mpaulucci added this pull request to the merge queue Jul 11, 2025
Merged via the queue into main with commit fa42468 Jul 11, 2025
55 of 56 checks passed
@mpaulucci mpaulucci deleted the remove-rust-version-var-from-ci-2 branch July 11, 2025 13:16
@github-project-automation github-project-automation Bot moved this from In Review to Done in ethrex_l2 Jul 11, 2025
d-roak pushed a commit to 1sixtech/ethrex that referenced this pull request Jul 17, 2025
Continuation of lambdaclass#3318

**Motivation**

GitHub Variables are excluded from workflow runs triggered by PRs from
forks, so we need to remove this variable dependency in order for
external collaborators to send PRs and run the CI properly

**Description**

* The `Extract Rust version from rust-toolchain.toml` step (`id:
rustver`) uses `grep` and `sed` to extract the rust version from the
`rust-toolchain.toml` file that is in the root of the repository.
* The `Install Rust` step utilizes the output of the previous step to
send the version to the `toolchain` parameter
* Note that in some cases, I had to move the `Checkout` step further up
(it's also good practice to put it as high up as possible) so the
`rust-toolchain.toml` file is available to be read.

---------

Co-authored-by: Klaus Lungwitz <klaus.lungwitz@lambdaclass.com>
Co-authored-by: Javier Rodríguez Chatruc <49622509+jrchatruc@users.noreply.github.com>
pedrobergamini pushed a commit to pedrobergamini/ethrex that referenced this pull request Aug 24, 2025
Continuation of lambdaclass#3318

**Motivation**

GitHub Variables are excluded from workflow runs triggered by PRs from
forks, so we need to remove this variable dependency in order for
external collaborators to send PRs and run the CI properly

**Description**

* The `Extract Rust version from rust-toolchain.toml` step (`id:
rustver`) uses `grep` and `sed` to extract the rust version from the
`rust-toolchain.toml` file that is in the root of the repository.
* The `Install Rust` step utilizes the output of the previous step to
send the version to the `toolchain` parameter
* Note that in some cases, I had to move the `Checkout` step further up
(it's also good practice to put it as high up as possible) so the
`rust-toolchain.toml` file is available to be read.

---------

Co-authored-by: Klaus Lungwitz <klaus.lungwitz@lambdaclass.com>
Co-authored-by: Javier Rodríguez Chatruc <49622509+jrchatruc@users.noreply.github.com>
github-merge-queue Bot pushed a commit that referenced this pull request Oct 21, 2025
…main (#4969)

**Motivation**

In the PR #3591 the` EF Test check main` ci job lost the reference to
main, breaking the purpose of the job. This pr aims to fix this issue.

**Description**

- Reads the `with: ref: main` to the job.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

L2 Rollup client

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

5 participants