ouroboros-network-0.1.0.1: A networking layer for the Ouroboros blockchain protocol
Safe Haskell None
Language Haskell2010

Ouroboros.Network.BlockFetch.State

Synopsis

Documentation

data FetchTriggerVariables peer header m Source #

STM actions to read various state variables that the fetch logic depends upon. Any change in these variables is a trigger to re-evaluate the decision on what blocks to fetch.

Note that this is a "level trigger" not an "edge trigger": we do not have to re-evaluate on every change, it is sufficient to re-evaluate at some stage after one or more changes. This means it is ok to get somewhat behind, and it is not necessary to determine exactly what changed, just that there was some change.

data FetchNonTriggerVariables peer header block m Source #

STM actions to read various state variables that the fetch logic uses. While the decisions do make use of the values of these variables, it is not necessary to re-evaluate when these variables change.

type FetchDecision result = Either FetchDecline result Source #

Throughout the decision making process we accumulate reasons to decline to fetch any blocks. This type is used to wrap intermediate and final results.

data FetchMode Source #

Constructors

FetchModeBulkSync

Use this mode when we are catching up on the chain but are stil well behind. In this mode the fetch logic will optimise for throughput rather than latency.

FetchModeDeadline

Use this mode for block-producing nodes that have a known deadline to produce a block and need to get the best chain before that. In this mode the fetch logic will optimise for picking the best chain within the given deadline.

data TraceLabelPeer peerid a Source #

A peer label for use in Tracer s. This annotates tracer output as being associated with a given peer identifier.

Constructors

TraceLabelPeer peerid a

data TraceFetchClientState header Source #

Tracing types for the various events that change the state (i.e. FetchClientStateVars ) for a block fetch client.

Note that while these are all state changes, the AddedFetchRequest occurs in the decision thread while the other state changes occur in the block fetch client threads.

Constructors

AddedFetchRequest ( FetchRequest header) ( PeerFetchInFlight header) PeerFetchInFlightLimits ( PeerFetchStatus header)

The block fetch decision thread has added a new fetch instruction consisting of one or more individual request ranges.

AcknowledgedFetchRequest ( FetchRequest header)

Mark the point when the fetch client picks up the request added by the block fetch decision thread. Note that this event can happen fewer times than the AddedFetchRequest due to fetch request merging.

SendFetchRequest ( AnchoredFragment header)

Mark the point when fetch request for a fragment is actually sent over the wire.

StartedFetchBatch ( ChainRange ( Point header)) ( PeerFetchInFlight header) PeerFetchInFlightLimits ( PeerFetchStatus header)

Mark the start of receiving a streaming batch of blocks. This will be followed by one or more CompletedBlockFetch and a final CompletedFetchBatch .

CompletedBlockFetch ( Point header) ( PeerFetchInFlight header) PeerFetchInFlightLimits ( PeerFetchStatus header) NominalDiffTime SizeInBytes

Mark the completion of of receiving a single block within a streaming batch of blocks.

CompletedFetchBatch ( ChainRange ( Point header)) ( PeerFetchInFlight header) PeerFetchInFlightLimits ( PeerFetchStatus header)

Mark the successful end of receiving a streaming batch of blocks

RejectedFetchBatch ( ChainRange ( Point header)) ( PeerFetchInFlight header) PeerFetchInFlightLimits ( PeerFetchStatus header)

If the other peer rejects our request then we have this event instead of StartedFetchBatch and CompletedFetchBatch .

ClientTerminating Int

The client is terminating. Log the number of outstanding requests.