Skip to content

Commit d839500

Browse files
committed
fix
1 parent 6700b6d commit d839500

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

crates/evm/src/block/error.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,13 +160,16 @@ impl BlockExecutionError {
160160
/// Handles an EVM error occurred when executing a transaction.
161161
///
162162
/// If an error matches [`EvmError::InvalidTransaction`], it will be wrapped into
163-
/// [`BlockValidationError::InvalidTx`], otherwise into [`InternalBlockExecutionError::EVM`].
163+
/// [`BlockValidationError::InvalidTx`], otherwise if [`EvmError::is_fatal`] return `true`, the
164+
/// error would be wrapped into [`InternalBlockExecutionError::EVM`], otherwise it would be
165+
/// wrapped into [`BlockValidationError::EVM`].
164166
pub fn evm<E: EvmError>(error: E, hash: B256) -> Self {
165167
match error.try_into_invalid_tx_err() {
166168
Ok(err) => {
167169
Self::Validation(BlockValidationError::InvalidTx { hash, error: Box::new(err) })
168170
}
169171
Err(err) => {
172+
// Route errors based on whether they are fatal or not.
170173
if err.is_fatal() {
171174
Self::Internal(InternalBlockExecutionError::EVM { hash, error: Box::new(err) })
172175
} else {

0 commit comments

Comments
 (0)