ouroboros-network-protocols-0.8.1.0: Ouroboros Network Protocols
Safe HaskellSafe-Inferred
LanguageHaskell2010

Ouroboros.Network.Protocol.ChainSync.PipelineDecision

Synopsis

Documentation

data PipelineDecision n where Source #

Pipeline decision: we can do either one of these:

  • non-pipelined request
  • pipeline a request
  • collect or pipeline, but only when there are pipelined requests
  • collect, as above, only when there are pipelined requests

There might be other useful pipelining scenarios: collect a given number of requests (which also can be used to collect all outstanding requests).

data MkPipelineDecision where Source #

The callback gets the following arguments:

  • how many requests are not yet collected (in flight or already queued)
  • block number of client's tip
  • block number of server's tip

Client's tip block number and server's tip block number can only be equal (from the client's perspective) when both the client's and the server's tip headers agree. If they would not agree (server forked), then the server sends MsgRollBackward, which rolls back one block and causes the client's tip and the server's tip to differ.

In this module we implement three pipelining strategies:

pipelineDecisionMaxWord16Nat n → WithOrigin BlockNoWithOrigin BlockNoPipelineDecision n Source #

Present maximal pipelining of at most omax requests. Collect responses either when we are at the same block number as the server or when we sent more than omax requests.

If omax = 3 this pipelining strategy will generate a sequence: Pipeline Pipeline Pipeline Collect Pipeline Collect .... Pipeline Collect Collect Collect

pipelineDecisionMinWord16Nat n → WithOrigin BlockNoWithOrigin BlockNoPipelineDecision n Source #

Present minimum pipelining of at most omax requests, collect responses eagerly.

pipelineDecisionLowHighMarkWord16Word16MkPipelineDecision Source #

Pipelining strategy which pipelines up to highMark requests; if the number of pipelined messages exceeds the high mark, it collects messages until there are at most lowMark outstanding requests.