ouroboros-consensus-0.28.0.0: Consensus layer for the Ouroboros blockchain protocol
Safe HaskellNone
LanguageHaskell2010

Ouroboros.Consensus.Storage.LedgerDB.V2.LSM

Description

Implementation of the LedgerTablesHandle interface with LSM trees.

Synopsis

Backend API

data LSM Source #

Instances

Instances details
(MemPack (TxIn l), IndexedMemPack (l EmptyMK) (TxOut l), IOLike m) ⇒ StreamingBackend m LSM l Source # 
Instance details

Defined in Ouroboros.Consensus.Storage.LedgerDB.V2.LSM

Associated Types

data YieldArgs m LSM l 
Instance details

Defined in Ouroboros.Consensus.Storage.LedgerDB.V2.LSM

data SinkArgs m LSM l 
Instance details

Defined in Ouroboros.Consensus.Storage.LedgerDB.V2.LSM

Methods

yieldProxy LSMYieldArgs m LSM l → Yield m l Source #

sinkProxy LSMSinkArgs m LSM l → Sink m l Source #

(LedgerSupportsProtocol blk, IOLike m, LedgerDbSerialiseConstraints blk, HasLedgerTables (LedgerState blk)) ⇒ Backend m LSM blk Source # 
Instance details

Defined in Ouroboros.Consensus.Storage.LedgerDB.V2.LSM

Generic (Resources m LSM) Source # 
Instance details

Defined in Ouroboros.Consensus.Storage.LedgerDB.V2.LSM

Associated Types

type Rep (Resources m LSM) 
Instance details

Defined in Ouroboros.Consensus.Storage.LedgerDB.V2.LSM

type Rep (Resources m LSM) = D1 ('MetaData "Resources" "Ouroboros.Consensus.Storage.LedgerDB.V2.LSM" "ouroboros-consensus-0.28.0.0-inplace-ouroboros-consensus-lsm" 'False) (C1 ('MetaCons "LSMResources" 'PrefixI 'True) (S1 ('MetaSel ('Just "sessionKey") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (ResourceKey m)) :*: (S1 ('MetaSel ('Just "sessionResource") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Session m)) :*: S1 ('MetaSel ('Just "blockIOKey") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (ResourceKey m)))))

Methods

fromResources m LSMRep (Resources m LSM) x #

toRep (Resources m LSM) x → Resources m LSM #

Show (Trace m LSM) Source # 
Instance details

Defined in Ouroboros.Consensus.Storage.LedgerDB.V2.LSM

Methods

showsPrecIntTrace m LSMShowS #

showTrace m LSMString #

showList ∷ [Trace m LSM] → ShowS #

IOLike m ⇒ NoThunks (Resources m LSM) Source # 
Instance details

Defined in Ouroboros.Consensus.Storage.LedgerDB.V2.LSM

data SinkArgs m LSM l Source # 
Instance details

Defined in Ouroboros.Consensus.Storage.LedgerDB.V2.LSM

data YieldArgs m LSM l Source # 
Instance details

Defined in Ouroboros.Consensus.Storage.LedgerDB.V2.LSM

data Args m LSM Source # 
Instance details

Defined in Ouroboros.Consensus.Storage.LedgerDB.V2.LSM

data Resources m LSM Source # 
Instance details

Defined in Ouroboros.Consensus.Storage.LedgerDB.V2.LSM

data Trace m LSM Source # 
Instance details

Defined in Ouroboros.Consensus.Storage.LedgerDB.V2.LSM

type Rep (Resources m LSM) Source # 
Instance details

Defined in Ouroboros.Consensus.Storage.LedgerDB.V2.LSM

type Rep (Resources m LSM) = D1 ('MetaData "Resources" "Ouroboros.Consensus.Storage.LedgerDB.V2.LSM" "ouroboros-consensus-0.28.0.0-inplace-ouroboros-consensus-lsm" 'False) (C1 ('MetaCons "LSMResources" 'PrefixI 'True) (S1 ('MetaSel ('Just "sessionKey") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (ResourceKey m)) :*: (S1 ('MetaSel ('Just "sessionResource") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Session m)) :*: S1 ('MetaSel ('Just "blockIOKey") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (ResourceKey m)))))

class NoThunks (Resources m backend) ⇒ Backend (m ∷ TypeType) backend blk where Source #

Operations needed to open and operate a LedgerDB V2

Associated Types

data Args (m ∷ TypeType) backend Source #

The Arguments that will be used initially to create the Resources.

data Resources (m ∷ TypeType) backend Source #

The Resources that will be stored in the LedgerDB environment and given to the handle operations.

data Trace (m ∷ TypeType) backend Source #

A trace dependent on the particular backend.

Methods

mkResourcesProxy blk → Tracer m LedgerDBV2TraceArgs m backend → ResourceRegistry m → SomeHasFS m → m (Resources m backend) Source #

Transform Args into Resources, with some context made up of LedgerDbArgs.

releaseResourcesProxy blk → Resources m backend → m () Source #

Release the acquired resources.

newHandleFromValuesTracer m LedgerDBV2TraceResourceRegistry m → Resources m backend → ExtLedgerState blk ValuesMK → m (LedgerTablesHandle m (ExtLedgerState blk)) Source #

Create a new handle from the given values. This will only be called when starting Consensus from Genesis.

newHandleFromSnapshotTracer m LedgerDBV2TraceResourceRegistry m → CodecConfig blk → SomeHasFS m → Resources m backend → DiskSnapshotExceptT (SnapshotFailure blk) m (LedgerSeq' m blk, RealPoint blk) Source #

Create a new handle from a snapshot.

snapshotManagerProxy blk → Resources m backend → CodecConfig blk → Tracer m (TraceSnapshotEvent blk) → SomeHasFS m → SnapshotManager m m blk (StateRef m (ExtLedgerState blk)) Source #

Instantiate the SnapshotManager for this backend.

Instances

Instances details
(IOLike m, LedgerDbSerialiseConstraints blk, LedgerSupportsProtocol blk, LedgerSupportsInMemoryLedgerDB (LedgerState blk)) ⇒ Backend m Mem blk 
Instance details

Defined in Ouroboros.Consensus.Storage.LedgerDB.V2.InMemory

Associated Types

data Args m Mem 
Instance details

Defined in Ouroboros.Consensus.Storage.LedgerDB.V2.InMemory

data Args m Mem = InMemArgs
newtype Resources m Mem 
Instance details

Defined in Ouroboros.Consensus.Storage.LedgerDB.V2.InMemory

newtype Trace m Mem 
Instance details

Defined in Ouroboros.Consensus.Storage.LedgerDB.V2.InMemory

newtype Trace m Mem = NoTrace Void
(LedgerSupportsProtocol blk, IOLike m, LedgerDbSerialiseConstraints blk, HasLedgerTables (LedgerState blk)) ⇒ Backend m LSM blk Source # 
Instance details

Defined in Ouroboros.Consensus.Storage.LedgerDB.V2.LSM

data family Args (m ∷ TypeType) backend Source #

The Arguments that will be used initially to create the Resources.

Instances

Instances details
data Args m Mem 
Instance details

Defined in Ouroboros.Consensus.Storage.LedgerDB.V2.InMemory

data Args m Mem = InMemArgs
data Args m LSM Source # 
Instance details

Defined in Ouroboros.Consensus.Storage.LedgerDB.V2.LSM

mkLSMArgs ∷ (LedgerSupportsProtocol blk, LedgerDbSerialiseConstraints blk) ⇒ Proxy blk → FilePathFilePathStdGen → (LedgerDbBackendArgs IO blk, StdGen) Source #

Create arguments for initializing the LedgerDB using the LSM-trees backend.

Streaming

data family YieldArgs (m ∷ TypeType) backend (l ∷ (TypeTypeType) → Type) Source #

Instances

Instances details
data YieldArgs m Mem l 
Instance details

Defined in Ouroboros.Consensus.Storage.LedgerDB.V2.InMemory

data YieldArgs m LSM l Source # 
Instance details

Defined in Ouroboros.Consensus.Storage.LedgerDB.V2.LSM

mkLSMYieldArgs Source #

Arguments

∷ (IOLike m, HasLedgerTables l, IndexedMemPack (l EmptyMK) (TxOut l)) 
FilePath

The filepath in which the LSM database lives. Must not have a trailing slash!

String

The complete name of the snapshot to open, so slotno[_suffix].

→ (FilePathResourceRegistry m → m (a, SomeHasFSAndBlockIO m))

Usually stdMkBlockIOFS

→ m StdGen

Usually newStdGen

→ l EmptyMK 
ResourceRegistry m 
→ m (YieldArgs m LSM l) 

Create Yield arguments for LSM

data family SinkArgs (m ∷ TypeType) backend (l ∷ (TypeTypeType) → Type) Source #

Instances

Instances details
data SinkArgs m Mem l 
Instance details

Defined in Ouroboros.Consensus.Storage.LedgerDB.V2.InMemory

data SinkArgs m LSM l Source # 
Instance details

Defined in Ouroboros.Consensus.Storage.LedgerDB.V2.LSM

mkLSMSinkArgs Source #

Arguments

IOLike m 
FilePath

The filepath in which the LSM database should be opened. Must not have a trailing slash!

String

The complete name of the snapshot to be created, so slotno[_suffix].

→ (FilePathResourceRegistry m → m (a, SomeHasFSAndBlockIO m))

Usually stdMkBlockIOFS

→ m StdGen

Usually newStdGen

→ l EmptyMK 
ResourceRegistry m 
→ m (SinkArgs m LSM l) 

Create Sink arguments for LSM

Exported for tests

type Salt = Word64 Source #

The session salt is used to secure the hash operations in the Bloom filters.

The value of the salt must be kept secret. Otherwise, there are no restrictions on the value.

data SomeHasFSAndBlockIO (m ∷ TypeType) where Source #

Constructors

SomeHasFSAndBlockIO ∷ ∀ h (m ∷ TypeType). (Eq h, Typeable h) ⇒ HasFS m h → HasBlockIO m h → SomeHasFSAndBlockIO m 

Orphan instances

NoThunks (Table m txin txout Void) Source # 
Instance details

Methods

noThunksContextTable m txin txout VoidIO (Maybe ThunkInfo) Source #

wNoThunksContextTable m txin txout VoidIO (Maybe ThunkInfo) Source #

showTypeOfProxy (Table m txin txout Void) → String Source #