fix(l1,l2): adapt to ethrex upstream backend API refactoring#61
Merged
Conversation
Ethrex has refactored the prover backend system from a simple enum-based approach to a trait-based architecture. This commit adapts ethrex-replay to work with the new API. Key changes: - Replace Backend enum with BackendType enum for backend selection - Add imports for ProverBackend trait and concrete backend types (ExecBackend, Sp1Backend, Risc0Backend, ZiskBackend, OpenVmBackend) - Refactor exec() and prove() functions to instantiate backend objects and call trait methods instead of module-level functions - Extract only Duration from prove_timed results since different backends return different proof output types The new API uses: - BackendType: enum for CLI/config to select which backend to use - ProverBackend trait: defines execute_timed() and prove_timed() methods - Concrete types for each backend that implement ProverBackend trait This maintains backward compatibility with ethrex-replay's existing CLI and internal APIs while adapting to the upstream refactoring.
Changes: - Enable l2 feature for ethrex-prover dependency to ensure BackendType and related exports are always available - Change GenesisAccount storage field from HashMap to BTreeMap to match upstream type change - Add blob_commitment and blob_proof fields to get_l1_input to match ProgramInput structure when l2 is enabled These changes ensure ethrex-replay compiles correctly with all feature combinations used in CI: - --no-default-features --features ci - --no-default-features --features l2,ci - default features
avilagaston9
approved these changes
Jan 21, 2026
Updated code to work with upstream refactored prover backend API: 1. Changed EthClientError::RpcRequestError to EthClientError::RequestError in fetcher.rs to match the renamed error variant in the upstream RPC client 2. Added missing fields to ProgramInput initialization for both L1 and L2 modes: - elasticity_multiplier: Uses ELASTICITY_MULTIPLIER constant - fee_configs: Wrapped in Some() as the field type is Option<Vec<FeeConfig>> 3. Fixed fee_configs access in write_program_input to handle the Option type using as_ref().map().unwrap_or(0) 4. Removed conditional compilation guards from ELASTICITY_MULTIPLIER and FeeConfig imports since they are now needed for both L1 and L2 These changes ensure the codebase compiles with all feature combinations (default, l2, sp1, risc0, zisk) and matches the upstream trait-based backend architecture.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adapts ethrex-replay to work with the refactored prover backend API from upstream ethrex. The upstream changes moved from a simple enum-based approach to a trait-based architecture.