perf(trie): add HashedPostStateSorted::from_reverts (#20047)

This commit is contained in:
YK
2025-12-03 13:05:23 +08:00
committed by GitHub
parent 98e9a1d09e
commit e0a6f54b42
11 changed files with 437 additions and 124 deletions

View File

@@ -310,9 +310,11 @@ fn run_case(
// Compute and check the post state root
let hashed_state =
HashedPostState::from_bundle_state::<KeccakKeyHasher>(output.state.state());
let (computed_state_root, _) =
StateRoot::overlay_root_with_updates(provider.tx_ref(), hashed_state.clone())
.map_err(|err| Error::block_failed(block_number, program_inputs.clone(), err))?;
let (computed_state_root, _) = StateRoot::overlay_root_with_updates(
provider.tx_ref(),
&hashed_state.clone_into_sorted(),
)
.map_err(|err| Error::block_failed(block_number, program_inputs.clone(), err))?;
if computed_state_root != block.state_root {
return Err(Error::block_failed(
block_number,