mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
refactor(engine, tree): connect buffered blocks on pruner finish (#4613)
This commit is contained in:
@ -53,7 +53,8 @@ pub trait BlockchainTreeEngine: BlockchainTreeViewer + Send + Sync {
|
||||
fn finalize_block(&self, finalized_block: BlockNumber);
|
||||
|
||||
/// Reads the last `N` canonical hashes from the database and updates the block indices of the
|
||||
/// tree.
|
||||
/// tree by attempting to connect the buffered blocks to canonical hashes.
|
||||
///
|
||||
///
|
||||
/// `N` is the `max_reorg_depth` plus the number of block hashes needed to satisfy the
|
||||
/// `BLOCKHASH` opcode in the EVM.
|
||||
@ -62,17 +63,17 @@ pub trait BlockchainTreeEngine: BlockchainTreeViewer + Send + Sync {
|
||||
///
|
||||
/// This finalizes `last_finalized_block` prior to reading the canonical hashes (using
|
||||
/// [`BlockchainTreeEngine::finalize_block`]).
|
||||
fn restore_canonical_hashes_and_finalize(
|
||||
fn connect_buffered_blocks_to_canonical_hashes_and_finalize(
|
||||
&self,
|
||||
last_finalized_block: BlockNumber,
|
||||
) -> Result<(), Error>;
|
||||
|
||||
/// Reads the last `N` canonical hashes from the database and updates the block indices of the
|
||||
/// tree.
|
||||
/// tree by attempting to connect the buffered blocks to canonical hashes.
|
||||
///
|
||||
/// `N` is the `max_reorg_depth` plus the number of block hashes needed to satisfy the
|
||||
/// `BLOCKHASH` opcode in the EVM.
|
||||
fn restore_canonical_hashes(&self) -> Result<(), Error>;
|
||||
fn connect_buffered_blocks_to_canonical_hashes(&self) -> Result<(), Error>;
|
||||
|
||||
/// Make a block and its parent chain part of the canonical chain by committing it to the
|
||||
/// database.
|
||||
|
||||
Reference in New Issue
Block a user