Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- data ChainSyncClientHandle m blk = ChainSyncClientHandle {
- cschGDDKill ∷ !(m ())
- cschOnGsmStateChanged ∷ !(GsmState → Time → STM m ())
- cschState ∷ !(StrictTVar m (ChainSyncState blk))
- cschJumping ∷ !(StrictTVar m (ChainSyncJumpingState m blk))
- cschJumpInfo ∷ !(StrictTVar m (Maybe (JumpInfo blk)))
- data ChainSyncJumpingJumperState blk
- = Happy JumperInitState !(Maybe (JumpInfo blk))
- | LookingForIntersection !(JumpInfo blk) !(JumpInfo blk)
- | FoundIntersection ObjectorInitState !(JumpInfo blk) !(Point (Header blk))
- data ChainSyncJumpingState m blk
- = Dynamo !(DynamoInitState blk) !(WithOrigin SlotNo)
- | Objector !ObjectorInitState !(JumpInfo blk) !(Point (Header blk))
- | Disengaged DisengagedInitState
- | Jumper !(StrictTVar m (Maybe (JumpInfo blk))) !(ChainSyncJumpingJumperState blk)
- data ChainSyncState blk = ChainSyncState {
- csCandidate ∷ !(AnchoredFragment (Header blk))
- csIdling ∷ !Bool
- csLatestSlot ∷ !(StrictMaybe (WithOrigin SlotNo))
- data DisengagedInitState
- data DynamoInitState blk
- = DynamoStarting !(JumpInfo blk)
- | DynamoStarted
- data JumpInfo blk = JumpInfo {
- jMostRecentIntersection ∷ !(Point blk)
- jOurFragment ∷ !(AnchoredFragment (Header blk))
- jTheirFragment ∷ !(AnchoredFragment (Header blk))
- jTheirHeaderStateHistory ∷ !(HeaderStateHistory blk)
- data JumperInitState
- data ObjectorInitState
Documentation
data ChainSyncClientHandle m blk Source #
An interface to a ChainSync client that's used by other components, like the GDD governor.
ChainSyncClientHandle | |
|
Instances
data ChainSyncJumpingJumperState blk Source #
The specific state of a jumper peer. This state is to be understood as “to
the best of our knowledge”, that is “last time we asked them”. For instance,
a jumper might be marked as Happy
even though its chain has been differing
from the dynamo's for hundreds of blocks, if we haven't asked them to jump
since then.
Happy JumperInitState !(Maybe (JumpInfo blk)) | The jumper is happy with the dynamo, and we hold the jump info of the last accepted jump. |
LookingForIntersection !(JumpInfo blk) !(JumpInfo blk) | The jumper disagrees with the dynamo and we are searching where exactly that happens. All we know is a point where the jumper agrees with the dynamo and a point where the jumper disagrees with the dynamo, carried by this constructor. INVARIANT: The tip of the fragment in the good jump info (first argument) is in the fragment of the bad jump info or is an ancestor of it. |
FoundIntersection ObjectorInitState !(JumpInfo blk) !(Point (Header blk)) | The jumper disagrees with the dynamo and we have determined the latest point where dynamo and jumper agree. We store here the jump info of the latest accepted jump and the point of the earliest rejected jump. The init state indicates the initialization to use for the objector in case this jumper is promoted. |
Instances
data ChainSyncJumpingState m blk Source #
State of a peer with respect to ChainSync jumping.
Dynamo | The dynamo, of which there is exactly one unless there are no peers, runs the normal ChainSync protocol and is morally supposed to give us _the_ chain. This might not be true and the dynamo might be not be honest, but the goal of the algorithm is to eventually have an honest, alert peer as dynamo. |
| |
Objector | The objector, of which there is at most one, also runs normal ChainSync. It is a former jumper that disagreed with the dynamo. When that happened, we spun it up to let normal ChainSync and Genesis decide which one to disconnect from. |
| |
Disengaged DisengagedInitState | Headers continue to be downloaded from |
Jumper | The jumpers can be in arbitrary numbers. They are queried regularly to
see if they agree with the chain that the dynamo is serving; otherwise,
they become candidates to be the objector. See
|
|
Instances
data ChainSyncState blk Source #
A ChainSync client's state that's used by other components, like the GDD or the jumping governor.
ChainSyncState | |
|
Instances
data DisengagedInitState Source #
Disengaging | The node is being disengaged and for that we need to restart the ChainSync protocol. |
DisengagedDone |
Instances
Generic DisengagedInitState Source # | |
Defined in Ouroboros.Consensus.MiniProtocol.ChainSync.Client.State type Rep DisengagedInitState ∷ Type → Type # | |
Show DisengagedInitState Source # | |
NoThunks DisengagedInitState Source # | |
type Rep DisengagedInitState Source # | |
Defined in Ouroboros.Consensus.MiniProtocol.ChainSync.Client.State type Rep DisengagedInitState = D1 ('MetaData "DisengagedInitState" "Ouroboros.Consensus.MiniProtocol.ChainSync.Client.State" "ouroboros-consensus-0.21.0.0-inplace" 'False) (C1 ('MetaCons "Disengaging" 'PrefixI 'False) (U1 ∷ Type → Type) :+: C1 ('MetaCons "DisengagedDone" 'PrefixI 'False) (U1 ∷ Type → Type)) |
data DynamoInitState blk Source #
DynamoStarting !(JumpInfo blk) | The dynamo has not yet started jumping and we first need to jump to the given jump info to set the intersection of the ChainSync server. |
DynamoStarted |
Instances
Generic (DynamoInitState blk) Source # | |
Defined in Ouroboros.Consensus.MiniProtocol.ChainSync.Client.State type Rep (DynamoInitState blk) ∷ Type → Type # from ∷ DynamoInitState blk → Rep (DynamoInitState blk) x # to ∷ Rep (DynamoInitState blk) x → DynamoInitState blk # | |
(HasHeader blk, LedgerSupportsProtocol blk, NoThunks (Header blk)) ⇒ NoThunks (DynamoInitState blk) Source # | |
type Rep (DynamoInitState blk) Source # | |
Defined in Ouroboros.Consensus.MiniProtocol.ChainSync.Client.State type Rep (DynamoInitState blk) = D1 ('MetaData "DynamoInitState" "Ouroboros.Consensus.MiniProtocol.ChainSync.Client.State" "ouroboros-consensus-0.21.0.0-inplace" 'False) (C1 ('MetaCons "DynamoStarting" 'PrefixI 'False) (S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (JumpInfo blk))) :+: C1 ('MetaCons "DynamoStarted" 'PrefixI 'False) (U1 ∷ Type → Type)) |
The ChainSync state required for jumps
The jump info is mostly a snapshot of the KnownIntersectionState
of the
dynamo, with the difference that jTheirFragment
might be a proper prefix of
the original candidate fragment.
This can happen if we need to look for an intersection when the jumper rejects a jump.
JumpInfo | |
|
Instances
Generic (JumpInfo blk) Source # | |
HasHeader (Header blk) ⇒ Eq (JumpInfo blk) Source # | |
LedgerSupportsProtocol blk ⇒ NoThunks (JumpInfo blk) Source # | |
type Rep (JumpInfo blk) Source # | |
Defined in Ouroboros.Consensus.MiniProtocol.ChainSync.Client.State type Rep (JumpInfo blk) = D1 ('MetaData "JumpInfo" "Ouroboros.Consensus.MiniProtocol.ChainSync.Client.State" "ouroboros-consensus-0.21.0.0-inplace" 'False) (C1 ('MetaCons "JumpInfo" 'PrefixI 'True) ((S1 ('MetaSel ('Just "jMostRecentIntersection") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Point blk)) :*: S1 ('MetaSel ('Just "jOurFragment") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (AnchoredFragment (Header blk)))) :*: (S1 ('MetaSel ('Just "jTheirFragment") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (AnchoredFragment (Header blk))) :*: S1 ('MetaSel ('Just "jTheirHeaderStateHistory") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (HeaderStateHistory blk))))) |
data JumperInitState Source #
FreshJumper | The jumper hasn't been requested to jump yet |
StartedJumper |
Instances
Generic JumperInitState Source # | |
Defined in Ouroboros.Consensus.MiniProtocol.ChainSync.Client.State type Rep JumperInitState ∷ Type → Type # from ∷ JumperInitState → Rep JumperInitState x # to ∷ Rep JumperInitState x → JumperInitState # | |
Show JumperInitState Source # | |
Defined in Ouroboros.Consensus.MiniProtocol.ChainSync.Client.State showsPrec ∷ Int → JumperInitState → ShowS # show ∷ JumperInitState → String # showList ∷ [JumperInitState] → ShowS # | |
NoThunks JumperInitState Source # | |
type Rep JumperInitState Source # | |
data ObjectorInitState Source #
Starting | The objector still needs to set the intersection of the ChainSync server before resuming retrieval of headers. |
Started |