Skip to content

Conversation

@avilagaston9
Copy link
Contributor

@avilagaston9 avilagaston9 commented Oct 27, 2025

Motivation

In L2, every block is executed with a specific FeeConfig stored in the rollup_store, following the mapping block_number -> fee_config. Since the L1 RPC handler doesn’t have access to the rollup_store, it’s impossible to properly generate the execution witness.

Description

  • Overrides the debug_executionWitness endpoint from the L2 to fetch each FeeConfig before generating the witnesses.

Closes None

@github-actions
Copy link

github-actions bot commented Oct 27, 2025

Lines of code report

Total lines added: 81
Total lines removed: 8
Total lines changed: 89

Detailed view
+---------------------------------------------------------+-------+------+
| File                                                    | Lines | Diff |
+---------------------------------------------------------+-------+------+
| ethrex/crates/l2/networking/rpc/l2/execution_witness.rs | 72    | +72  |
+---------------------------------------------------------+-------+------+
| ethrex/crates/l2/networking/rpc/l2/mod.rs               | 5     | +1   |
+---------------------------------------------------------+-------+------+
| ethrex/crates/l2/networking/rpc/rpc.rs                  | 213   | +8   |
+---------------------------------------------------------+-------+------+
| ethrex/crates/networking/rpc/debug/execution_witness.rs | 143   | -8   |
+---------------------------------------------------------+-------+------+

@avilagaston9 avilagaston9 marked this pull request as ready for review October 27, 2025 16:24
Copilot AI review requested due to automatic review settings October 27, 2025 16:24
@avilagaston9 avilagaston9 requested review from a team as code owners October 27, 2025 16:24
Comment on lines -142 to -148
let parent_header = context
.storage
.get_block_header_by_hash(header.parent_hash)?
.ok_or(RpcErr::Internal(
"Could not get parent block header".to_string(),
))?;
block_headers.push(parent_header);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was unused

Copy link
Contributor

Copilot AI left a comment

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 overrides the debug_executionWitness endpoint in L2 to properly handle block-specific fee configurations. The L1 RPC handler lacks access to the rollup_store which maintains the block_number -> fee_config mapping required for accurate execution witness generation in L2.

Key Changes:

  • Created a new L2-specific execution witness handler that fetches fee configurations from the rollup store
  • Removed unused block_headers collection logic from the L1 execution witness handler
  • Added endpoint override in the L2 RPC request mapper to intercept debug_executionWitness calls

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
crates/networking/rpc/debug/execution_witness.rs Removed unused parent block header collection logic
crates/l2/networking/rpc/rpc.rs Added override for debug_executionWitness to route to L2-specific handler
crates/l2/networking/rpc/l2/mod.rs Exposed new execution_witness module
crates/l2/networking/rpc/l2/execution_witness.rs Implemented L2-specific execution witness handler with fee config fetching

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

@avilagaston9 avilagaston9 moved this to In Review in ethrex_l2 Oct 27, 2025
@ilitteri ilitteri added this pull request to the merge queue Oct 27, 2025
Merged via the queue into main with commit 53711cd Oct 27, 2025
43 checks passed
@ilitteri ilitteri deleted the fix/l2/override_execution_witness_endpoint branch October 27, 2025 22:03
@github-project-automation github-project-automation bot moved this from In Review to Done in ethrex_l2 Oct 27, 2025
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.

4 participants