Skip to content
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

Use OpBlockExecutionError in op execution #13644

Open
Tracked by #13238
emhane opened this issue Jan 4, 2025 · 2 comments
Open
Tracked by #13238

Use OpBlockExecutionError in op execution #13644

emhane opened this issue Jan 4, 2025 · 2 comments
Assignees
Labels
A-execution Related to the Execution and EVM A-op-reth Related to Optimism and op-reth A-sdk Related to reth's use as a library C-debt Refactor of code section that is hard to understand or maintain

Comments

@emhane
Copy link
Member

emhane commented Jan 4, 2025

Describe the feature

Reveres relationship between op error and L1 error. The L1 error can occur on L2, hence it makes more sense to wrap it in the OP error, as opposed to converting the OP error to BlockExecutionError::Other and thereby loosing important type info.

Add variant OpBlockExecutionError::Eth that wraps a BlockExecutionError. Remove conversion from OpBlockExecutionError to BlockExecutionError.

/// Optimism Block Executor Errors
#[derive(Debug, Clone, PartialEq, Eq, thiserror::Error)]
pub enum OpBlockExecutionError {
/// Error when trying to parse L1 block info
#[error("could not get L1 block info from L2 block: {message}")]
L1BlockInfoError {
/// The inner error message
message: String,
},
/// Thrown when force deploy of create2deployer code fails.
#[error("failed to force create2deployer account code")]
ForceCreate2DeployerFail,
/// Thrown when a blob transaction is included in a sequencer's block.
#[error("blob transaction included in sequencer block")]
BlobTransactionRejected,
/// Thrown when a database account could not be loaded.
#[error("failed to load account {_0}")]
AccountLoadFailed(alloy_primitives::Address),
}
impl From<OpBlockExecutionError> for BlockExecutionError {
fn from(err: OpBlockExecutionError) -> Self {
Self::other(err)
}
}

Update op execution to use OpBlockExecutionError

type Error = BlockExecutionError;

Additional context

No response

@emhane emhane added A-execution Related to the Execution and EVM A-op-reth Related to Optimism and op-reth A-sdk Related to reth's use as a library C-debt Refactor of code section that is hard to understand or maintain labels Jan 4, 2025
@chungquantin
Copy link
Contributor

Can I work on this?

@chungquantin
Copy link
Contributor

Created a PR #13696 to tackle this issue but need opinions from core devs for additional progress on the PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-execution Related to the Execution and EVM A-op-reth Related to Optimism and op-reth A-sdk Related to reth's use as a library C-debt Refactor of code section that is hard to understand or maintain
Projects
Status: Todo
Development

No branches or pull requests

2 participants