deps(l1): fix make update_ethrex and update ethrex dependencies#67
Conversation
There was a problem hiding this comment.
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_ethrextarget (broken-provertypo, renameguest_program) and renameguest_programtoethrex-guest-programin all Cargo.toml references. - Update source files to reflect upstream API changes: moved imports, new function parameters, new trait method implementation.
- Remove
elasticity_multiplierandfee_configsfrom L1ProgramInputconstruction.
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.
| #[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; |
There was a problem hiding this comment.
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.
| use crate::{cache::Cache, cli::ProofType}; | ||
| use ethrex_common::types::ELASTICITY_MULTIPLIER; | ||
| use ethrex_common::types::fee_config::FeeConfig; | ||
| use ethrex_common::{ |
There was a problem hiding this comment.
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.
- 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
a89008c to
48441c8
Compare
Summary
make update_ethrexwhich was broken due to theguest_program→ethrex-guest-programupstream rename and a Makefile typo (-proverinstead of-p ethrex-prover)Changes
guest_programdependency toethrex-guest-program, update all feature references-provertypo, add missing packages (ethrex-l2-common,ethrex-sdk)RpcExecutionWitnessimport fromethrex_rpctoethrex_common(upstream move)Nonearg toadd_block_pipeline, addslot_numbertoBuildPayloadArgs, renamevalidate_block→validate_block_pre_execution, addblock_gas_usedtoBlockExecutionResultcumulative_gas_spentarg toexecute_tx, removeelasticity_multiplier/fee_configsfrom L1ProgramInput, fixfee_configstype fromOption<Vec>toVecfor L2get_code_metadatatrait method forRpcDBTest plan
make update_ethrexruns successfullycargo build --no-default-featurescompiles without errorscargo check --features l2compiles without errorscargo check --features "l2,sp1"compiles without errorscargo check --features "l2,risc0"compiles without errors