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

Ouroboros.Network.Protocol.TxSubmission2.Type

Description

The type of the transaction submission protocol.

This is used to relay transactions between nodes.

Synopsis

Documentation

type TxSizeInBytes = Word32 Source #

Transactions are typically not big, but in principle in future we could have ones over 64k large.

data TxSubmission2 txid tx where Source #

The kind of the transaction-submission protocol, and the types of the states in the protocol state machine.

We describe this protocol using the label "client" for the peer that is submitting transactions, and "server" for the one receiving them. The protocol is however pull based, so it is typically the server that has agency in this protocol. This is the opposite of the chain sync and block fetch protocols, but that makes sense because the information flow is also reversed: submitting transactions rather than receiving headers and blocks.

Because these client/server labels are somewhat confusing in this case, we sometimes clarify by using the terms inbound and outbound. This refers to whether transactions are flowing towards a peer or away, and thus indicates what role the peer is playing.

Constructors

StInitTxSubmission2 txid tx

Initial protocol message.

StIdleTxSubmission2 txid tx

The server (inbound side) has agency; it can either terminate, ask for transaction identifiers or ask for transactions.

There is no timeout in this state.

StTxIdsStBlockingStyleTxSubmission2 txid tx

The client (outbound side) has agency; it must reply with a list of transaction identifiers that it wishes to submit.

There are two sub-states for this, for blocking and non-blocking cases.

StTxsTxSubmission2 txid tx

The client (outbound side) has agency; it must reply with the list of transactions.

StDoneTxSubmission2 txid tx

Nobody has agency; termination state.

Instances

Instances details
(ShowProxy txid, ShowProxy tx) ⇒ ShowProxy (TxSubmission2 txid tx ∷ Type) Source # 
Instance details

Defined in Ouroboros.Network.Protocol.TxSubmission2.Type

Methods

showProxyProxy (TxSubmission2 txid tx) → String Source #

Show (ClientHasAgency st) Source # 
Instance details

Defined in Ouroboros.Network.Protocol.TxSubmission2.Type

Show (ServerHasAgency st) Source # 
Instance details

Defined in Ouroboros.Network.Protocol.TxSubmission2.Type

NFData (ClientHasAgency st) Source # 
Instance details

Defined in Ouroboros.Network.Protocol.TxSubmission2.Type

Methods

rnfClientHasAgency st → () #

NFData (NobodyHasAgency st) Source # 
Instance details

Defined in Ouroboros.Network.Protocol.TxSubmission2.Type

Methods

rnfNobodyHasAgency st → () #

NFData (ServerHasAgency st) Source # 
Instance details

Defined in Ouroboros.Network.Protocol.TxSubmission2.Type

Methods

rnfServerHasAgency st → () #

(Show txid, Show tx) ⇒ Show (Message (TxSubmission2 txid tx) from to) Source # 
Instance details

Defined in Ouroboros.Network.Protocol.TxSubmission2.Type

Methods

showsPrecIntMessage (TxSubmission2 txid tx) from to → ShowS #

showMessage (TxSubmission2 txid tx) from to → String #

showList ∷ [Message (TxSubmission2 txid tx) from to] → ShowS #

(NFData txid, NFData tx) ⇒ NFData (Message (TxSubmission2 txid tx) from to) Source # 
Instance details

Defined in Ouroboros.Network.Protocol.TxSubmission2.Type

Methods

rnfMessage (TxSubmission2 txid tx) from to → () #

NFData (PeerHasAgency pr st) Source # 
Instance details

Defined in Ouroboros.Network.Protocol.TxSubmission2.Type

Methods

rnfPeerHasAgency pr st → () #

(Eq txid, Eq tx) ⇒ Eq (Message (TxSubmission2 txid tx) from to) Source # 
Instance details

Defined in Ouroboros.Network.Protocol.TxSubmission2.Type

Methods

(==)Message (TxSubmission2 txid tx) from to → Message (TxSubmission2 txid tx) from to → Bool #

(/=)Message (TxSubmission2 txid tx) from to → Message (TxSubmission2 txid tx) from to → Bool #

Protocol (TxSubmission2 txid tx) Source #

There are some constraints of the protocol that are not captured in the types of the messages, but are documented with the messages. Violation of these constraints is also a protocol error. The constraints are intended to ensure that implementations are able to work in bounded space.

Instance details

Defined in Ouroboros.Network.Protocol.TxSubmission2.Type

Associated Types

data Message (TxSubmission2 txid tx) st st' Source #

data ClientHasAgency st Source #

data ServerHasAgency st Source #

data NobodyHasAgency st Source #

ShowProxy ('StIdleTxSubmission2 txid tx) Source # 
Instance details

Defined in Ouroboros.Network.Protocol.TxSubmission2.Type

data ClientHasAgency (st ∷ TxSubmission2 txid tx) Source # 
Instance details

Defined in Ouroboros.Network.Protocol.TxSubmission2.Type

data ClientHasAgency (st ∷ TxSubmission2 txid tx) where
data Message (TxSubmission2 txid tx) (from ∷ TxSubmission2 txid tx) (to ∷ TxSubmission2 txid tx) Source # 
Instance details

Defined in Ouroboros.Network.Protocol.TxSubmission2.Type

data Message (TxSubmission2 txid tx) (from ∷ TxSubmission2 txid tx) (to ∷ TxSubmission2 txid tx) where
data NobodyHasAgency (st ∷ TxSubmission2 txid tx) Source # 
Instance details

Defined in Ouroboros.Network.Protocol.TxSubmission2.Type

data NobodyHasAgency (st ∷ TxSubmission2 txid tx) where
data ServerHasAgency (st ∷ TxSubmission2 txid tx) Source # 
Instance details

Defined in Ouroboros.Network.Protocol.TxSubmission2.Type

data ServerHasAgency (st ∷ TxSubmission2 txid tx) where

data StBlockingStyle where Source #

Constructors

StBlockingStBlockingStyle

In this sub-state the reply need not be prompt. There is no timeout.

StNonBlockingStBlockingStyle

In this state the peer must reply. There is a timeout.

data TokBlockingStyle (k ∷ StBlockingStyle) where Source #

The value level equivalent of StBlockingStyle.

This is also used in MsgRequestTxIds where it is interpreted (and can be encoded) as a Bool with True for blocking, and False for non-blocking.

data BlockingReplyList (blocking ∷ StBlockingStyle) a where Source #

We have requests for lists of things. In the blocking case the corresponding reply must be non-empty, whereas in the non-blocking case and empty reply is fine.

Instances

Instances details
Show a ⇒ Show (BlockingReplyList blocking a) Source # 
Instance details

Defined in Ouroboros.Network.Protocol.TxSubmission2.Type

Methods

showsPrecIntBlockingReplyList blocking a → ShowS #

showBlockingReplyList blocking a → String #

showList ∷ [BlockingReplyList blocking a] → ShowS #

NFData a ⇒ NFData (BlockingReplyList blocking a) Source # 
Instance details

Defined in Ouroboros.Network.Protocol.TxSubmission2.Type

Methods

rnfBlockingReplyList blocking a → () #

Eq a ⇒ Eq (BlockingReplyList blocking a) Source # 
Instance details

Defined in Ouroboros.Network.Protocol.TxSubmission2.Type

Methods

(==)BlockingReplyList blocking a → BlockingReplyList blocking a → Bool #

(/=)BlockingReplyList blocking a → BlockingReplyList blocking a → Bool #