-
Notifications
You must be signed in to change notification settings - Fork 131
fix(l2): override execution witness endpoint #5063
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Lines of code reportTotal lines added: Detailed view |
| 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); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was unused
There was a problem hiding this 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_headerscollection logic from the L1 execution witness handler - Added endpoint override in the L2 RPC request mapper to intercept
debug_executionWitnesscalls
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.
Motivation
In L2, every block is executed with a specific
FeeConfigstored in therollup_store, following the mappingblock_number -> fee_config. Since the L1 RPC handler doesn’t have access to therollup_store, it’s impossible to properly generate the execution witness.Description
debug_executionWitnessendpoint from the L2 to fetch eachFeeConfigbefore generating the witnesses.Closes None