Skip to content

Commit

Permalink
fix(state): check if storage revert is empty (#643)
Browse files Browse the repository at this point in the history
  • Loading branch information
rkrasiuk authored Aug 24, 2023
1 parent 0b9c12e commit afbc896
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions crates/revm/src/db/states/bundle_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -213,12 +213,14 @@ impl BundleState {
}
}

account_storage_changed.sort_by(|a, b| a.0.cmp(&b.0));
// append storage changes to account.
storage.push((
address,
(account.status.was_destroyed(), account_storage_changed),
));
if !account_storage_changed.is_empty() {
account_storage_changed.sort_by(|a, b| a.0.cmp(&b.0));
// append storage changes to account.
storage.push((
address,
(account.status.was_destroyed(), account_storage_changed),
));
}
}

accounts.par_sort_unstable_by(|a, b| a.0.cmp(&b.0));
Expand Down

0 comments on commit afbc896

Please sign in to comment.