{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveAnyClass #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DerivingVia #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE StandaloneDeriving #-}
{-# LANGUAGE TypeApplications #-}
{-# LANGUAGE UndecidableInstances #-}
module Ouroboros.Consensus.Storage.ChainDB.Impl.Types (
SerialiseDiskConstraints
, ChainDbHandle (..)
, getEnv
, getEnv1
, getEnv2
, getEnvSTM
, getEnvSTM1
, ChainDbState (..)
, ChainDbEnv (..)
, Internal (..)
, IteratorKey (..)
, ReaderKey (..)
, ReaderHandle (..)
, ReaderState (..)
, ReaderRollState (..)
, readerRollStatePoint
, InvalidBlocks
, InvalidBlockInfo (..)
, FutureBlocks
, BlocksToAdd
, BlockToAdd (..)
, newBlocksToAdd
, addBlockToAdd
, getBlockToAdd
, TraceEvent (..)
, NewTipInfo (..)
, TraceAddBlockEvent (..)
, TraceReaderEvent (..)
, TraceCopyToImmutableDBEvent (..)
, TraceGCEvent (..)
, TraceValidationEvent (..)
, TraceInitChainSelEvent (..)
, TraceOpenEvent (..)
, TraceIteratorEvent (..)
) where
import Control.Tracer
import Data.Map.Strict (Map)
import Data.Typeable
import Data.Void (Void)
import Data.Word (Word64)
import GHC.Generics (Generic)
import NoThunks.Class (OnlyCheckWhnfNamed (..))
import Control.Monad.Class.MonadSTM.Strict (newEmptyTMVarIO)
import Ouroboros.Network.AnchoredFragment (AnchoredFragment)
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
import Ouroboros.Consensus.Util.CallStack
import Ouroboros.Consensus.Util.IOLike
import Ouroboros.Consensus.Util.ResourceRegistry
import Ouroboros.Consensus.Util.STM (WithFingerprint)
import Ouroboros.Consensus.Storage.ChainDB.API (AddBlockPromise (..),
ChainDbError (..), InvalidBlockReason, StreamFrom,
StreamTo, UnknownRange)
import Ouroboros.Consensus.Storage.Serialisation
import Ouroboros.Consensus.Storage.ChainDB.Impl.LgrDB (LedgerDB',
LgrDB, LgrDbSerialiseConstraints)
import qualified Ouroboros.Consensus.Storage.ChainDB.Impl.LgrDB as LgrDB
import Ouroboros.Consensus.Storage.ImmutableDB (ImmutableDB,
ImmutableDbSerialiseConstraints)
import qualified Ouroboros.Consensus.Storage.ImmutableDB as ImmutableDB
import Ouroboros.Consensus.Storage.VolatileDB (VolatileDB,
VolatileDbSerialiseConstraints)
import qualified Ouroboros.Consensus.Storage.VolatileDB as VolatileDB
class ( ImmutableDbSerialiseConstraints blk
, LgrDbSerialiseConstraints blk
, VolatileDbSerialiseConstraints blk
, EncodeDiskDep (NestedCtxt Header) blk
) => SerialiseDiskConstraints blk
newtype ChainDbHandle m blk = CDBHandle (StrictTVar m (ChainDbState m blk))
getEnv :: forall m blk r. (IOLike m, HasCallStack)
=> ChainDbHandle m blk
-> (ChainDbEnv m blk -> m r)
-> m r
getEnv :: ChainDbHandle m blk -> (ChainDbEnv m blk -> m r) -> m r
getEnv (CDBHandle StrictTVar m (ChainDbState m blk)
varState) ChainDbEnv m blk -> m r
f = STM m (ChainDbState m blk) -> m (ChainDbState m blk)
forall (m :: * -> *) a.
(MonadSTM m, HasCallStack) =>
STM m a -> m a
atomically (StrictTVar m (ChainDbState m blk) -> STM m (ChainDbState m blk)
forall (m :: * -> *) a. MonadSTM m => StrictTVar m a -> STM m a
readTVar StrictTVar m (ChainDbState m blk)
varState) m (ChainDbState m blk) -> (ChainDbState m blk -> m r) -> m r
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \case
ChainDbOpen ChainDbEnv m blk
env -> ChainDbEnv m blk -> m r
f ChainDbEnv m blk
env
ChainDbState m blk
ChainDbClosed -> ChainDbError -> m r
forall (m :: * -> *) e a. (MonadThrow m, Exception e) => e -> m a
throwIO (ChainDbError -> m r) -> ChainDbError -> m r
forall a b. (a -> b) -> a -> b
$ PrettyCallStack -> ChainDbError
ClosedDBError PrettyCallStack
HasCallStack => PrettyCallStack
prettyCallStack
getEnv1 :: (IOLike m, HasCallStack)
=> ChainDbHandle m blk
-> (ChainDbEnv m blk -> a -> m r)
-> a -> m r
getEnv1 :: ChainDbHandle m blk -> (ChainDbEnv m blk -> a -> m r) -> a -> m r
getEnv1 ChainDbHandle m blk
h ChainDbEnv m blk -> a -> m r
f a
a = ChainDbHandle m blk -> (ChainDbEnv m blk -> m r) -> m r
forall (m :: * -> *) blk r.
(IOLike m, HasCallStack) =>
ChainDbHandle m blk -> (ChainDbEnv m blk -> m r) -> m r
getEnv ChainDbHandle m blk
h (\ChainDbEnv m blk
env -> ChainDbEnv m blk -> a -> m r
f ChainDbEnv m blk
env a
a)
getEnv2 :: (IOLike m, HasCallStack)
=> ChainDbHandle m blk
-> (ChainDbEnv m blk -> a -> b -> m r)
-> a -> b -> m r
getEnv2 :: ChainDbHandle m blk
-> (ChainDbEnv m blk -> a -> b -> m r) -> a -> b -> m r
getEnv2 ChainDbHandle m blk
h ChainDbEnv m blk -> a -> b -> m r
f a
a b
b = ChainDbHandle m blk -> (ChainDbEnv m blk -> m r) -> m r
forall (m :: * -> *) blk r.
(IOLike m, HasCallStack) =>
ChainDbHandle m blk -> (ChainDbEnv m blk -> m r) -> m r
getEnv ChainDbHandle m blk
h (\ChainDbEnv m blk
env -> ChainDbEnv m blk -> a -> b -> m r
f ChainDbEnv m blk
env a
a b
b)
getEnvSTM :: forall m blk r. (IOLike m, HasCallStack)
=> ChainDbHandle m blk
-> (ChainDbEnv m blk -> STM m r)
-> STM m r
getEnvSTM :: ChainDbHandle m blk -> (ChainDbEnv m blk -> STM m r) -> STM m r
getEnvSTM (CDBHandle StrictTVar m (ChainDbState m blk)
varState) ChainDbEnv m blk -> STM m r
f = StrictTVar m (ChainDbState m blk) -> STM m (ChainDbState m blk)
forall (m :: * -> *) a. MonadSTM m => StrictTVar m a -> STM m a
readTVar StrictTVar m (ChainDbState m blk)
varState STM m (ChainDbState m blk)
-> (ChainDbState m blk -> STM m r) -> STM m r
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \case
ChainDbOpen ChainDbEnv m blk
env -> ChainDbEnv m blk -> STM m r
f ChainDbEnv m blk
env
ChainDbState m blk
ChainDbClosed -> ChainDbError -> STM m r
forall (stm :: * -> *) e a.
(MonadSTMTx stm, MonadThrow stm, Exception e) =>
e -> stm a
throwSTM (ChainDbError -> STM m r) -> ChainDbError -> STM m r
forall a b. (a -> b) -> a -> b
$ PrettyCallStack -> ChainDbError
ClosedDBError PrettyCallStack
HasCallStack => PrettyCallStack
prettyCallStack
getEnvSTM1 ::
(IOLike m, HasCallStack)
=> ChainDbHandle m blk
-> (ChainDbEnv m blk -> a -> STM m r)
-> a -> STM m r
getEnvSTM1 :: ChainDbHandle m blk
-> (ChainDbEnv m blk -> a -> STM m r) -> a -> STM m r
getEnvSTM1 (CDBHandle StrictTVar m (ChainDbState m blk)
varState) ChainDbEnv m blk -> a -> STM m r
f a
a = StrictTVar m (ChainDbState m blk) -> STM m (ChainDbState m blk)
forall (m :: * -> *) a. MonadSTM m => StrictTVar m a -> STM m a
readTVar StrictTVar m (ChainDbState m blk)
varState STM m (ChainDbState m blk)
-> (ChainDbState m blk -> STM m r) -> STM m r
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \case
ChainDbOpen ChainDbEnv m blk
env -> ChainDbEnv m blk -> a -> STM m r
f ChainDbEnv m blk
env a
a
ChainDbState m blk
ChainDbClosed -> ChainDbError -> STM m r
forall (stm :: * -> *) e a.
(MonadSTMTx stm, MonadThrow stm, Exception e) =>
e -> stm a
throwSTM (ChainDbError -> STM m r) -> ChainDbError -> STM m r
forall a b. (a -> b) -> a -> b
$ PrettyCallStack -> ChainDbError
ClosedDBError PrettyCallStack
HasCallStack => PrettyCallStack
prettyCallStack
data ChainDbState m blk
= ChainDbOpen !(ChainDbEnv m blk)
| ChainDbClosed
deriving ((forall x. ChainDbState m blk -> Rep (ChainDbState m blk) x)
-> (forall x. Rep (ChainDbState m blk) x -> ChainDbState m blk)
-> Generic (ChainDbState m blk)
forall x. Rep (ChainDbState m blk) x -> ChainDbState m blk
forall x. ChainDbState m blk -> Rep (ChainDbState m blk) x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall (m :: * -> *) blk x.
Rep (ChainDbState m blk) x -> ChainDbState m blk
forall (m :: * -> *) blk x.
ChainDbState m blk -> Rep (ChainDbState m blk) x
$cto :: forall (m :: * -> *) blk x.
Rep (ChainDbState m blk) x -> ChainDbState m blk
$cfrom :: forall (m :: * -> *) blk x.
ChainDbState m blk -> Rep (ChainDbState m blk) x
Generic, Context -> ChainDbState m blk -> IO (Maybe ThunkInfo)
Proxy (ChainDbState m blk) -> String
(Context -> ChainDbState m blk -> IO (Maybe ThunkInfo))
-> (Context -> ChainDbState m blk -> IO (Maybe ThunkInfo))
-> (Proxy (ChainDbState m blk) -> String)
-> NoThunks (ChainDbState m blk)
forall a.
(Context -> a -> IO (Maybe ThunkInfo))
-> (Context -> a -> IO (Maybe ThunkInfo))
-> (Proxy a -> String)
-> NoThunks a
forall (m :: * -> *) blk.
(IOLike m, LedgerSupportsProtocol blk) =>
Context -> ChainDbState m blk -> IO (Maybe ThunkInfo)
forall (m :: * -> *) blk.
(IOLike m, LedgerSupportsProtocol blk) =>
Proxy (ChainDbState m blk) -> String
showTypeOf :: Proxy (ChainDbState m blk) -> String
$cshowTypeOf :: forall (m :: * -> *) blk.
(IOLike m, LedgerSupportsProtocol blk) =>
Proxy (ChainDbState m blk) -> String
wNoThunks :: Context -> ChainDbState m blk -> IO (Maybe ThunkInfo)
$cwNoThunks :: forall (m :: * -> *) blk.
(IOLike m, LedgerSupportsProtocol blk) =>
Context -> ChainDbState m blk -> IO (Maybe ThunkInfo)
noThunks :: Context -> ChainDbState m blk -> IO (Maybe ThunkInfo)
$cnoThunks :: forall (m :: * -> *) blk.
(IOLike m, LedgerSupportsProtocol blk) =>
Context -> ChainDbState m blk -> IO (Maybe ThunkInfo)
NoThunks)
data ChainDbEnv m blk = CDB
{ ChainDbEnv m blk -> ImmutableDB m blk
cdbImmutableDB :: !(ImmutableDB m blk)
, ChainDbEnv m blk -> VolatileDB m blk
cdbVolatileDB :: !(VolatileDB m blk)
, ChainDbEnv m blk -> LgrDB m blk
cdbLgrDB :: !(LgrDB m blk)
, ChainDbEnv m blk -> StrictTVar m (AnchoredFragment (Header blk))
cdbChain :: !(StrictTVar m (AnchoredFragment (Header blk)))
, ChainDbEnv m blk -> StrictTVar m (Map IteratorKey (m ()))
cdbIterators :: !(StrictTVar m (Map IteratorKey (m ())))
, ChainDbEnv m blk
-> StrictTVar m (Map ReaderKey (ReaderHandle m blk))
cdbReaders :: !(StrictTVar m (Map ReaderKey (ReaderHandle m blk)))
, ChainDbEnv m blk -> TopLevelConfig blk
cdbTopLevelConfig :: !(TopLevelConfig blk)
, ChainDbEnv m blk
-> StrictTVar m (WithFingerprint (InvalidBlocks blk))
cdbInvalid :: !(StrictTVar m (WithFingerprint (InvalidBlocks blk)))
, ChainDbEnv m blk -> StrictTVar m IteratorKey
cdbNextIteratorKey :: !(StrictTVar m IteratorKey)
, ChainDbEnv m blk -> StrictTVar m ReaderKey
cdbNextReaderKey :: !(StrictTVar m ReaderKey)
, ChainDbEnv m blk -> StrictMVar m ()
cdbCopyLock :: !(StrictMVar m ())
, ChainDbEnv m blk -> Tracer m (TraceEvent blk)
cdbTracer :: !(Tracer m (TraceEvent blk))
, ChainDbEnv m blk -> Tracer m (LedgerDB' blk)
cdbTraceLedger :: !(Tracer m (LedgerDB' blk))
, ChainDbEnv m blk -> ResourceRegistry m
cdbRegistry :: !(ResourceRegistry m)
, ChainDbEnv m blk -> DiffTime
cdbGcDelay :: !DiffTime
, ChainDbEnv m blk -> DiffTime
cdbGcInterval :: !DiffTime
, ChainDbEnv m blk -> StrictTVar m (m ())
cdbKillBgThreads :: !(StrictTVar m (m ()))
, ChainDbEnv m blk -> ChunkInfo
cdbChunkInfo :: !ImmutableDB.ChunkInfo
, ChainDbEnv m blk -> blk -> Bool
cdbCheckIntegrity :: !(blk -> Bool)
, ChainDbEnv m blk -> CheckInFuture m blk
cdbCheckInFuture :: !(CheckInFuture m blk)
, ChainDbEnv m blk -> BlocksToAdd m blk
cdbBlocksToAdd :: !(BlocksToAdd m blk)
, ChainDbEnv m blk -> StrictTVar m (FutureBlocks blk)
cdbFutureBlocks :: !(StrictTVar m (FutureBlocks blk))
} deriving ((forall x. ChainDbEnv m blk -> Rep (ChainDbEnv m blk) x)
-> (forall x. Rep (ChainDbEnv m blk) x -> ChainDbEnv m blk)
-> Generic (ChainDbEnv m blk)
forall x. Rep (ChainDbEnv m blk) x -> ChainDbEnv m blk
forall x. ChainDbEnv m blk -> Rep (ChainDbEnv m blk) x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall (m :: * -> *) blk x.
Rep (ChainDbEnv m blk) x -> ChainDbEnv m blk
forall (m :: * -> *) blk x.
ChainDbEnv m blk -> Rep (ChainDbEnv m blk) x
$cto :: forall (m :: * -> *) blk x.
Rep (ChainDbEnv m blk) x -> ChainDbEnv m blk
$cfrom :: forall (m :: * -> *) blk x.
ChainDbEnv m blk -> Rep (ChainDbEnv m blk) x
Generic)
instance (IOLike m, LedgerSupportsProtocol blk)
=> NoThunks (ChainDbEnv m blk) where
showTypeOf :: Proxy (ChainDbEnv m blk) -> String
showTypeOf Proxy (ChainDbEnv m blk)
_ = String
"ChainDbEnv m " String -> String -> String
forall a. [a] -> [a] -> [a]
++ TypeRep -> String
forall a. Show a => a -> String
show (Proxy blk -> TypeRep
forall k (proxy :: k -> *) (a :: k).
Typeable a =>
proxy a -> TypeRep
typeRep (Proxy blk
forall k (t :: k). Proxy t
Proxy @blk))
data Internal m blk = Internal
{ Internal m blk -> m (WithOrigin SlotNo)
intCopyToImmutableDB :: m (WithOrigin SlotNo)
, Internal m blk -> SlotNo -> m ()
intGarbageCollect :: SlotNo -> m ()
, Internal m blk -> m ()
intUpdateLedgerSnapshots :: m ()
, Internal m blk -> m Void
intAddBlockRunner :: m Void
, Internal m blk -> StrictTVar m (m ())
intKillBgThreads :: StrictTVar m (m ())
}
newtype IteratorKey = IteratorKey Word
deriving stock (Int -> IteratorKey -> String -> String
[IteratorKey] -> String -> String
IteratorKey -> String
(Int -> IteratorKey -> String -> String)
-> (IteratorKey -> String)
-> ([IteratorKey] -> String -> String)
-> Show IteratorKey
forall a.
(Int -> a -> String -> String)
-> (a -> String) -> ([a] -> String -> String) -> Show a
showList :: [IteratorKey] -> String -> String
$cshowList :: [IteratorKey] -> String -> String
show :: IteratorKey -> String
$cshow :: IteratorKey -> String
showsPrec :: Int -> IteratorKey -> String -> String
$cshowsPrec :: Int -> IteratorKey -> String -> String
Show)
deriving newtype (IteratorKey -> IteratorKey -> Bool
(IteratorKey -> IteratorKey -> Bool)
-> (IteratorKey -> IteratorKey -> Bool) -> Eq IteratorKey
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: IteratorKey -> IteratorKey -> Bool
$c/= :: IteratorKey -> IteratorKey -> Bool
== :: IteratorKey -> IteratorKey -> Bool
$c== :: IteratorKey -> IteratorKey -> Bool
Eq, Eq IteratorKey
Eq IteratorKey
-> (IteratorKey -> IteratorKey -> Ordering)
-> (IteratorKey -> IteratorKey -> Bool)
-> (IteratorKey -> IteratorKey -> Bool)
-> (IteratorKey -> IteratorKey -> Bool)
-> (IteratorKey -> IteratorKey -> Bool)
-> (IteratorKey -> IteratorKey -> IteratorKey)
-> (IteratorKey -> IteratorKey -> IteratorKey)
-> Ord IteratorKey
IteratorKey -> IteratorKey -> Bool
IteratorKey -> IteratorKey -> Ordering
IteratorKey -> IteratorKey -> IteratorKey
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: IteratorKey -> IteratorKey -> IteratorKey
$cmin :: IteratorKey -> IteratorKey -> IteratorKey
max :: IteratorKey -> IteratorKey -> IteratorKey
$cmax :: IteratorKey -> IteratorKey -> IteratorKey
>= :: IteratorKey -> IteratorKey -> Bool
$c>= :: IteratorKey -> IteratorKey -> Bool
> :: IteratorKey -> IteratorKey -> Bool
$c> :: IteratorKey -> IteratorKey -> Bool
<= :: IteratorKey -> IteratorKey -> Bool
$c<= :: IteratorKey -> IteratorKey -> Bool
< :: IteratorKey -> IteratorKey -> Bool
$c< :: IteratorKey -> IteratorKey -> Bool
compare :: IteratorKey -> IteratorKey -> Ordering
$ccompare :: IteratorKey -> IteratorKey -> Ordering
$cp1Ord :: Eq IteratorKey
Ord, Int -> IteratorKey
IteratorKey -> Int
IteratorKey -> [IteratorKey]
IteratorKey -> IteratorKey
IteratorKey -> IteratorKey -> [IteratorKey]
IteratorKey -> IteratorKey -> IteratorKey -> [IteratorKey]
(IteratorKey -> IteratorKey)
-> (IteratorKey -> IteratorKey)
-> (Int -> IteratorKey)
-> (IteratorKey -> Int)
-> (IteratorKey -> [IteratorKey])
-> (IteratorKey -> IteratorKey -> [IteratorKey])
-> (IteratorKey -> IteratorKey -> [IteratorKey])
-> (IteratorKey -> IteratorKey -> IteratorKey -> [IteratorKey])
-> Enum IteratorKey
forall a.
(a -> a)
-> (a -> a)
-> (Int -> a)
-> (a -> Int)
-> (a -> [a])
-> (a -> a -> [a])
-> (a -> a -> [a])
-> (a -> a -> a -> [a])
-> Enum a
enumFromThenTo :: IteratorKey -> IteratorKey -> IteratorKey -> [IteratorKey]
$cenumFromThenTo :: IteratorKey -> IteratorKey -> IteratorKey -> [IteratorKey]
enumFromTo :: IteratorKey -> IteratorKey -> [IteratorKey]
$cenumFromTo :: IteratorKey -> IteratorKey -> [IteratorKey]
enumFromThen :: IteratorKey -> IteratorKey -> [IteratorKey]
$cenumFromThen :: IteratorKey -> IteratorKey -> [IteratorKey]
enumFrom :: IteratorKey -> [IteratorKey]
$cenumFrom :: IteratorKey -> [IteratorKey]
fromEnum :: IteratorKey -> Int
$cfromEnum :: IteratorKey -> Int
toEnum :: Int -> IteratorKey
$ctoEnum :: Int -> IteratorKey
pred :: IteratorKey -> IteratorKey
$cpred :: IteratorKey -> IteratorKey
succ :: IteratorKey -> IteratorKey
$csucc :: IteratorKey -> IteratorKey
Enum, Context -> IteratorKey -> IO (Maybe ThunkInfo)
Proxy IteratorKey -> String
(Context -> IteratorKey -> IO (Maybe ThunkInfo))
-> (Context -> IteratorKey -> IO (Maybe ThunkInfo))
-> (Proxy IteratorKey -> String)
-> NoThunks IteratorKey
forall a.
(Context -> a -> IO (Maybe ThunkInfo))
-> (Context -> a -> IO (Maybe ThunkInfo))
-> (Proxy a -> String)
-> NoThunks a
showTypeOf :: Proxy IteratorKey -> String
$cshowTypeOf :: Proxy IteratorKey -> String
wNoThunks :: Context -> IteratorKey -> IO (Maybe ThunkInfo)
$cwNoThunks :: Context -> IteratorKey -> IO (Maybe ThunkInfo)
noThunks :: Context -> IteratorKey -> IO (Maybe ThunkInfo)
$cnoThunks :: Context -> IteratorKey -> IO (Maybe ThunkInfo)
NoThunks)
newtype ReaderKey = ReaderKey Word
deriving stock (Int -> ReaderKey -> String -> String
[ReaderKey] -> String -> String
ReaderKey -> String
(Int -> ReaderKey -> String -> String)
-> (ReaderKey -> String)
-> ([ReaderKey] -> String -> String)
-> Show ReaderKey
forall a.
(Int -> a -> String -> String)
-> (a -> String) -> ([a] -> String -> String) -> Show a
showList :: [ReaderKey] -> String -> String
$cshowList :: [ReaderKey] -> String -> String
show :: ReaderKey -> String
$cshow :: ReaderKey -> String
showsPrec :: Int -> ReaderKey -> String -> String
$cshowsPrec :: Int -> ReaderKey -> String -> String
Show)
deriving newtype (ReaderKey -> ReaderKey -> Bool
(ReaderKey -> ReaderKey -> Bool)
-> (ReaderKey -> ReaderKey -> Bool) -> Eq ReaderKey
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ReaderKey -> ReaderKey -> Bool
$c/= :: ReaderKey -> ReaderKey -> Bool
== :: ReaderKey -> ReaderKey -> Bool
$c== :: ReaderKey -> ReaderKey -> Bool
Eq, Eq ReaderKey
Eq ReaderKey
-> (ReaderKey -> ReaderKey -> Ordering)
-> (ReaderKey -> ReaderKey -> Bool)
-> (ReaderKey -> ReaderKey -> Bool)
-> (ReaderKey -> ReaderKey -> Bool)
-> (ReaderKey -> ReaderKey -> Bool)
-> (ReaderKey -> ReaderKey -> ReaderKey)
-> (ReaderKey -> ReaderKey -> ReaderKey)
-> Ord ReaderKey
ReaderKey -> ReaderKey -> Bool
ReaderKey -> ReaderKey -> Ordering
ReaderKey -> ReaderKey -> ReaderKey
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: ReaderKey -> ReaderKey -> ReaderKey
$cmin :: ReaderKey -> ReaderKey -> ReaderKey
max :: ReaderKey -> ReaderKey -> ReaderKey
$cmax :: ReaderKey -> ReaderKey -> ReaderKey
>= :: ReaderKey -> ReaderKey -> Bool
$c>= :: ReaderKey -> ReaderKey -> Bool
> :: ReaderKey -> ReaderKey -> Bool
$c> :: ReaderKey -> ReaderKey -> Bool
<= :: ReaderKey -> ReaderKey -> Bool
$c<= :: ReaderKey -> ReaderKey -> Bool
< :: ReaderKey -> ReaderKey -> Bool
$c< :: ReaderKey -> ReaderKey -> Bool
compare :: ReaderKey -> ReaderKey -> Ordering
$ccompare :: ReaderKey -> ReaderKey -> Ordering
$cp1Ord :: Eq ReaderKey
Ord, Int -> ReaderKey
ReaderKey -> Int
ReaderKey -> [ReaderKey]
ReaderKey -> ReaderKey
ReaderKey -> ReaderKey -> [ReaderKey]
ReaderKey -> ReaderKey -> ReaderKey -> [ReaderKey]
(ReaderKey -> ReaderKey)
-> (ReaderKey -> ReaderKey)
-> (Int -> ReaderKey)
-> (ReaderKey -> Int)
-> (ReaderKey -> [ReaderKey])
-> (ReaderKey -> ReaderKey -> [ReaderKey])
-> (ReaderKey -> ReaderKey -> [ReaderKey])
-> (ReaderKey -> ReaderKey -> ReaderKey -> [ReaderKey])
-> Enum ReaderKey
forall a.
(a -> a)
-> (a -> a)
-> (Int -> a)
-> (a -> Int)
-> (a -> [a])
-> (a -> a -> [a])
-> (a -> a -> [a])
-> (a -> a -> a -> [a])
-> Enum a
enumFromThenTo :: ReaderKey -> ReaderKey -> ReaderKey -> [ReaderKey]
$cenumFromThenTo :: ReaderKey -> ReaderKey -> ReaderKey -> [ReaderKey]
enumFromTo :: ReaderKey -> ReaderKey -> [ReaderKey]
$cenumFromTo :: ReaderKey -> ReaderKey -> [ReaderKey]
enumFromThen :: ReaderKey -> ReaderKey -> [ReaderKey]
$cenumFromThen :: ReaderKey -> ReaderKey -> [ReaderKey]
enumFrom :: ReaderKey -> [ReaderKey]
$cenumFrom :: ReaderKey -> [ReaderKey]
fromEnum :: ReaderKey -> Int
$cfromEnum :: ReaderKey -> Int
toEnum :: Int -> ReaderKey
$ctoEnum :: Int -> ReaderKey
pred :: ReaderKey -> ReaderKey
$cpred :: ReaderKey -> ReaderKey
succ :: ReaderKey -> ReaderKey
$csucc :: ReaderKey -> ReaderKey
Enum, Context -> ReaderKey -> IO (Maybe ThunkInfo)
Proxy ReaderKey -> String
(Context -> ReaderKey -> IO (Maybe ThunkInfo))
-> (Context -> ReaderKey -> IO (Maybe ThunkInfo))
-> (Proxy ReaderKey -> String)
-> NoThunks ReaderKey
forall a.
(Context -> a -> IO (Maybe ThunkInfo))
-> (Context -> a -> IO (Maybe ThunkInfo))
-> (Proxy a -> String)
-> NoThunks a
showTypeOf :: Proxy ReaderKey -> String
$cshowTypeOf :: Proxy ReaderKey -> String
wNoThunks :: Context -> ReaderKey -> IO (Maybe ThunkInfo)
$cwNoThunks :: Context -> ReaderKey -> IO (Maybe ThunkInfo)
noThunks :: Context -> ReaderKey -> IO (Maybe ThunkInfo)
$cnoThunks :: Context -> ReaderKey -> IO (Maybe ThunkInfo)
NoThunks)
data ReaderHandle m blk = ReaderHandle
{ ReaderHandle m blk
-> Point blk -> AnchoredFragment (Header blk) -> STM m ()
rhSwitchFork :: Point blk -> AnchoredFragment (Header blk) -> STM m ()
, ReaderHandle m blk -> m ()
rhClose :: m ()
}
deriving Context -> ReaderHandle m blk -> IO (Maybe ThunkInfo)
Proxy (ReaderHandle m blk) -> String
(Context -> ReaderHandle m blk -> IO (Maybe ThunkInfo))
-> (Context -> ReaderHandle m blk -> IO (Maybe ThunkInfo))
-> (Proxy (ReaderHandle m blk) -> String)
-> NoThunks (ReaderHandle m blk)
forall a.
(Context -> a -> IO (Maybe ThunkInfo))
-> (Context -> a -> IO (Maybe ThunkInfo))
-> (Proxy a -> String)
-> NoThunks a
forall (m :: * -> *) blk.
Context -> ReaderHandle m blk -> IO (Maybe ThunkInfo)
forall (m :: * -> *) blk. Proxy (ReaderHandle m blk) -> String
showTypeOf :: Proxy (ReaderHandle m blk) -> String
$cshowTypeOf :: forall (m :: * -> *) blk. Proxy (ReaderHandle m blk) -> String
wNoThunks :: Context -> ReaderHandle m blk -> IO (Maybe ThunkInfo)
$cwNoThunks :: forall (m :: * -> *) blk.
Context -> ReaderHandle m blk -> IO (Maybe ThunkInfo)
noThunks :: Context -> ReaderHandle m blk -> IO (Maybe ThunkInfo)
$cnoThunks :: forall (m :: * -> *) blk.
Context -> ReaderHandle m blk -> IO (Maybe ThunkInfo)
NoThunks via OnlyCheckWhnfNamed "ReaderHandle" (ReaderHandle m blk)
data ReaderState m blk b
= ReaderInit
| ReaderInImmutableDB
!(ReaderRollState blk)
!(ImmutableDB.Iterator m blk (Point blk, b))
| ReaderInMem !(ReaderRollState blk)
deriving ((forall x. ReaderState m blk b -> Rep (ReaderState m blk b) x)
-> (forall x. Rep (ReaderState m blk b) x -> ReaderState m blk b)
-> Generic (ReaderState m blk b)
forall x. Rep (ReaderState m blk b) x -> ReaderState m blk b
forall x. ReaderState m blk b -> Rep (ReaderState m blk b) x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall (m :: * -> *) blk b x.
Rep (ReaderState m blk b) x -> ReaderState m blk b
forall (m :: * -> *) blk b x.
ReaderState m blk b -> Rep (ReaderState m blk b) x
$cto :: forall (m :: * -> *) blk b x.
Rep (ReaderState m blk b) x -> ReaderState m blk b
$cfrom :: forall (m :: * -> *) blk b x.
ReaderState m blk b -> Rep (ReaderState m blk b) x
Generic, Context -> ReaderState m blk b -> IO (Maybe ThunkInfo)
Proxy (ReaderState m blk b) -> String
(Context -> ReaderState m blk b -> IO (Maybe ThunkInfo))
-> (Context -> ReaderState m blk b -> IO (Maybe ThunkInfo))
-> (Proxy (ReaderState m blk b) -> String)
-> NoThunks (ReaderState m blk b)
forall a.
(Context -> a -> IO (Maybe ThunkInfo))
-> (Context -> a -> IO (Maybe ThunkInfo))
-> (Proxy a -> String)
-> NoThunks a
forall (m :: * -> *) blk b.
StandardHash blk =>
Context -> ReaderState m blk b -> IO (Maybe ThunkInfo)
forall (m :: * -> *) blk b.
StandardHash blk =>
Proxy (ReaderState m blk b) -> String
showTypeOf :: Proxy (ReaderState m blk b) -> String
$cshowTypeOf :: forall (m :: * -> *) blk b.
StandardHash blk =>
Proxy (ReaderState m blk b) -> String
wNoThunks :: Context -> ReaderState m blk b -> IO (Maybe ThunkInfo)
$cwNoThunks :: forall (m :: * -> *) blk b.
StandardHash blk =>
Context -> ReaderState m blk b -> IO (Maybe ThunkInfo)
noThunks :: Context -> ReaderState m blk b -> IO (Maybe ThunkInfo)
$cnoThunks :: forall (m :: * -> *) blk b.
StandardHash blk =>
Context -> ReaderState m blk b -> IO (Maybe ThunkInfo)
NoThunks)
data ReaderRollState blk
= RollBackTo !(Point blk)
| RollForwardFrom !(Point blk)
deriving (ReaderRollState blk -> ReaderRollState blk -> Bool
(ReaderRollState blk -> ReaderRollState blk -> Bool)
-> (ReaderRollState blk -> ReaderRollState blk -> Bool)
-> Eq (ReaderRollState blk)
forall blk.
StandardHash blk =>
ReaderRollState blk -> ReaderRollState blk -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ReaderRollState blk -> ReaderRollState blk -> Bool
$c/= :: forall blk.
StandardHash blk =>
ReaderRollState blk -> ReaderRollState blk -> Bool
== :: ReaderRollState blk -> ReaderRollState blk -> Bool
$c== :: forall blk.
StandardHash blk =>
ReaderRollState blk -> ReaderRollState blk -> Bool
Eq, Int -> ReaderRollState blk -> String -> String
[ReaderRollState blk] -> String -> String
ReaderRollState blk -> String
(Int -> ReaderRollState blk -> String -> String)
-> (ReaderRollState blk -> String)
-> ([ReaderRollState blk] -> String -> String)
-> Show (ReaderRollState blk)
forall blk.
StandardHash blk =>
Int -> ReaderRollState blk -> String -> String
forall blk.
StandardHash blk =>
[ReaderRollState blk] -> String -> String
forall blk. StandardHash blk => ReaderRollState blk -> String
forall a.
(Int -> a -> String -> String)
-> (a -> String) -> ([a] -> String -> String) -> Show a
showList :: [ReaderRollState blk] -> String -> String
$cshowList :: forall blk.
StandardHash blk =>
[ReaderRollState blk] -> String -> String
show :: ReaderRollState blk -> String
$cshow :: forall blk. StandardHash blk => ReaderRollState blk -> String
showsPrec :: Int -> ReaderRollState blk -> String -> String
$cshowsPrec :: forall blk.
StandardHash blk =>
Int -> ReaderRollState blk -> String -> String
Show, (forall x. ReaderRollState blk -> Rep (ReaderRollState blk) x)
-> (forall x. Rep (ReaderRollState blk) x -> ReaderRollState blk)
-> Generic (ReaderRollState blk)
forall x. Rep (ReaderRollState blk) x -> ReaderRollState blk
forall x. ReaderRollState blk -> Rep (ReaderRollState blk) x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall blk x. Rep (ReaderRollState blk) x -> ReaderRollState blk
forall blk x. ReaderRollState blk -> Rep (ReaderRollState blk) x
$cto :: forall blk x. Rep (ReaderRollState blk) x -> ReaderRollState blk
$cfrom :: forall blk x. ReaderRollState blk -> Rep (ReaderRollState blk) x
Generic, Context -> ReaderRollState blk -> IO (Maybe ThunkInfo)
Proxy (ReaderRollState blk) -> String
(Context -> ReaderRollState blk -> IO (Maybe ThunkInfo))
-> (Context -> ReaderRollState blk -> IO (Maybe ThunkInfo))
-> (Proxy (ReaderRollState blk) -> String)
-> NoThunks (ReaderRollState blk)
forall blk.
StandardHash blk =>
Context -> ReaderRollState blk -> IO (Maybe ThunkInfo)
forall blk.
StandardHash blk =>
Proxy (ReaderRollState blk) -> String
forall a.
(Context -> a -> IO (Maybe ThunkInfo))
-> (Context -> a -> IO (Maybe ThunkInfo))
-> (Proxy a -> String)
-> NoThunks a
showTypeOf :: Proxy (ReaderRollState blk) -> String
$cshowTypeOf :: forall blk.
StandardHash blk =>
Proxy (ReaderRollState blk) -> String
wNoThunks :: Context -> ReaderRollState blk -> IO (Maybe ThunkInfo)
$cwNoThunks :: forall blk.
StandardHash blk =>
Context -> ReaderRollState blk -> IO (Maybe ThunkInfo)
noThunks :: Context -> ReaderRollState blk -> IO (Maybe ThunkInfo)
$cnoThunks :: forall blk.
StandardHash blk =>
Context -> ReaderRollState blk -> IO (Maybe ThunkInfo)
NoThunks)
readerRollStatePoint :: ReaderRollState blk -> Point blk
readerRollStatePoint :: ReaderRollState blk -> Point blk
readerRollStatePoint (RollBackTo Point blk
pt) = Point blk
pt
readerRollStatePoint (RollForwardFrom Point blk
pt) = Point blk
pt
type InvalidBlocks blk = Map (HeaderHash blk) (InvalidBlockInfo blk)
data InvalidBlockInfo blk = InvalidBlockInfo
{ InvalidBlockInfo blk -> InvalidBlockReason blk
invalidBlockReason :: !(InvalidBlockReason blk)
, InvalidBlockInfo blk -> SlotNo
invalidBlockSlotNo :: !SlotNo
} deriving (InvalidBlockInfo blk -> InvalidBlockInfo blk -> Bool
(InvalidBlockInfo blk -> InvalidBlockInfo blk -> Bool)
-> (InvalidBlockInfo blk -> InvalidBlockInfo blk -> Bool)
-> Eq (InvalidBlockInfo blk)
forall blk.
LedgerSupportsProtocol blk =>
InvalidBlockInfo blk -> InvalidBlockInfo blk -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: InvalidBlockInfo blk -> InvalidBlockInfo blk -> Bool
$c/= :: forall blk.
LedgerSupportsProtocol blk =>
InvalidBlockInfo blk -> InvalidBlockInfo blk -> Bool
== :: InvalidBlockInfo blk -> InvalidBlockInfo blk -> Bool
$c== :: forall blk.
LedgerSupportsProtocol blk =>
InvalidBlockInfo blk -> InvalidBlockInfo blk -> Bool
Eq, Int -> InvalidBlockInfo blk -> String -> String
[InvalidBlockInfo blk] -> String -> String
InvalidBlockInfo blk -> String
(Int -> InvalidBlockInfo blk -> String -> String)
-> (InvalidBlockInfo blk -> String)
-> ([InvalidBlockInfo blk] -> String -> String)
-> Show (InvalidBlockInfo blk)
forall blk.
LedgerSupportsProtocol blk =>
Int -> InvalidBlockInfo blk -> String -> String
forall blk.
LedgerSupportsProtocol blk =>
[InvalidBlockInfo blk] -> String -> String
forall blk.
LedgerSupportsProtocol blk =>
InvalidBlockInfo blk -> String
forall a.
(Int -> a -> String -> String)
-> (a -> String) -> ([a] -> String -> String) -> Show a
showList :: [InvalidBlockInfo blk] -> String -> String
$cshowList :: forall blk.
LedgerSupportsProtocol blk =>
[InvalidBlockInfo blk] -> String -> String
show :: InvalidBlockInfo blk -> String
$cshow :: forall blk.
LedgerSupportsProtocol blk =>
InvalidBlockInfo blk -> String
showsPrec :: Int -> InvalidBlockInfo blk -> String -> String
$cshowsPrec :: forall blk.
LedgerSupportsProtocol blk =>
Int -> InvalidBlockInfo blk -> String -> String
Show, (forall x. InvalidBlockInfo blk -> Rep (InvalidBlockInfo blk) x)
-> (forall x. Rep (InvalidBlockInfo blk) x -> InvalidBlockInfo blk)
-> Generic (InvalidBlockInfo blk)
forall x. Rep (InvalidBlockInfo blk) x -> InvalidBlockInfo blk
forall x. InvalidBlockInfo blk -> Rep (InvalidBlockInfo blk) x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall blk x. Rep (InvalidBlockInfo blk) x -> InvalidBlockInfo blk
forall blk x. InvalidBlockInfo blk -> Rep (InvalidBlockInfo blk) x
$cto :: forall blk x. Rep (InvalidBlockInfo blk) x -> InvalidBlockInfo blk
$cfrom :: forall blk x. InvalidBlockInfo blk -> Rep (InvalidBlockInfo blk) x
Generic, Context -> InvalidBlockInfo blk -> IO (Maybe ThunkInfo)
Proxy (InvalidBlockInfo blk) -> String
(Context -> InvalidBlockInfo blk -> IO (Maybe ThunkInfo))
-> (Context -> InvalidBlockInfo blk -> IO (Maybe ThunkInfo))
-> (Proxy (InvalidBlockInfo blk) -> String)
-> NoThunks (InvalidBlockInfo blk)
forall blk.
LedgerSupportsProtocol blk =>
Context -> InvalidBlockInfo blk -> IO (Maybe ThunkInfo)
forall blk.
LedgerSupportsProtocol blk =>
Proxy (InvalidBlockInfo blk) -> String
forall a.
(Context -> a -> IO (Maybe ThunkInfo))
-> (Context -> a -> IO (Maybe ThunkInfo))
-> (Proxy a -> String)
-> NoThunks a
showTypeOf :: Proxy (InvalidBlockInfo blk) -> String
$cshowTypeOf :: forall blk.
LedgerSupportsProtocol blk =>
Proxy (InvalidBlockInfo blk) -> String
wNoThunks :: Context -> InvalidBlockInfo blk -> IO (Maybe ThunkInfo)
$cwNoThunks :: forall blk.
LedgerSupportsProtocol blk =>
Context -> InvalidBlockInfo blk -> IO (Maybe ThunkInfo)
noThunks :: Context -> InvalidBlockInfo blk -> IO (Maybe ThunkInfo)
$cnoThunks :: forall blk.
LedgerSupportsProtocol blk =>
Context -> InvalidBlockInfo blk -> IO (Maybe ThunkInfo)
NoThunks)
type FutureBlocks blk = Map (HeaderHash blk) (Header blk)
newtype BlocksToAdd m blk = BlocksToAdd (TBQueue m (BlockToAdd m blk))
deriving Context -> BlocksToAdd m blk -> IO (Maybe ThunkInfo)
Proxy (BlocksToAdd m blk) -> String
(Context -> BlocksToAdd m blk -> IO (Maybe ThunkInfo))
-> (Context -> BlocksToAdd m blk -> IO (Maybe ThunkInfo))
-> (Proxy (BlocksToAdd m blk) -> String)
-> NoThunks (BlocksToAdd m blk)
forall a.
(Context -> a -> IO (Maybe ThunkInfo))
-> (Context -> a -> IO (Maybe ThunkInfo))
-> (Proxy a -> String)
-> NoThunks a
forall (m :: * -> *) blk.
Context -> BlocksToAdd m blk -> IO (Maybe ThunkInfo)
forall (m :: * -> *) blk. Proxy (BlocksToAdd m blk) -> String
showTypeOf :: Proxy (BlocksToAdd m blk) -> String
$cshowTypeOf :: forall (m :: * -> *) blk. Proxy (BlocksToAdd m blk) -> String
wNoThunks :: Context -> BlocksToAdd m blk -> IO (Maybe ThunkInfo)
$cwNoThunks :: forall (m :: * -> *) blk.
Context -> BlocksToAdd m blk -> IO (Maybe ThunkInfo)
noThunks :: Context -> BlocksToAdd m blk -> IO (Maybe ThunkInfo)
$cnoThunks :: forall (m :: * -> *) blk.
Context -> BlocksToAdd m blk -> IO (Maybe ThunkInfo)
NoThunks via OnlyCheckWhnfNamed "BlocksToAdd" (BlocksToAdd m blk)
data BlockToAdd m blk = BlockToAdd
{ BlockToAdd m blk -> blk
blockToAdd :: !blk
, BlockToAdd m blk -> StrictTMVar m Bool
varBlockWrittenToDisk :: !(StrictTMVar m Bool)
, BlockToAdd m blk -> StrictTMVar m (Point blk)
varBlockProcessed :: !(StrictTMVar m (Point blk))
}
newBlocksToAdd :: IOLike m => Word -> m (BlocksToAdd m blk)
newBlocksToAdd :: Word -> m (BlocksToAdd m blk)
newBlocksToAdd Word
queueSize = TBQueue_ (STM m) (BlockToAdd m blk) -> BlocksToAdd m blk
forall (m :: * -> *) blk.
TBQueue m (BlockToAdd m blk) -> BlocksToAdd m blk
BlocksToAdd (TBQueue_ (STM m) (BlockToAdd m blk) -> BlocksToAdd m blk)
-> m (TBQueue_ (STM m) (BlockToAdd m blk)) -> m (BlocksToAdd m blk)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$>
STM m (TBQueue_ (STM m) (BlockToAdd m blk))
-> m (TBQueue_ (STM m) (BlockToAdd m blk))
forall (m :: * -> *) a.
(MonadSTM m, HasCallStack) =>
STM m a -> m a
atomically (Natural -> STM m (TBQueue_ (STM m) (BlockToAdd m blk))
forall (stm :: * -> *) a.
MonadSTMTx stm =>
Natural -> stm (TBQueue_ stm a)
newTBQueue (Word -> Natural
forall a b. (Integral a, Num b) => a -> b
fromIntegral Word
queueSize))
addBlockToAdd
:: (IOLike m, HasHeader blk)
=> Tracer m (TraceAddBlockEvent blk)
-> BlocksToAdd m blk
-> blk
-> m (AddBlockPromise m blk)
addBlockToAdd :: Tracer m (TraceAddBlockEvent blk)
-> BlocksToAdd m blk -> blk -> m (AddBlockPromise m blk)
addBlockToAdd Tracer m (TraceAddBlockEvent blk)
tracer (BlocksToAdd TBQueue m (BlockToAdd m blk)
queue) blk
blk = do
StrictTMVar m Bool
varBlockWrittenToDisk <- m (StrictTMVar m Bool)
forall (m :: * -> *) a. MonadSTM m => m (StrictTMVar m a)
newEmptyTMVarIO
StrictTMVar m (Point blk)
varBlockProcessed <- m (StrictTMVar m (Point blk))
forall (m :: * -> *) a. MonadSTM m => m (StrictTMVar m a)
newEmptyTMVarIO
let !toAdd :: BlockToAdd m blk
toAdd = BlockToAdd :: forall (m :: * -> *) blk.
blk
-> StrictTMVar m Bool
-> StrictTMVar m (Point blk)
-> BlockToAdd m blk
BlockToAdd
{ blockToAdd :: blk
blockToAdd = blk
blk
, StrictTMVar m Bool
varBlockWrittenToDisk :: StrictTMVar m Bool
varBlockWrittenToDisk :: StrictTMVar m Bool
varBlockWrittenToDisk
, StrictTMVar m (Point blk)
varBlockProcessed :: StrictTMVar m (Point blk)
varBlockProcessed :: StrictTMVar m (Point blk)
varBlockProcessed
}
Natural
queueSize <- STM m Natural -> m Natural
forall (m :: * -> *) a.
(MonadSTM m, HasCallStack) =>
STM m a -> m a
atomically (STM m Natural -> m Natural) -> STM m Natural -> m Natural
forall a b. (a -> b) -> a -> b
$ do
TBQueue m (BlockToAdd m blk) -> BlockToAdd m blk -> STM m ()
forall (stm :: * -> *) a.
MonadSTMTx stm =>
TBQueue_ stm a -> a -> stm ()
writeTBQueue TBQueue m (BlockToAdd m blk)
queue BlockToAdd m blk
toAdd
TBQueue m (BlockToAdd m blk) -> STM m Natural
forall (stm :: * -> *) a.
MonadSTMTx stm =>
TBQueue_ stm a -> stm Natural
lengthTBQueue TBQueue m (BlockToAdd m blk)
queue
Tracer m (TraceAddBlockEvent blk) -> TraceAddBlockEvent blk -> m ()
forall (m :: * -> *) a. Tracer m a -> a -> m ()
traceWith Tracer m (TraceAddBlockEvent blk)
tracer (TraceAddBlockEvent blk -> m ()) -> TraceAddBlockEvent blk -> m ()
forall a b. (a -> b) -> a -> b
$
RealPoint blk -> Word -> TraceAddBlockEvent blk
forall blk. RealPoint blk -> Word -> TraceAddBlockEvent blk
AddedBlockToQueue (blk -> RealPoint blk
forall blk. HasHeader blk => blk -> RealPoint blk
blockRealPoint blk
blk) (Natural -> Word
forall a b. (Integral a, Num b) => a -> b
fromIntegral Natural
queueSize)
AddBlockPromise m blk -> m (AddBlockPromise m blk)
forall (m :: * -> *) a. Monad m => a -> m a
return AddBlockPromise :: forall (m :: * -> *) blk.
STM m Bool -> STM m (Point blk) -> AddBlockPromise m blk
AddBlockPromise
{ blockWrittenToDisk :: STM m Bool
blockWrittenToDisk = StrictTMVar m Bool -> STM m Bool
forall (m :: * -> *) a. MonadSTM m => StrictTMVar m a -> STM m a
readTMVar StrictTMVar m Bool
varBlockWrittenToDisk
, blockProcessed :: STM m (Point blk)
blockProcessed = StrictTMVar m (Point blk) -> STM m (Point blk)
forall (m :: * -> *) a. MonadSTM m => StrictTMVar m a -> STM m a
readTMVar StrictTMVar m (Point blk)
varBlockProcessed
}
getBlockToAdd :: IOLike m => BlocksToAdd m blk -> m (BlockToAdd m blk)
getBlockToAdd :: BlocksToAdd m blk -> m (BlockToAdd m blk)
getBlockToAdd (BlocksToAdd TBQueue m (BlockToAdd m blk)
queue) = STM m (BlockToAdd m blk) -> m (BlockToAdd m blk)
forall (m :: * -> *) a.
(MonadSTM m, HasCallStack) =>
STM m a -> m a
atomically (STM m (BlockToAdd m blk) -> m (BlockToAdd m blk))
-> STM m (BlockToAdd m blk) -> m (BlockToAdd m blk)
forall a b. (a -> b) -> a -> b
$ TBQueue m (BlockToAdd m blk) -> STM m (BlockToAdd m blk)
forall (stm :: * -> *) a. MonadSTMTx stm => TBQueue_ stm a -> stm a
readTBQueue TBQueue m (BlockToAdd m blk)
queue
data TraceEvent blk
= TraceAddBlockEvent (TraceAddBlockEvent blk)
| TraceReaderEvent (TraceReaderEvent blk)
| TraceCopyToImmutableDBEvent (TraceCopyToImmutableDBEvent blk)
| TraceGCEvent (TraceGCEvent blk)
| TraceInitChainSelEvent (TraceInitChainSelEvent blk)
| TraceOpenEvent (TraceOpenEvent blk)
| TraceIteratorEvent (TraceIteratorEvent blk)
| TraceLedgerEvent (LgrDB.TraceEvent blk)
| TraceLedgerReplayEvent (LgrDB.TraceLedgerReplayEvent blk)
| TraceImmutableDBEvent (ImmutableDB.TraceEvent blk)
| TraceVolatileDBEvent (VolatileDB.TraceEvent blk)
deriving ((forall x. TraceEvent blk -> Rep (TraceEvent blk) x)
-> (forall x. Rep (TraceEvent blk) x -> TraceEvent blk)
-> Generic (TraceEvent blk)
forall x. Rep (TraceEvent blk) x -> TraceEvent blk
forall x. TraceEvent blk -> Rep (TraceEvent blk) x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall blk x. Rep (TraceEvent blk) x -> TraceEvent blk
forall blk x. TraceEvent blk -> Rep (TraceEvent blk) x
$cto :: forall blk x. Rep (TraceEvent blk) x -> TraceEvent blk
$cfrom :: forall blk x. TraceEvent blk -> Rep (TraceEvent blk) x
Generic)
deriving instance
( HasHeader blk
, Eq (Header blk)
, LedgerSupportsProtocol blk
, InspectLedger blk
) => Eq (TraceEvent blk)
deriving instance
( HasHeader blk
, Show (Header blk)
, LedgerSupportsProtocol blk
, InspectLedger blk
) => Show (TraceEvent blk)
data TraceOpenEvent blk =
OpenedDB
(Point blk)
(Point blk)
| ClosedDB
(Point blk)
(Point blk)
| OpenedImmutableDB
(Point blk)
ImmutableDB.ChunkNo
| OpenedVolatileDB
| OpenedLgrDB
deriving ((forall x. TraceOpenEvent blk -> Rep (TraceOpenEvent blk) x)
-> (forall x. Rep (TraceOpenEvent blk) x -> TraceOpenEvent blk)
-> Generic (TraceOpenEvent blk)
forall x. Rep (TraceOpenEvent blk) x -> TraceOpenEvent blk
forall x. TraceOpenEvent blk -> Rep (TraceOpenEvent blk) x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall blk x. Rep (TraceOpenEvent blk) x -> TraceOpenEvent blk
forall blk x. TraceOpenEvent blk -> Rep (TraceOpenEvent blk) x
$cto :: forall blk x. Rep (TraceOpenEvent blk) x -> TraceOpenEvent blk
$cfrom :: forall blk x. TraceOpenEvent blk -> Rep (TraceOpenEvent blk) x
Generic, TraceOpenEvent blk -> TraceOpenEvent blk -> Bool
(TraceOpenEvent blk -> TraceOpenEvent blk -> Bool)
-> (TraceOpenEvent blk -> TraceOpenEvent blk -> Bool)
-> Eq (TraceOpenEvent blk)
forall blk.
StandardHash blk =>
TraceOpenEvent blk -> TraceOpenEvent blk -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TraceOpenEvent blk -> TraceOpenEvent blk -> Bool
$c/= :: forall blk.
StandardHash blk =>
TraceOpenEvent blk -> TraceOpenEvent blk -> Bool
== :: TraceOpenEvent blk -> TraceOpenEvent blk -> Bool
$c== :: forall blk.
StandardHash blk =>
TraceOpenEvent blk -> TraceOpenEvent blk -> Bool
Eq, Int -> TraceOpenEvent blk -> String -> String
[TraceOpenEvent blk] -> String -> String
TraceOpenEvent blk -> String
(Int -> TraceOpenEvent blk -> String -> String)
-> (TraceOpenEvent blk -> String)
-> ([TraceOpenEvent blk] -> String -> String)
-> Show (TraceOpenEvent blk)
forall blk.
StandardHash blk =>
Int -> TraceOpenEvent blk -> String -> String
forall blk.
StandardHash blk =>
[TraceOpenEvent blk] -> String -> String
forall blk. StandardHash blk => TraceOpenEvent blk -> String
forall a.
(Int -> a -> String -> String)
-> (a -> String) -> ([a] -> String -> String) -> Show a
showList :: [TraceOpenEvent blk] -> String -> String
$cshowList :: forall blk.
StandardHash blk =>
[TraceOpenEvent blk] -> String -> String
show :: TraceOpenEvent blk -> String
$cshow :: forall blk. StandardHash blk => TraceOpenEvent blk -> String
showsPrec :: Int -> TraceOpenEvent blk -> String -> String
$cshowsPrec :: forall blk.
StandardHash blk =>
Int -> TraceOpenEvent blk -> String -> String
Show)
data NewTipInfo blk = NewTipInfo {
NewTipInfo blk -> RealPoint blk
newTipPoint :: RealPoint blk
, NewTipInfo blk -> EpochNo
newTipEpoch :: EpochNo
, NewTipInfo blk -> Word64
newTipSlotInEpoch :: Word64
, NewTipInfo blk -> RealPoint blk
newTipTrigger :: RealPoint blk
}
deriving (NewTipInfo blk -> NewTipInfo blk -> Bool
(NewTipInfo blk -> NewTipInfo blk -> Bool)
-> (NewTipInfo blk -> NewTipInfo blk -> Bool)
-> Eq (NewTipInfo blk)
forall blk.
StandardHash blk =>
NewTipInfo blk -> NewTipInfo blk -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: NewTipInfo blk -> NewTipInfo blk -> Bool
$c/= :: forall blk.
StandardHash blk =>
NewTipInfo blk -> NewTipInfo blk -> Bool
== :: NewTipInfo blk -> NewTipInfo blk -> Bool
$c== :: forall blk.
StandardHash blk =>
NewTipInfo blk -> NewTipInfo blk -> Bool
Eq, Int -> NewTipInfo blk -> String -> String
[NewTipInfo blk] -> String -> String
NewTipInfo blk -> String
(Int -> NewTipInfo blk -> String -> String)
-> (NewTipInfo blk -> String)
-> ([NewTipInfo blk] -> String -> String)
-> Show (NewTipInfo blk)
forall blk.
StandardHash blk =>
Int -> NewTipInfo blk -> String -> String
forall blk.
StandardHash blk =>
[NewTipInfo blk] -> String -> String
forall blk. StandardHash blk => NewTipInfo blk -> String
forall a.
(Int -> a -> String -> String)
-> (a -> String) -> ([a] -> String -> String) -> Show a
showList :: [NewTipInfo blk] -> String -> String
$cshowList :: forall blk.
StandardHash blk =>
[NewTipInfo blk] -> String -> String
show :: NewTipInfo blk -> String
$cshow :: forall blk. StandardHash blk => NewTipInfo blk -> String
showsPrec :: Int -> NewTipInfo blk -> String -> String
$cshowsPrec :: forall blk.
StandardHash blk =>
Int -> NewTipInfo blk -> String -> String
Show, (forall x. NewTipInfo blk -> Rep (NewTipInfo blk) x)
-> (forall x. Rep (NewTipInfo blk) x -> NewTipInfo blk)
-> Generic (NewTipInfo blk)
forall x. Rep (NewTipInfo blk) x -> NewTipInfo blk
forall x. NewTipInfo blk -> Rep (NewTipInfo blk) x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall blk x. Rep (NewTipInfo blk) x -> NewTipInfo blk
forall blk x. NewTipInfo blk -> Rep (NewTipInfo blk) x
$cto :: forall blk x. Rep (NewTipInfo blk) x -> NewTipInfo blk
$cfrom :: forall blk x. NewTipInfo blk -> Rep (NewTipInfo blk) x
Generic)
data TraceAddBlockEvent blk =
IgnoreBlockOlderThanK (RealPoint blk)
| IgnoreBlockAlreadyInVolatileDB (RealPoint blk)
| IgnoreInvalidBlock (RealPoint blk) (InvalidBlockReason blk)
| AddedBlockToQueue (RealPoint blk) Word
| BlockInTheFuture (RealPoint blk) SlotNo
| AddedBlockToVolatileDB (RealPoint blk) BlockNo IsEBB
| TryAddToCurrentChain (RealPoint blk)
| TrySwitchToAFork (RealPoint blk) (ChainDiff (HeaderFields blk))
| StoreButDontChange (RealPoint blk)
| AddedToCurrentChain
[LedgerEvent blk]
(NewTipInfo blk)
(AnchoredFragment (Header blk))
(AnchoredFragment (Header blk))
| SwitchedToAFork
[LedgerEvent blk]
(NewTipInfo blk)
(AnchoredFragment (Header blk))
(AnchoredFragment (Header blk))
| AddBlockValidation (TraceValidationEvent blk)
| ChainSelectionForFutureBlock (RealPoint blk)
deriving ((forall x.
TraceAddBlockEvent blk -> Rep (TraceAddBlockEvent blk) x)
-> (forall x.
Rep (TraceAddBlockEvent blk) x -> TraceAddBlockEvent blk)
-> Generic (TraceAddBlockEvent blk)
forall x. Rep (TraceAddBlockEvent blk) x -> TraceAddBlockEvent blk
forall x. TraceAddBlockEvent blk -> Rep (TraceAddBlockEvent blk) x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall blk x.
Rep (TraceAddBlockEvent blk) x -> TraceAddBlockEvent blk
forall blk x.
TraceAddBlockEvent blk -> Rep (TraceAddBlockEvent blk) x
$cto :: forall blk x.
Rep (TraceAddBlockEvent blk) x -> TraceAddBlockEvent blk
$cfrom :: forall blk x.
TraceAddBlockEvent blk -> Rep (TraceAddBlockEvent blk) x
Generic)
deriving instance
( HasHeader blk
, Eq (Header blk)
, LedgerSupportsProtocol blk
, InspectLedger blk
) => Eq (TraceAddBlockEvent blk)
deriving instance
( HasHeader blk
, Show (Header blk)
, LedgerSupportsProtocol blk
, InspectLedger blk
) => Show (TraceAddBlockEvent blk)
data TraceValidationEvent blk =
InvalidBlock
(ExtValidationError blk)
(RealPoint blk)
| InvalidCandidate
(AnchoredFragment (Header blk))
| ValidCandidate (AnchoredFragment (Header blk))
| CandidateContainsFutureBlocks
(AnchoredFragment (Header blk))
[Header blk]
| CandidateContainsFutureBlocksExceedingClockSkew
(AnchoredFragment (Header blk))
[Header blk]
deriving ((forall x.
TraceValidationEvent blk -> Rep (TraceValidationEvent blk) x)
-> (forall x.
Rep (TraceValidationEvent blk) x -> TraceValidationEvent blk)
-> Generic (TraceValidationEvent blk)
forall x.
Rep (TraceValidationEvent blk) x -> TraceValidationEvent blk
forall x.
TraceValidationEvent blk -> Rep (TraceValidationEvent blk) x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall blk x.
Rep (TraceValidationEvent blk) x -> TraceValidationEvent blk
forall blk x.
TraceValidationEvent blk -> Rep (TraceValidationEvent blk) x
$cto :: forall blk x.
Rep (TraceValidationEvent blk) x -> TraceValidationEvent blk
$cfrom :: forall blk x.
TraceValidationEvent blk -> Rep (TraceValidationEvent blk) x
Generic)
deriving instance
( HasHeader blk
, Eq (Header blk)
, LedgerSupportsProtocol blk
) => Eq (TraceValidationEvent blk)
deriving instance
( Show (Header blk)
, LedgerSupportsProtocol blk
) => Show (TraceValidationEvent blk)
data TraceInitChainSelEvent blk
= InitChainSelValidation (TraceValidationEvent blk)
deriving ((forall x.
TraceInitChainSelEvent blk -> Rep (TraceInitChainSelEvent blk) x)
-> (forall x.
Rep (TraceInitChainSelEvent blk) x -> TraceInitChainSelEvent blk)
-> Generic (TraceInitChainSelEvent blk)
forall x.
Rep (TraceInitChainSelEvent blk) x -> TraceInitChainSelEvent blk
forall x.
TraceInitChainSelEvent blk -> Rep (TraceInitChainSelEvent blk) x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall blk x.
Rep (TraceInitChainSelEvent blk) x -> TraceInitChainSelEvent blk
forall blk x.
TraceInitChainSelEvent blk -> Rep (TraceInitChainSelEvent blk) x
$cto :: forall blk x.
Rep (TraceInitChainSelEvent blk) x -> TraceInitChainSelEvent blk
$cfrom :: forall blk x.
TraceInitChainSelEvent blk -> Rep (TraceInitChainSelEvent blk) x
Generic)
deriving instance
( HasHeader blk
, Eq (Header blk)
, LedgerSupportsProtocol blk
) => Eq (TraceInitChainSelEvent blk)
deriving instance
( Show (Header blk)
, LedgerSupportsProtocol blk
) => Show (TraceInitChainSelEvent blk)
data TraceReaderEvent blk =
NewReader
| ReaderNoLongerInMem (ReaderRollState blk)
| ReaderSwitchToMem
(Point blk)
(WithOrigin SlotNo)
| ReaderNewImmIterator
(Point blk)
(WithOrigin SlotNo)
deriving ((forall x. TraceReaderEvent blk -> Rep (TraceReaderEvent blk) x)
-> (forall x. Rep (TraceReaderEvent blk) x -> TraceReaderEvent blk)
-> Generic (TraceReaderEvent blk)
forall x. Rep (TraceReaderEvent blk) x -> TraceReaderEvent blk
forall x. TraceReaderEvent blk -> Rep (TraceReaderEvent blk) x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall blk x. Rep (TraceReaderEvent blk) x -> TraceReaderEvent blk
forall blk x. TraceReaderEvent blk -> Rep (TraceReaderEvent blk) x
$cto :: forall blk x. Rep (TraceReaderEvent blk) x -> TraceReaderEvent blk
$cfrom :: forall blk x. TraceReaderEvent blk -> Rep (TraceReaderEvent blk) x
Generic, TraceReaderEvent blk -> TraceReaderEvent blk -> Bool
(TraceReaderEvent blk -> TraceReaderEvent blk -> Bool)
-> (TraceReaderEvent blk -> TraceReaderEvent blk -> Bool)
-> Eq (TraceReaderEvent blk)
forall blk.
StandardHash blk =>
TraceReaderEvent blk -> TraceReaderEvent blk -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TraceReaderEvent blk -> TraceReaderEvent blk -> Bool
$c/= :: forall blk.
StandardHash blk =>
TraceReaderEvent blk -> TraceReaderEvent blk -> Bool
== :: TraceReaderEvent blk -> TraceReaderEvent blk -> Bool
$c== :: forall blk.
StandardHash blk =>
TraceReaderEvent blk -> TraceReaderEvent blk -> Bool
Eq, Int -> TraceReaderEvent blk -> String -> String
[TraceReaderEvent blk] -> String -> String
TraceReaderEvent blk -> String
(Int -> TraceReaderEvent blk -> String -> String)
-> (TraceReaderEvent blk -> String)
-> ([TraceReaderEvent blk] -> String -> String)
-> Show (TraceReaderEvent blk)
forall blk.
StandardHash blk =>
Int -> TraceReaderEvent blk -> String -> String
forall blk.
StandardHash blk =>
[TraceReaderEvent blk] -> String -> String
forall blk. StandardHash blk => TraceReaderEvent blk -> String
forall a.
(Int -> a -> String -> String)
-> (a -> String) -> ([a] -> String -> String) -> Show a
showList :: [TraceReaderEvent blk] -> String -> String
$cshowList :: forall blk.
StandardHash blk =>
[TraceReaderEvent blk] -> String -> String
show :: TraceReaderEvent blk -> String
$cshow :: forall blk. StandardHash blk => TraceReaderEvent blk -> String
showsPrec :: Int -> TraceReaderEvent blk -> String -> String
$cshowsPrec :: forall blk.
StandardHash blk =>
Int -> TraceReaderEvent blk -> String -> String
Show)
data TraceCopyToImmutableDBEvent blk
= CopiedBlockToImmutableDB (Point blk)
| NoBlocksToCopyToImmutableDB
deriving ((forall x.
TraceCopyToImmutableDBEvent blk
-> Rep (TraceCopyToImmutableDBEvent blk) x)
-> (forall x.
Rep (TraceCopyToImmutableDBEvent blk) x
-> TraceCopyToImmutableDBEvent blk)
-> Generic (TraceCopyToImmutableDBEvent blk)
forall x.
Rep (TraceCopyToImmutableDBEvent blk) x
-> TraceCopyToImmutableDBEvent blk
forall x.
TraceCopyToImmutableDBEvent blk
-> Rep (TraceCopyToImmutableDBEvent blk) x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall blk x.
Rep (TraceCopyToImmutableDBEvent blk) x
-> TraceCopyToImmutableDBEvent blk
forall blk x.
TraceCopyToImmutableDBEvent blk
-> Rep (TraceCopyToImmutableDBEvent blk) x
$cto :: forall blk x.
Rep (TraceCopyToImmutableDBEvent blk) x
-> TraceCopyToImmutableDBEvent blk
$cfrom :: forall blk x.
TraceCopyToImmutableDBEvent blk
-> Rep (TraceCopyToImmutableDBEvent blk) x
Generic, TraceCopyToImmutableDBEvent blk
-> TraceCopyToImmutableDBEvent blk -> Bool
(TraceCopyToImmutableDBEvent blk
-> TraceCopyToImmutableDBEvent blk -> Bool)
-> (TraceCopyToImmutableDBEvent blk
-> TraceCopyToImmutableDBEvent blk -> Bool)
-> Eq (TraceCopyToImmutableDBEvent blk)
forall blk.
StandardHash blk =>
TraceCopyToImmutableDBEvent blk
-> TraceCopyToImmutableDBEvent blk -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TraceCopyToImmutableDBEvent blk
-> TraceCopyToImmutableDBEvent blk -> Bool
$c/= :: forall blk.
StandardHash blk =>
TraceCopyToImmutableDBEvent blk
-> TraceCopyToImmutableDBEvent blk -> Bool
== :: TraceCopyToImmutableDBEvent blk
-> TraceCopyToImmutableDBEvent blk -> Bool
$c== :: forall blk.
StandardHash blk =>
TraceCopyToImmutableDBEvent blk
-> TraceCopyToImmutableDBEvent blk -> Bool
Eq, Int -> TraceCopyToImmutableDBEvent blk -> String -> String
[TraceCopyToImmutableDBEvent blk] -> String -> String
TraceCopyToImmutableDBEvent blk -> String
(Int -> TraceCopyToImmutableDBEvent blk -> String -> String)
-> (TraceCopyToImmutableDBEvent blk -> String)
-> ([TraceCopyToImmutableDBEvent blk] -> String -> String)
-> Show (TraceCopyToImmutableDBEvent blk)
forall blk.
StandardHash blk =>
Int -> TraceCopyToImmutableDBEvent blk -> String -> String
forall blk.
StandardHash blk =>
[TraceCopyToImmutableDBEvent blk] -> String -> String
forall blk.
StandardHash blk =>
TraceCopyToImmutableDBEvent blk -> String
forall a.
(Int -> a -> String -> String)
-> (a -> String) -> ([a] -> String -> String) -> Show a
showList :: [TraceCopyToImmutableDBEvent blk] -> String -> String
$cshowList :: forall blk.
StandardHash blk =>
[TraceCopyToImmutableDBEvent blk] -> String -> String
show :: TraceCopyToImmutableDBEvent blk -> String
$cshow :: forall blk.
StandardHash blk =>
TraceCopyToImmutableDBEvent blk -> String
showsPrec :: Int -> TraceCopyToImmutableDBEvent blk -> String -> String
$cshowsPrec :: forall blk.
StandardHash blk =>
Int -> TraceCopyToImmutableDBEvent blk -> String -> String
Show)
data TraceGCEvent blk
= ScheduledGC SlotNo Time
| PerformedGC SlotNo
deriving ((forall x. TraceGCEvent blk -> Rep (TraceGCEvent blk) x)
-> (forall x. Rep (TraceGCEvent blk) x -> TraceGCEvent blk)
-> Generic (TraceGCEvent blk)
forall x. Rep (TraceGCEvent blk) x -> TraceGCEvent blk
forall x. TraceGCEvent blk -> Rep (TraceGCEvent blk) x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall blk x. Rep (TraceGCEvent blk) x -> TraceGCEvent blk
forall blk x. TraceGCEvent blk -> Rep (TraceGCEvent blk) x
$cto :: forall blk x. Rep (TraceGCEvent blk) x -> TraceGCEvent blk
$cfrom :: forall blk x. TraceGCEvent blk -> Rep (TraceGCEvent blk) x
Generic, TraceGCEvent blk -> TraceGCEvent blk -> Bool
(TraceGCEvent blk -> TraceGCEvent blk -> Bool)
-> (TraceGCEvent blk -> TraceGCEvent blk -> Bool)
-> Eq (TraceGCEvent blk)
forall blk. TraceGCEvent blk -> TraceGCEvent blk -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TraceGCEvent blk -> TraceGCEvent blk -> Bool
$c/= :: forall blk. TraceGCEvent blk -> TraceGCEvent blk -> Bool
== :: TraceGCEvent blk -> TraceGCEvent blk -> Bool
$c== :: forall blk. TraceGCEvent blk -> TraceGCEvent blk -> Bool
Eq, Int -> TraceGCEvent blk -> String -> String
[TraceGCEvent blk] -> String -> String
TraceGCEvent blk -> String
(Int -> TraceGCEvent blk -> String -> String)
-> (TraceGCEvent blk -> String)
-> ([TraceGCEvent blk] -> String -> String)
-> Show (TraceGCEvent blk)
forall blk. Int -> TraceGCEvent blk -> String -> String
forall blk. [TraceGCEvent blk] -> String -> String
forall blk. TraceGCEvent blk -> String
forall a.
(Int -> a -> String -> String)
-> (a -> String) -> ([a] -> String -> String) -> Show a
showList :: [TraceGCEvent blk] -> String -> String
$cshowList :: forall blk. [TraceGCEvent blk] -> String -> String
show :: TraceGCEvent blk -> String
$cshow :: forall blk. TraceGCEvent blk -> String
showsPrec :: Int -> TraceGCEvent blk -> String -> String
$cshowsPrec :: forall blk. Int -> TraceGCEvent blk -> String -> String
Show)
data TraceIteratorEvent blk
= UnknownRangeRequested (UnknownRange blk)
| StreamFromVolatileDB
(StreamFrom blk)
(StreamTo blk)
[RealPoint blk]
| StreamFromImmutableDB
(StreamFrom blk)
(StreamTo blk)
| StreamFromBoth
(StreamFrom blk)
(StreamTo blk)
[RealPoint blk]
| BlockMissingFromVolatileDB (RealPoint blk)
| BlockWasCopiedToImmutableDB (RealPoint blk)
| BlockGCedFromVolatileDB (RealPoint blk)
| SwitchBackToVolatileDB
deriving ((forall x.
TraceIteratorEvent blk -> Rep (TraceIteratorEvent blk) x)
-> (forall x.
Rep (TraceIteratorEvent blk) x -> TraceIteratorEvent blk)
-> Generic (TraceIteratorEvent blk)
forall x. Rep (TraceIteratorEvent blk) x -> TraceIteratorEvent blk
forall x. TraceIteratorEvent blk -> Rep (TraceIteratorEvent blk) x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall blk x.
Rep (TraceIteratorEvent blk) x -> TraceIteratorEvent blk
forall blk x.
TraceIteratorEvent blk -> Rep (TraceIteratorEvent blk) x
$cto :: forall blk x.
Rep (TraceIteratorEvent blk) x -> TraceIteratorEvent blk
$cfrom :: forall blk x.
TraceIteratorEvent blk -> Rep (TraceIteratorEvent blk) x
Generic, TraceIteratorEvent blk -> TraceIteratorEvent blk -> Bool
(TraceIteratorEvent blk -> TraceIteratorEvent blk -> Bool)
-> (TraceIteratorEvent blk -> TraceIteratorEvent blk -> Bool)
-> Eq (TraceIteratorEvent blk)
forall blk.
StandardHash blk =>
TraceIteratorEvent blk -> TraceIteratorEvent blk -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TraceIteratorEvent blk -> TraceIteratorEvent blk -> Bool
$c/= :: forall blk.
StandardHash blk =>
TraceIteratorEvent blk -> TraceIteratorEvent blk -> Bool
== :: TraceIteratorEvent blk -> TraceIteratorEvent blk -> Bool
$c== :: forall blk.
StandardHash blk =>
TraceIteratorEvent blk -> TraceIteratorEvent blk -> Bool
Eq, Int -> TraceIteratorEvent blk -> String -> String
[TraceIteratorEvent blk] -> String -> String
TraceIteratorEvent blk -> String
(Int -> TraceIteratorEvent blk -> String -> String)
-> (TraceIteratorEvent blk -> String)
-> ([TraceIteratorEvent blk] -> String -> String)
-> Show (TraceIteratorEvent blk)
forall blk.
StandardHash blk =>
Int -> TraceIteratorEvent blk -> String -> String
forall blk.
StandardHash blk =>
[TraceIteratorEvent blk] -> String -> String
forall blk. StandardHash blk => TraceIteratorEvent blk -> String
forall a.
(Int -> a -> String -> String)
-> (a -> String) -> ([a] -> String -> String) -> Show a
showList :: [TraceIteratorEvent blk] -> String -> String
$cshowList :: forall blk.
StandardHash blk =>
[TraceIteratorEvent blk] -> String -> String
show :: TraceIteratorEvent blk -> String
$cshow :: forall blk. StandardHash blk => TraceIteratorEvent blk -> String
showsPrec :: Int -> TraceIteratorEvent blk -> String -> String
$cshowsPrec :: forall blk.
StandardHash blk =>
Int -> TraceIteratorEvent blk -> String -> String
Show)