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

chore: remove more redundant BlockExecutionError variants #9905

Merged
merged 1 commit into from
Jul 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions crates/blockchain-tree-api/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -294,8 +294,6 @@ impl InsertBlockErrorKind {
// these are internal errors, not caused by an invalid block
BlockExecutionError::LatestBlock(_) |
BlockExecutionError::Pruning(_) |
BlockExecutionError::CanonicalRevert { .. } |
BlockExecutionError::CanonicalCommit { .. } |
BlockExecutionError::AppendChainDoesntConnect { .. } |
BlockExecutionError::Other(_) => false,
}
Expand Down
19 changes: 0 additions & 19 deletions crates/evm/execution-errors/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -125,18 +125,6 @@ pub enum BlockExecutionError {
/// Consensus error, transparently wrapping `ConsensusError`
#[error(transparent)]
Consensus(#[from] ConsensusError),
/// Transaction error on revert with inner details
#[error("transaction error on revert: {inner}")]
CanonicalRevert {
/// The inner error message
inner: String,
},
/// Transaction error on commit with inner details
#[error("transaction error on commit: {inner}")]
CanonicalCommit {
/// The inner error message.
inner: String,
},
/// Error when appending chain on fork is not possible
#[error(
"appending chain on fork (other_chain_fork:?) is not possible as the tip is {chain_tip:?}"
Expand Down Expand Up @@ -180,13 +168,6 @@ impl BlockExecutionError {
}
}

/// Returns `true` if the error is fatal.
///
/// This represents an unrecoverable database related error.
pub const fn is_fatal(&self) -> bool {
matches!(self, Self::CanonicalCommit { .. } | Self::CanonicalRevert { .. })
}

/// Returns `true` if the error is a state root error.
pub const fn is_state_root_error(&self) -> bool {
matches!(self, Self::Validation(BlockValidationError::StateRoot(_)))
Expand Down
Loading