Skip to content

fix(l1,l2): adapt to ethrex upstream backend API refactoring#61

Merged
xqft merged 8 commits into
mainfrom
fix/ethrex-upstream-refactors
Jan 23, 2026
Merged

fix(l1,l2): adapt to ethrex upstream backend API refactoring#61
xqft merged 8 commits into
mainfrom
fix/ethrex-upstream-refactors

Conversation

@xqft

@xqft xqft commented Jan 21, 2026

Copy link
Copy Markdown
Contributor

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.

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.
@xqft xqft changed the title Fix: Adapt to ethrex upstream backend API refactoring fix(l1,l2): Adapt to ethrex upstream backend API refactoring Jan 21, 2026
@xqft xqft changed the title fix(l1,l2): Adapt to ethrex upstream backend API refactoring fix(l1,l2): adapt to ethrex upstream backend API refactoring Jan 21, 2026
xqft added 3 commits January 21, 2026 16:40
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
xqft added 4 commits January 22, 2026 11:43
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.
@xqft xqft merged commit 75ae58c into main Jan 23, 2026
18 checks passed
@xqft xqft deleted the fix/ethrex-upstream-refactors branch January 23, 2026 19:00
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