Skip to content

deps(l1): fix make update_ethrex and update ethrex dependencies#67

Merged
ilitteri merged 3 commits into
mainfrom
fix/update-ethrex-deps
Mar 6, 2026
Merged

deps(l1): fix make update_ethrex and update ethrex dependencies#67
ilitteri merged 3 commits into
mainfrom
fix/update-ethrex-deps

Conversation

@ilitteri

@ilitteri ilitteri commented Mar 6, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Fix make update_ethrex which was broken due to the guest_programethrex-guest-program upstream rename and a Makefile typo (-prover instead of -p ethrex-prover)
  • Update all ethrex dependencies to latest main and fix compilation errors from upstream API changes (L1 and L2)

Changes

  • Cargo.toml: Rename guest_program dependency to ethrex-guest-program, update all feature references
  • Makefile: Fix -prover typo, add missing packages (ethrex-l2-common, ethrex-sdk)
  • src/cache.rs, src/cli.rs, src/rpc/db.rs: Move RpcExecutionWitness import from ethrex_rpc to ethrex_common (upstream move)
  • src/cli.rs: Add None arg to add_block_pipeline, add slot_number to BuildPayloadArgs, rename validate_blockvalidate_block_pre_execution, add block_gas_used to BlockExecutionResult
  • src/run.rs: Add cumulative_gas_spent arg to execute_tx, remove elasticity_multiplier/fee_configs from L1 ProgramInput, fix fee_configs type from Option<Vec> to Vec for L2
  • src/rpc/db.rs: Implement new get_code_metadata trait method for RpcDB

Test plan

  • make update_ethrex runs successfully
  • cargo build --no-default-features compiles without errors
  • cargo check --features l2 compiles without errors
  • cargo check --features "l2,sp1" compiles without errors
  • cargo check --features "l2,risc0" compiles without errors

Copilot AI review requested due to automatic review settings March 6, 2026 17:06

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 fixes the broken make update_ethrex command and updates all ethrex dependencies to match the latest upstream API changes. The upstream ethrex monorepo renamed guest_program to ethrex-guest-program, moved RpcExecutionWitness from ethrex_rpc to ethrex_common, added new parameters to several functions (cumulative_gas_spent for execute_tx, slot_number for BuildPayloadArgs, None for add_block_pipeline), added a new get_code_metadata trait method, and removed elasticity_multiplier/fee_configs fields from the L1 ProgramInput.

Changes:

  • Fix the Makefile update_ethrex target (broken -prover typo, rename guest_program) and rename guest_program to ethrex-guest-program in all Cargo.toml references.
  • Update source files to reflect upstream API changes: moved imports, new function parameters, new trait method implementation.
  • Remove elasticity_multiplier and fee_configs from L1 ProgramInput construction.

Reviewed changes

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

Show a summary per file
File Description
Cargo.toml Rename guest_program dependency to ethrex-guest-program, update all feature references
Makefile Fix -prover typo, add missing packages (ethrex-l2-common, ethrex-sdk), rename guest_program
src/cache.rs Move RpcExecutionWitness import from ethrex_rpc to ethrex_common
src/cli.rs Move RpcExecutionWitness import, add None arg to add_block_pipeline, add slot_number to BuildPayloadArgs, rename guest_program import
src/run.rs Rename guest_program import, add cumulative_gas_spent to execute_tx, remove L1 ProgramInput fields, remove top-level imports
src/rpc/db.rs Move RpcExecutionWitness import, add CodeMetadata import, implement get_code_metadata trait method

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

Comment thread src/run.rs
#[cfg(not(feature = "l2"))]
let mut vm = Evm::new_for_l1(wrapped_db.clone());
let (receipt, _) = vm.execute_tx(tx, &block.header, &mut remaining_gas, tx_sender)?;
let mut cumulative_gas_spent = 0;

Copilot AI Mar 6, 2026

Copy link

Choose a reason for hiding this comment

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

cumulative_gas_spent is initialized to 0 inside the loop body, so it resets on each iteration. This likely produces incorrect cumulative_gas_used values in the receipt, since "cumulative" gas should accumulate across all transactions in the block (similar to how remaining_gas is defined before the loop at line 117 and accumulates across iterations). Move let mut cumulative_gas_spent = 0; before the for loop.

Copilot uses AI. Check for mistakes.
Comment thread src/run.rs
Comment on lines 1 to 2
use crate::{cache::Cache, cli::ProofType};
use ethrex_common::types::ELASTICITY_MULTIPLIER;
use ethrex_common::types::fee_config::FeeConfig;
use ethrex_common::{

Copilot AI Mar 6, 2026

Copy link

Choose a reason for hiding this comment

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

Removing these two imports (ELASTICITY_MULTIPLIER and FeeConfig) breaks compilation when the l2 feature is enabled. FeeConfig is still used at line 139 in run_tx (under #[cfg(feature = "l2")]) without any import in scope, and ELASTICITY_MULTIPLIER is still used at line 240 in get_l2_input (also under #[cfg(feature = "l2")]). Either keep these imports (possibly guarded with #[cfg(feature = "l2")]), or update the L2 code paths to match the upstream API changes.

Copilot uses AI. Check for mistakes.
@ilitteri ilitteri changed the title Fix make update_ethrex and update ethrex dependencies deps: fix make update_ethrex and update ethrex dependencies Mar 6, 2026
ilitteri added 2 commits March 6, 2026 14:53
- Rename guest_program to ethrex-guest-program (upstream rename)
- Fix Makefile typo: `-prover` was not a valid flag (should be `-p ethrex-prover`)
- Add missing packages to Makefile update target (ethrex-l2-common, ethrex-sdk)
- Move RpcExecutionWitness import from ethrex-rpc to ethrex-common (upstream move)
- Add second argument to add_block_pipeline (new `bal` parameter)
- Add cumulative_gas_spent argument to execute_tx (new parameter)
- Add slot_number field to BuildPayloadArgs (new field)
- Remove elasticity_multiplier and fee_configs from ProgramInput (removed upstream)
- Implement get_code_metadata for RpcDB (new trait method)
- Add FeeConfig and ELASTICITY_MULTIPLIER imports behind l2 cfg gate
- Change fee_configs from Option<Vec<FeeConfig>> to Vec<FeeConfig> (upstream change)
- Rename validate_block to validate_block_pre_execution (moved to ethrex_common::validation)
- Add block_gas_used field to BlockExecutionResult
@ilitteri ilitteri force-pushed the fix/update-ethrex-deps branch from a89008c to 48441c8 Compare March 6, 2026 17:54
@ilitteri ilitteri changed the title deps: fix make update_ethrex and update ethrex dependencies deps(l1): fix make update_ethrex and update ethrex dependencies Mar 6, 2026
@github-actions github-actions Bot added the L1 label Mar 6, 2026
@ilitteri ilitteri enabled auto-merge March 6, 2026 18:10
@ilitteri ilitteri disabled auto-merge March 6, 2026 18:10
@ilitteri ilitteri merged commit 4561304 into main Mar 6, 2026
18 checks passed
@ilitteri ilitteri deleted the fix/update-ethrex-deps branch March 6, 2026 18:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants