Skip to content

Commit

Permalink
fix: let execute_revm_parallel return an Err instead of calling execu…
Browse files Browse the repository at this point in the history
…te_revm_sequential
  • Loading branch information
kien-rise committed Oct 9, 2024
1 parent c09f2a1 commit f9ec57d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/pevm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ pub enum PevmError<C: PevmChain> {
/// EVM execution error.
// TODO: More concrete types than just an arbitrary string.
ExecutionError(String),
/// Fallback to sequential
FallbackToSequential,
/// Impractical errors that should be unreachable.
/// The library has bugs if this is yielded.
UnreachableError,
Expand Down Expand Up @@ -202,8 +204,8 @@ impl Pevm {
if let Some(abort_reason) = self.abort_reason.take() {
match abort_reason {
AbortReason::FallbackToSequential => {
self.dropper.drop((mv_memory, scheduler, Vec::new()));
return execute_revm_sequential(storage, chain, spec_id, block_env, txs);
self.dropper.drop((mv_memory, scheduler, txs));
return Err(PevmError::FallbackToSequential);
}
AbortReason::ExecutionError(err) => {
self.dropper.drop((mv_memory, scheduler, txs));
Expand Down

0 comments on commit f9ec57d

Please sign in to comment.