feat: add missing canonical checks for safe+finalized block (#9765)

This commit is contained in:
Matthias Seitz
2024-07-24 17:52:20 +02:00
committed by GitHub
parent 9de9b7cb32
commit d395df29fc
2 changed files with 61 additions and 14 deletions

View File

@ -133,6 +133,11 @@ impl CanonicalInMemoryState {
Self { inner: Arc::new(inner) }
}
/// Returns in the header corresponding to the given hash.
pub fn header_by_hash(&self, hash: B256) -> Option<SealedHeader> {
self.state_by_hash(hash).map(|block| block.block().block.header.clone())
}
/// Append new blocks to the in memory state.
fn update_blocks<I>(&self, new_blocks: I, reorged: I)
where