From 477aa3fe53956accac367283db6742d97b0d367c Mon Sep 17 00:00:00 2001 From: Damian Nadales Date: Thu, 26 Sep 2024 14:38:19 +0200 Subject: [PATCH] Remove `cdbFutureBlocks` After https://github.com/IntersectMBO/ouroboros-consensus/pull/525, the `cdbFutureBlocks` field became unnecessary, as we now delay headers until they are no longer from the (near) future. --- .../Consensus/Storage/ChainDB/Impl.hs | 5 - .../Storage/ChainDB/Impl/ChainSel.hs | 247 ++++-------------- .../Consensus/Storage/ChainDB/Impl/Types.hs | 56 ---- 3 files changed, 58 insertions(+), 250 deletions(-) diff --git a/ouroboros-consensus/src/ouroboros-consensus/Ouroboros/Consensus/Storage/ChainDB/Impl.hs b/ouroboros-consensus/src/ouroboros-consensus/Ouroboros/Consensus/Storage/ChainDB/Impl.hs index 3a893568c5..e9c366fbad 100644 --- a/ouroboros-consensus/src/ouroboros-consensus/Ouroboros/Consensus/Storage/ChainDB/Impl.hs +++ b/ouroboros-consensus/src/ouroboros-consensus/Ouroboros/Consensus/Storage/ChainDB/Impl.hs @@ -144,7 +144,6 @@ openDBInternal args launchBgTasks = runWithTempRegistry $ do traceWith tracer $ TraceOpenEvent OpenedLgrDB varInvalid <- newTVarIO (WithFingerprint Map.empty (Fingerprint 0)) - varFutureBlocks <- newTVarIO Map.empty let initChainSelTracer = contramap TraceInitChainSelEvent tracer @@ -157,8 +156,6 @@ openDBInternal args launchBgTasks = runWithTempRegistry $ do initChainSelTracer (Args.cdbsTopLevelConfig cdbSpecificArgs) varInvalid - varFutureBlocks - (Args.cdbsCheckInFuture cdbSpecificArgs) (void initialLoE) traceWith initChainSelTracer InitialChainSelected @@ -197,9 +194,7 @@ openDBInternal args launchBgTasks = runWithTempRegistry $ do , cdbGcDelay = Args.cdbsGcDelay cdbSpecificArgs , cdbGcInterval = Args.cdbsGcInterval cdbSpecificArgs , cdbKillBgThreads = varKillBgThreads - , cdbCheckInFuture = Args.cdbsCheckInFuture cdbSpecificArgs , cdbChainSelQueue = chainSelQueue - , cdbFutureBlocks = varFutureBlocks , cdbLoE = Args.cdbsLoE cdbSpecificArgs } h <- fmap CDBHandle $ newTVarIO $ ChainDbOpen env diff --git a/ouroboros-consensus/src/ouroboros-consensus/Ouroboros/Consensus/Storage/ChainDB/Impl/ChainSel.hs b/ouroboros-consensus/src/ouroboros-consensus/Ouroboros/Consensus/Storage/ChainDB/Impl/ChainSel.hs index 66afcca5a4..2f27a0137a 100644 --- a/ouroboros-consensus/src/ouroboros-consensus/Ouroboros/Consensus/Storage/ChainDB/Impl/ChainSel.hs +++ b/ouroboros-consensus/src/ouroboros-consensus/Ouroboros/Consensus/Storage/ChainDB/Impl/ChainSel.hs @@ -21,7 +21,7 @@ module Ouroboros.Consensus.Storage.ChainDB.Impl.ChainSel ( ) where import Control.Exception (assert) -import Control.Monad (forM, forM_, unless, void, when) +import Control.Monad (forM, forM_, void, when) import Control.Monad.Except () import Control.Monad.Trans.Class (lift) import Control.Monad.Trans.State.Strict @@ -29,7 +29,7 @@ import Control.Tracer (Tracer, nullTracer, traceWith) import Data.Foldable (for_) import Data.Function (on) import Data.Functor.Contravariant ((>$<)) -import Data.List (partition, sortBy) +import Data.List (sortBy) import Data.List.NonEmpty (NonEmpty) import qualified Data.List.NonEmpty as NE import Data.Map.Strict (Map) @@ -43,8 +43,6 @@ import Ouroboros.Consensus.Block import Ouroboros.Consensus.Config import Ouroboros.Consensus.Fragment.Diff (ChainDiff (..)) import qualified Ouroboros.Consensus.Fragment.Diff as Diff -import Ouroboros.Consensus.Fragment.InFuture (CheckInFuture (..)) -import qualified Ouroboros.Consensus.Fragment.InFuture as InFuture import Ouroboros.Consensus.Fragment.Validated (ValidatedFragment) import qualified Ouroboros.Consensus.Fragment.Validated as VF import Ouroboros.Consensus.Fragment.ValidatedDiff @@ -92,7 +90,6 @@ import qualified Ouroboros.Network.AnchoredSeq as AS -- -- Returns the chosen validated chain and corresponding ledger. -- --- See "## Initialization" in ChainDB.md. initialChainSelection :: forall m blk. ( IOLike m @@ -105,14 +102,29 @@ initialChainSelection :: -> Tracer m (TraceInitChainSelEvent blk) -> TopLevelConfig blk -> StrictTVar m (WithFingerprint (InvalidBlocks blk)) - -> StrictTVar m (FutureBlocks m blk) - -> CheckInFuture m blk -> LoE () -> m (ChainAndLedger blk) initialChainSelection immutableDB volatileDB lgrDB tracer cfg varInvalid - varFutureBlocks futureCheck loE = do - -- We follow the steps from section "## Initialization" in ChainDB.md - + loE = do + -- TODO: Improve the user experience by trimming any potential + -- blocks from the future from the VolatileDB. + -- + -- When we perform chain selection, it is theoretically possible + -- that the blocks in the VolatileDB are from the future, if for + -- some reason the clock of the node was set back (by a + -- significant amount of time). This is a rare situation, but can + -- arise for instance if the clock of the node was set in the + -- **far** future. In this case, node will be disconnected from + -- other peers when diffusing these blocks. Once the node is + -- restarted with a synchronized clock, it will diffuse said + -- blocks from the future again (assuming they're still from the + -- future after restart), which will cause other nodes to + -- disconnect. By trimming blocks from the future from the + -- VolatileDB we can prevent this inconvenient, albeit extremely + -- rare, situation. However, it does not pose any security risk, + -- and a node operator can correct the problem by either wiping + -- out the VolatileDB or waiting enough time until the blocks are + -- not from the **far** future anymore. (i :: Anchor blk, succsOf, ledger) <- atomically $ do invalid <- forgetFingerprint <$> readTVar varInvalid (,,) @@ -218,8 +230,6 @@ initialChainSelection immutableDB volatileDB lgrDB tracer cfg varInvalid { lgrDB , bcfg , varInvalid - , varFutureBlocks - , futureCheck , blockCache = BlockCache.empty , curChainAndLedger , validationTracer = InitChainSelValidation >$< tracer @@ -337,24 +347,14 @@ chainSelSync cdb@CDB {..} (ChainSelAddBlock BlockToAdd { blockToAdd = b, .. }) = -- We follow the steps from section "## Adding a block" in ChainDB.md - -- Note: we call 'chainSelectionForFutureBlocks' in all branches instead - -- of once, before branching, because we want to do it /after/ writing the - -- block to the VolatileDB and delivering the 'varBlockWrittenToDisk' - -- promise, as this is the promise the BlockFetch client waits for. - -- Otherwise, the BlockFetch client would have to wait for - -- 'chainSelectionForFutureBlocks'. - - -- ### Ignore - newTip <- if + if | olderThanK hdr isEBB immBlockNo -> do lift $ traceWith addBlockTracer $ IgnoreBlockOlderThanK (blockRealPoint b) lift $ deliverWrittenToDisk False - chainSelectionForFutureBlocks cdb BlockCache.empty | isMember (blockHash b) -> do lift $ traceWith addBlockTracer $ IgnoreBlockAlreadyInVolatileDB (blockRealPoint b) lift $ deliverWrittenToDisk True - chainSelectionForFutureBlocks cdb BlockCache.empty | Just (InvalidBlockInfo reason _) <- Map.lookup (blockHash b) invalid -> do lift $ traceWith addBlockTracer $ IgnoreInvalidBlock (blockRealPoint b) reason @@ -366,21 +366,22 @@ chainSelSync cdb@CDB {..} (ChainSelAddBlock BlockToAdd { blockToAdd = b, .. }) = blockPunish InvalidBlockPunishment.BlockItself - chainSelectionForFutureBlocks cdb BlockCache.empty - -- The remaining cases | otherwise -> do let traceEv = AddedBlockToVolatileDB (blockRealPoint b) (blockNo b) isEBB lift $ encloseWith (traceEv >$< addBlockTracer) $ VolatileDB.putBlock cdbVolatileDB b lift $ deliverWrittenToDisk True + -- REVIEW: would the tip returned by + -- + -- > chainSelectionForBlock cdb (BlockCache.singleton b) hdr blockPunish + -- + -- equal + -- + -- > Query.getTipPoint cdb + void $ chainSelectionForBlock cdb (BlockCache.singleton b) hdr blockPunish - let blockCache = BlockCache.singleton b - -- Do chain selection for future blocks before chain selection for the - -- new block. When some future blocks are now older than the current - -- block, we will do chain selection in a more chronological order. - void $ chainSelectionForFutureBlocks cdb blockCache - chainSelectionForBlock cdb blockCache hdr blockPunish + newTip <- lift $ atomically $ Query.getTipPoint cdb lift $ deliverProcessed newTip where @@ -443,32 +444,6 @@ olderThanK hdr isEBB immBlockNo data ChainSwitchType = AddingBlocks | SwitchingToAFork deriving (Show, Eq) --- | Return the new tip. -chainSelectionForFutureBlocks :: - ( IOLike m - , LedgerSupportsProtocol blk - , BlockSupportsDiffusionPipelining blk - , InspectLedger blk - , HasHardForkHistory blk - , HasCallStack - ) - => ChainDbEnv m blk -> BlockCache blk -> Electric m (Point blk) -chainSelectionForFutureBlocks cdb@CDB{..} blockCache = do - -- Get 'cdbFutureBlocks' and empty the map in the TVar. It will be - -- repopulated with the blocks that are still from the future (but not the - -- ones no longer from the future) during chain selection for those - -- blocks. - futureBlockHeaders <- lift $ atomically $ do - futureBlocks <- readTVar cdbFutureBlocks - writeTVar cdbFutureBlocks Map.empty - return $ Map.elems futureBlocks - forM_ futureBlockHeaders $ \(hdr, punish) -> do - lift $ traceWith tracer $ ChainSelectionForFutureBlock (headerRealPoint hdr) - chainSelectionForBlock cdb blockCache hdr punish - lift $ atomically $ Query.getTipPoint cdb - where - tracer = TraceAddBlockEvent >$< cdbTracer - -- | Trigger chain selection for the given block. -- -- PRECONDITION: the block is in the VolatileDB. @@ -620,13 +595,11 @@ chainSelectionForBlock cdb@CDB{..} blockCache hdr punish = electric $ do { lgrDB = cdbLgrDB , bcfg = configBlock cdbTopLevelConfig , varInvalid = cdbInvalid - , varFutureBlocks = cdbFutureBlocks , varTentativeState = cdbTentativeState , varTentativeHeader = cdbTentativeHeader , getTentativeFollowers = filter ((TentativeChain ==) . fhChainType) . Map.elems <$> readTVar cdbFollowers - , futureCheck = cdbCheckInFuture , blockCache = blockCache , curChainAndLedger = curChainAndLedger , validationTracer = @@ -976,18 +949,16 @@ data ChainSelEnv m blk = ChainSelEnv , pipeliningTracer :: Tracer m (TracePipeliningEvent blk) , bcfg :: BlockConfig blk , varInvalid :: StrictTVar m (WithFingerprint (InvalidBlocks blk)) - , varFutureBlocks :: StrictTVar m (FutureBlocks m blk) , varTentativeState :: StrictTVar m (TentativeHeaderState blk) , varTentativeHeader :: StrictTVar m (StrictMaybe (Header blk)) , getTentativeFollowers :: STM m [FollowerHandle m blk] - , futureCheck :: CheckInFuture m blk , blockCache :: BlockCache blk , curChainAndLedger :: ChainAndLedger blk -- | The block that this chain selection invocation is processing, and the -- punish action for the peer that sent that block; see -- 'InvalidBlockPunishment'. -- - -- Two notable subtleties: + -- One subtlety: -- -- o If a BlockFetch client adds an invalid block but that block isn't -- part of any desirable paths through the VolDB, then we won't attempt @@ -996,14 +967,9 @@ data ChainSelEnv m blk = ChainSelEnv -- our focus to a another peer offering better blocks and so this peer -- is no longer causing us BlockFetch work. -- - -- o If the block is frome the future but with clock skew, we'll add it to - -- 'varFutureBlocks'. We retain the punishment information, so that if - -- the peer is still active once we do process that block, we're still - -- able to punish them. - -- - -- Thus invalid blocks can be skipped entirely or somewhat-arbitrarily - -- delayed. This is part of the reason we bothered to restrict the - -- expressiveness of the 'InvalidBlockPunishment' combiantors. + -- Thus invalid blocks can be skipped entirely. This is part of + -- the reason we bothered to restrict the expressiveness of the + -- 'InvalidBlockPunishment' combinators. , punish :: Maybe (RealPoint blk, InvalidBlockPunishment m) } @@ -1072,8 +1038,8 @@ chainSelection chainSelEnv chainDiffs = ValidPrefix candidate' -> do whenJust mTentativeHeader clearTentativeHeader -- Prefix of the candidate because it contained rejected blocks - -- (invalid blocks and/or blocks from the future). Note that the - -- spec says go back to candidate selection, see [^whyGoBack], + -- (invalid blocks). Note that the + -- spec says go back to candidate selection, -- because there might still be some candidates that contain the -- same rejected block. To simplify the control flow, we do it -- differently: instead of recomputing the candidates taking @@ -1132,20 +1098,15 @@ chainSelection chainSelEnv chainDiffs = -- blocks. Discard them if they are truncated so much that they are no -- longer preferred over the current chain. -- - -- A block is rejected if: - -- - -- * It is invalid (present in 'varInvalid', i.e., 'cdbInvalid'). - -- * It is from the future (present in 'varFutureBlocks', i.e., - -- 'cdbFutureBlocks'). + -- A block is rejected if it is invalid (present in 'varInvalid', + -- i.e., 'cdbInvalid'). truncateRejectedBlocks :: [ChainDiff (Header blk)] -> m [ChainDiff (Header blk)] truncateRejectedBlocks cands = do - (invalid, futureBlocks) <- - atomically $ (,) <$> readTVar varInvalid <*> readTVar varFutureBlocks + invalid <- atomically $ readTVar varInvalid let isRejected hdr = Map.member (headerHash hdr) (forgetFingerprint invalid) - || Map.member (headerHash hdr) futureBlocks return $ filter (preferAnchoredCandidate bcfg curChain . Diff.getSuffix) $ map (Diff.takeWhileOldest (not . isRejected)) cands @@ -1168,15 +1129,14 @@ chainSelection chainSelEnv chainDiffs = -- | Result of 'validateCandidate'. data ValidationResult blk = - -- | The entire candidate fragment was valid. No blocks were from the - -- future. + -- | The entire candidate fragment was valid. FullyValid (ValidatedChainDiff (Header blk) (LedgerDB' blk)) - -- | The candidate fragment contained invalid blocks and/or blocks from - -- the future that had to be truncated from the fragment. + -- | The candidate fragment contained invalid blocks that had to + -- be truncated from the fragment. | ValidPrefix (ChainDiff (Header blk)) - -- | After truncating the invalid blocks or blocks from the future from + -- | After truncating the invalid blocks from -- the 'ChainDiff', it no longer contains enough blocks in its suffix to -- compensate for the number of blocks it wants to roll back. | InsufficientSuffix @@ -1274,89 +1234,7 @@ ledgerValidateCandidate chainSelEnv chainDiff@(ChainDiff rollback suffix) = (Map.insert hash (InvalidBlockInfo (ValidationError e) slot) invalid) (succ fp) --- | Truncate any future headers from the candidate 'ValidatedChainDiff'. --- --- Future headers that don't exceed the clock skew --- ('inFutureExceedsClockSkew') are added to 'cdbFutureBlocks'. --- --- Future headers that exceed the clock skew are added to 'cdbInvalid' with --- 'InFutureExceedsClockSkew' as the reason. --- --- When truncation happened, 'Left' is returned, otherwise 'Right'. -futureCheckCandidate :: - forall m blk. (IOLike m, LedgerSupportsProtocol blk) - => ChainSelEnv m blk - -> ValidatedChainDiff (Header blk) (LedgerDB' blk) - -> m (Either (ChainDiff (Header blk)) - (ValidatedChainDiff (Header blk) (LedgerDB' blk))) -futureCheckCandidate chainSelEnv validatedChainDiff = - checkInFuture futureCheck validatedSuffix >>= \case - - (suffix', []) -> - -- If no headers are in the future, then the fragment must be untouched - assert (AF.headPoint suffix == AF.headPoint suffix') $ - return $ Right validatedChainDiff - - (suffix', inFuture) -> do - let (exceedClockSkew, inNearFuture) = - partition InFuture.inFutureExceedsClockSkew inFuture - -- Record future blocks - unless (null inNearFuture) $ do - let futureBlocks = Map.fromList - [ (headerHash hdr, (hdr, InFuture.inFuturePunish x)) - | x <- inNearFuture - , let hdr = InFuture.inFutureHeader x - ] - atomically $ modifyTVar varFutureBlocks $ flip Map.union futureBlocks - -- Trace the original @suffix@, as it contains the headers from the - -- future - traceWith validationTracer $ - CandidateContainsFutureBlocks - suffix - (InFuture.inFutureHeader <$> inNearFuture) - - -- Record any blocks exceeding the clock skew as invalid - unless (null exceedClockSkew) $ do - let invalidHeaders = InFuture.inFutureHeader <$> exceedClockSkew - invalidBlocks = Map.fromList - [ (headerHash hdr, info) - | hdr <- invalidHeaders - , let reason = InFutureExceedsClockSkew (headerRealPoint hdr) - info = InvalidBlockInfo reason (blockSlot hdr) - ] - atomically $ modifyTVar varInvalid $ \(WithFingerprint invalid fp) -> - WithFingerprint (Map.union invalid invalidBlocks) (succ fp) - traceWith validationTracer $ - CandidateContainsFutureBlocksExceedingClockSkew - -- Trace the original @suffix@, as it contains the headers - -- from the future - suffix - invalidHeaders - - -- It's possible the block's prefix is invalid, but we can't know for - -- sure. So we use 'InvalidBlockPunishment.BlockItself' to be more - -- conservative. - forM_ exceedClockSkew $ \x -> do - InvalidBlockPunishment.enact - (InFuture.inFuturePunish x) - InvalidBlockPunishment.BlockItself - - -- Truncate the original 'ChainDiff' to match the truncated - -- 'AnchoredFragment'. - return $ Left $ Diff.truncate (castPoint (AF.headPoint suffix')) chainDiff - where - ChainSelEnv { validationTracer, varInvalid, varFutureBlocks, futureCheck } = - chainSelEnv - - ValidatedChainDiff chainDiff@(ChainDiff _ suffix) _ = validatedChainDiff - - validatedSuffix :: ValidatedFragment (Header blk) (LedgerState blk) - validatedSuffix = - ledgerState . LgrDB.ledgerDbCurrent <$> - ValidatedDiff.toValidatedFragment validatedChainDiff - --- | Validate a candidate chain using 'ledgerValidateCandidate' and --- 'futureCheck'. +-- | Validate a candidate chain using 'ledgerValidateCandidate'. validateCandidate :: ( IOLike m , LedgerSupportsProtocol blk @@ -1370,28 +1248,19 @@ validateCandidate chainSelEnv chainDiff = validatedChainDiff | ValidatedDiff.rollbackExceedsSuffix validatedChainDiff -> return InsufficientSuffix + + | AF.length (Diff.getSuffix chainDiff) == AF.length (Diff.getSuffix chainDiff') + -- No truncation + -> return $ FullyValid validatedChainDiff + | otherwise - -> futureCheckCandidate chainSelEnv validatedChainDiff >>= \case - Left chainDiff' - | Diff.rollbackExceedsSuffix chainDiff' - -> return InsufficientSuffix - | otherwise - -> return $ ValidPrefix chainDiff' - Right validatedChainDiff' - | ValidatedDiff.rollbackExceedsSuffix validatedChainDiff' - -> return InsufficientSuffix - | AF.length (Diff.getSuffix chainDiff) == - AF.length (Diff.getSuffix chainDiff') - -- No truncation - -> return $ FullyValid validatedChainDiff' - | otherwise - -- In case of invalid blocks but no blocks from the future, we - -- throw away the ledger corresponding to the truncated - -- fragment and will have to validate it again, even when it's - -- the sole candidate. - -> return $ ValidPrefix chainDiff' - where - chainDiff' = ValidatedDiff.getChainDiff validatedChainDiff' + -- In case of invalid blocks, we throw away the ledger + -- corresponding to the truncated fragment and will have to + -- validate it again, even when it's the sole candidate. + -> return $ ValidPrefix chainDiff' + + where + chainDiff' = ValidatedDiff.getChainDiff validatedChainDiff {------------------------------------------------------------------------------- 'ChainAndLedger' diff --git a/ouroboros-consensus/src/ouroboros-consensus/Ouroboros/Consensus/Storage/ChainDB/Impl/Types.hs b/ouroboros-consensus/src/ouroboros-consensus/Ouroboros/Consensus/Storage/ChainDB/Impl/Types.hs index f696a509e9..4c3e2071a5 100644 --- a/ouroboros-consensus/src/ouroboros-consensus/Ouroboros/Consensus/Storage/ChainDB/Impl/Types.hs +++ b/ouroboros-consensus/src/ouroboros-consensus/Ouroboros/Consensus/Storage/ChainDB/Impl/Types.hs @@ -39,8 +39,6 @@ module Ouroboros.Consensus.Storage.ChainDB.Impl.Types ( -- * Invalid blocks , InvalidBlockInfo (..) , InvalidBlocks - -- * Future blocks - , FutureBlocks -- * Blocks to add , BlockToAdd (..) , ChainSelMessage (..) @@ -78,7 +76,6 @@ import NoThunks.Class (OnlyCheckWhnfNamed (..)) import Ouroboros.Consensus.Block import Ouroboros.Consensus.Config import Ouroboros.Consensus.Fragment.Diff (ChainDiff) -import Ouroboros.Consensus.Fragment.InFuture (CheckInFuture) import Ouroboros.Consensus.Ledger.Extended (ExtValidationError) import Ouroboros.Consensus.Ledger.Inspect import Ouroboros.Consensus.Ledger.SupportsProtocol @@ -248,27 +245,8 @@ data ChainDbEnv m blk = CDB -- garbage collections. , cdbKillBgThreads :: !(StrictTVar m (m ())) -- ^ A handle to kill the background threads. - , cdbCheckInFuture :: !(CheckInFuture m blk) , cdbChainSelQueue :: !(ChainSelQueue m blk) -- ^ Queue of blocks that still have to be added. - , cdbFutureBlocks :: !(StrictTVar m (FutureBlocks m blk)) - -- ^ Blocks from the future - -- - -- Blocks that were added to the ChainDB but that were from the future - -- according to 'CheckInFuture', without exceeding the clock skew - -- ('inFutureExceedsClockSkew'). Blocks exceeding the clock skew are - -- considered to be invalid ('InFutureExceedsClockSkew') and will be added - -- 'cdbInvalid'. - -- - -- Whenever a block is added to the ChainDB, we first trigger chain - -- selection for all the blocks in this map so that blocks no longer from - -- the future can get adopted. Note that when no blocks are added to the - -- ChainDB, we will /not/ actively trigger chain selection for the blocks - -- in this map. - -- - -- The number of blocks from the future is bounded by the number of - -- upstream peers multiplied by the max clock skew divided by the slot - -- length. , cdbLoE :: !(m (LoE (AnchoredFragment (Header blk)))) -- ^ Configure the Limit on Eagerness. If this is 'LoEEnabled', it contains -- an action that returns the LoE fragment, which indicates the latest rollback @@ -426,16 +404,6 @@ data InvalidBlockInfo blk = InvalidBlockInfo , invalidBlockSlotNo :: !SlotNo } deriving (Eq, Show, Generic, NoThunks) -{------------------------------------------------------------------------------- - Future blocks --------------------------------------------------------------------------------} - --- | Blocks from the future for which we still need to trigger chain --- selection. --- --- See 'cdbFutureBlocks' for more info. -type FutureBlocks m blk = Map (HeaderHash blk) (Header blk, InvalidBlockPunishment m) - {------------------------------------------------------------------------------- Blocks to add -------------------------------------------------------------------------------} @@ -666,10 +634,6 @@ data TraceAddBlockEvent blk = -- | ChainSel will reprocess blocks that were postponed by the LoE. | PoppedReprocessLoEBlocksFromQueue - -- | The block is from the future, i.e., its slot number is greater than - -- the current slot (the second argument). - | BlockInTheFuture (RealPoint blk) SlotNo - -- | A block was added to the Volatile DB | AddedBlockToVolatileDB (RealPoint blk) BlockNo IsEBB Enclosing @@ -709,11 +673,6 @@ data TraceAddBlockEvent blk = -- | An event traced during validating performed while adding a block. | AddBlockValidation (TraceValidationEvent blk) - -- | Run chain selection for a block that was previously from the future. - -- This is done for all blocks from the future each time a new block is - -- added. - | ChainSelectionForFutureBlock (RealPoint blk) - -- | The tentative header (in the context of diffusion pipelining) has been -- updated. | PipeliningEvent (TracePipeliningEvent blk) @@ -744,21 +703,6 @@ data TraceValidationEvent blk = -- | A candidate chain was valid. | ValidCandidate (AnchoredFragment (Header blk)) - -- | Candidate contains headers from the future which do no exceed the - -- clock skew. - | CandidateContainsFutureBlocks - (AnchoredFragment (Header blk)) - -- ^ Candidate chain containing headers from the future - [Header blk] - -- ^ Headers from the future, not exceeding clock skew - - -- | Candidate contains headers from the future which exceed the - -- clock skew, making them invalid. - | CandidateContainsFutureBlocksExceedingClockSkew - (AnchoredFragment (Header blk)) - -- ^ Candidate chain containing headers from the future - [Header blk] - -- ^ Headers from the future, exceeding clock skew | UpdateLedgerDbTraceEvent (UpdateLedgerDbTraceEvent blk) deriving (Generic)