feat: set pending block in canonical memory (#9950)

This commit is contained in:
Matthias Seitz
2024-07-31 18:50:20 +02:00
committed by GitHub
parent b38a3aece1
commit d57163709f

View File

@ -1311,6 +1311,13 @@ where
hashed_state: Arc::new(hashed_state),
trie: Arc::new(trie_output),
};
if self.state.tree_state.canonical_block_hash() == executed.block().parent_hash {
debug!(target: "engine", pending = ?executed.block().num_hash() ,"updating pending block");
// if the parent is the canonical head, we can insert the block as the pending block
self.canonical_in_memory_state.set_pending_block(executed.clone());
}
self.state.tree_state.insert_executed(executed);
let attachment = BlockAttachment::Canonical; // TODO: remove or revise attachment