chore: fix some typos (#2776)

This commit is contained in:
Matthias Seitz
2023-05-22 15:29:49 +02:00
committed by GitHub
parent b70afbb37f
commit 8ada7fd2ec
2 changed files with 9 additions and 7 deletions

View File

@@ -16,7 +16,7 @@ pub type BufferedBlocks = BTreeMap<BlockNumber, HashMap<BlockHash, SealedBlockWi
/// inserted.
/// * [BlockBuffer::clean_old_blocks] to clear old blocks that are below finalized line.
///
/// Note: Buffer is limited by number of blocks that it can contains and eviction of the block
/// Note: Buffer is limited by number of blocks that it can contain and eviction of the block
/// is done by last recently used block.
#[derive(Debug)]
pub struct BlockBuffer {

View File

@@ -268,7 +268,7 @@ impl<DB: Database, C: Consensus, EF: ExecutorFactory> BlockchainTree<DB, C, EF>
///
/// If blocks does not have parent [`BlockStatus::Disconnected`] would be returned, in which
/// case it is buffered for future inclusion.
#[instrument(skip_all, fields(block = ?block.num_hash()), target = "blockchain-tree", ret)]
#[instrument(skip_all, fields(block = ?block.num_hash()), target = "blockchain_tree", ret)]
pub fn try_insert_block(
&mut self,
block: SealedBlockWithSenders,
@@ -590,15 +590,17 @@ impl<DB: Database, C: Consensus, EF: ExecutorFactory> BlockchainTree<DB, C, EF>
Ok(())
}
/// Check if block is found inside chain and if the chain extends the canonical chain
/// if it does extends the canonical chain, return `BlockStatus::Valid`
/// if it does not extends the canonical chain, return `BlockStatus::Accepted`
/// Check if block is found inside chain and if the chain extends the canonical chain.
///
/// if it does extend the canonical chain, return `BlockStatus::Valid`
/// if it does not extend the canonical chain, return `BlockStatus::Accepted`
#[track_caller]
fn is_block_inside_chain(&self, block: &BlockNumHash) -> Option<BlockStatus> {
// check if block known and is already inside Tree
// check if block known and is already in the tree
if let Some(chain_id) = self.block_indices.get_blocks_chain_id(&block.hash) {
// find the canonical fork of this chain
let canonical_fork = self.canonical_fork(chain_id).expect("Chain id is valid");
// if blockchain extends canonical chain
// if the block's chain extends canonical chain
return if canonical_fork == self.block_indices.canonical_tip() {
Some(BlockStatus::Valid)
} else {