From e6c4a81100bef6216f9d7ea973f908db1c72ba55 Mon Sep 17 00:00:00 2001 From: Thomas Coratger Date: Tue, 12 Dec 2023 17:57:45 +0100 Subject: [PATCH] add documentation for MakeCanonicalAction enum --- crates/blockchain-tree/src/metrics.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/crates/blockchain-tree/src/metrics.rs b/crates/blockchain-tree/src/metrics.rs index dcaaaafaaf33..7b5e22294ab6 100644 --- a/crates/blockchain-tree/src/metrics.rs +++ b/crates/blockchain-tree/src/metrics.rs @@ -58,16 +58,26 @@ impl MakeCanonicalDurationsRecorder { } } +/// Represents actions for making a canonical chain. #[derive(Debug, Copy, Clone)] pub(crate) enum MakeCanonicalAction { + /// Cloning old blocks for canonicalization. CloneOldBlocks, + /// Finding the canonical header. FindCanonicalHeader, + /// Splitting the chain for canonicalization. SplitChain, + /// Splitting chain forks for canonicalization. SplitChainForks, + /// Merging all chains for canonicalization. MergeAllChains, + /// Updating the canonical index during canonicalization. UpdateCanonicalIndex, + /// Committing the canonical chain to the database. CommitCanonicalChainToDatabase, + /// Reverting the canonical chain from the database. RevertCanonicalChainFromDatabase, + /// Inserting an old canonical chain. InsertOldCanonicalChain, }