Skip to content

Commit

Permalink
fix: simplify reorg handling (paradigmxyz#11592)
Browse files Browse the repository at this point in the history
  • Loading branch information
klkvr authored and ebo committed Oct 14, 2024
1 parent e08e44d commit b272c41
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions crates/engine/tree/src/tree/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -899,16 +899,9 @@ where
return Ok(None);
}

if old_hash == current_hash {
// We've found the fork point
break;
}

if let Some(block) = self.executed_block_by_hash(current_hash)? {
if self.is_fork(block.block.hash())? {
current_hash = block.block.parent_hash;
new_chain.push(block);
}
current_hash = block.block.parent_hash;
new_chain.push(block);
} else {
// This shouldn't happen as we've already walked this path
warn!(target: "engine::tree", invalid_hash=?current_hash, "New chain block not found in TreeState");
Expand Down

0 comments on commit b272c41

Please sign in to comment.