chore(tree): remove BlockchainTreeEngine::unwind (#7647)

This commit is contained in:
Roman Krasiuk
2024-04-15 11:45:05 +02:00
committed by GitHub
parent a2654650ba
commit 62eb8fd2b2
4 changed files with 0 additions and 19 deletions

View File

@ -56,10 +56,6 @@ impl BlockchainTreeEngine for NoopBlockchainTree {
fn make_canonical(&self, block_hash: BlockHash) -> Result<CanonicalOutcome, CanonicalError> {
Err(BlockchainTreeError::BlockHashNotFoundInChain { block_hash }.into())
}
fn unwind(&self, _unwind_to: BlockNumber) -> RethResult<()> {
Ok(())
}
}
impl BlockchainTreeViewer for NoopBlockchainTree {

View File

@ -101,14 +101,6 @@ where
tree.update_chains_metrics();
res
}
fn unwind(&self, unwind_to: BlockNumber) -> RethResult<()> {
trace!(target: "blockchain_tree", unwind_to, "Unwinding to block number");
let mut tree = self.tree.write();
let res = tree.unwind(unwind_to);
tree.update_chains_metrics();
res
}
}
impl<DB, EF> BlockchainTreeViewer for ShareableBlockchainTree<DB, EF>

View File

@ -97,9 +97,6 @@ pub trait BlockchainTreeEngine: BlockchainTreeViewer + Send + Sync {
///
/// Returns `Ok` if the blocks were canonicalized, or if the blocks were already canonical.
fn make_canonical(&self, block_hash: BlockHash) -> Result<CanonicalOutcome, CanonicalError>;
/// Unwind tables and put it inside state
fn unwind(&self, unwind_to: BlockNumber) -> RethResult<()>;
}
/// Represents the kind of validation that should be performed when inserting a block.

View File

@ -679,10 +679,6 @@ where
fn make_canonical(&self, block_hash: BlockHash) -> Result<CanonicalOutcome, CanonicalError> {
self.tree.make_canonical(block_hash)
}
fn unwind(&self, unwind_to: BlockNumber) -> RethResult<()> {
self.tree.unwind(unwind_to)
}
}
impl<DB, Tree> BlockchainTreeViewer for BlockchainProvider<DB, Tree>