Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Ouroboros.Network.Protocol.TxSubmission2.Type
Description
The type of the transaction submission protocol.
This is used to relay transactions between nodes.
Synopsis
- data TxSubmission2 txid tx where
- StInit ∷ TxSubmission2 txid tx
- StIdle ∷ TxSubmission2 txid tx
- StTxIds ∷ StBlockingStyle → TxSubmission2 txid tx
- StTxs ∷ TxSubmission2 txid tx
- StDone ∷ TxSubmission2 txid tx
- data family Message ps (st ∷ ps) (st' ∷ ps)
- data family ClientHasAgency (st ∷ ps)
- data family ServerHasAgency (st ∷ ps)
- data family NobodyHasAgency (st ∷ ps)
- data TokBlockingStyle (k ∷ StBlockingStyle) where
- data StBlockingStyle where
- data BlockingReplyList (blocking ∷ StBlockingStyle) a where
- newtype NumTxIdsToAck = NumTxIdsToAck {}
- newtype NumTxIdsToReq = NumTxIdsToReq {}
- newtype SizeInBytes = SizeInBytes {}
- type TxSizeInBytes = SizeInBytes
Documentation
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
StInit ∷ TxSubmission2 txid tx | Initial protocol message. |
StIdle ∷ TxSubmission2 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. |
StTxIds ∷ StBlockingStyle → TxSubmission2 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. |
StTxs ∷ TxSubmission2 txid tx | The client (outbound side) has agency; it must reply with the list of transactions. |
StDone ∷ TxSubmission2 txid tx | Nobody has agency; termination state. |
Instances
data family Message ps (st ∷ ps) (st' ∷ ps) Source #
The messages for this protocol. It is expected to be a GADT that is
indexed by the from
and to
protocol states. That is the protocol state
the message transitions from, and the protocol state it transitions into.
These are the edges of the protocol state transition system.
Instances
(Show block, Show point) ⇒ Show (Message (BlockFetch block point) from to) Source # | |
Defined in Ouroboros.Network.Protocol.BlockFetch.Type | |
(Show header, Show point, Show tip) ⇒ Show (Message (ChainSync header point tip) from to) Source # | |
Show (Message KeepAlive from to) Source # | |
(ShowQuery query, Show point) ⇒ Show (Message (LocalStateQuery block point query) st st') Source # | |
(Show txid, Show tx, Show slot) ⇒ Show (Message (LocalTxMonitor txid tx slot) from to) Source # | |
(Show tx, Show reject) ⇒ Show (Message (LocalTxSubmission tx reject) from to) Source # | |
Show peer ⇒ Show (Message (PeerSharing peer) from to) Source # | |
Defined in Ouroboros.Network.Protocol.PeerSharing.Type | |
(Show txid, Show tx) ⇒ Show (Message (TxSubmission2 txid tx) from to) Source # | |
(NFData block, NFData point) ⇒ NFData (Message (BlockFetch block point) from to) Source # | |
Defined in Ouroboros.Network.Protocol.BlockFetch.Type Methods rnf ∷ Message (BlockFetch block point) from to → () # | |
(NFData header, NFData point, NFData tip) ⇒ NFData (Message (ChainSync header point tip) from to) Source # | |
Defined in Ouroboros.Network.Protocol.ChainSync.Type | |
NFData (Message KeepAlive from to) Source # | |
Defined in Ouroboros.Network.Protocol.KeepAlive.Type | |
(∀ result. NFData (query result), NFData point) ⇒ NFData (Message (LocalStateQuery block point query) from to) Source # | |
Defined in Ouroboros.Network.Protocol.LocalStateQuery.Type Methods rnf ∷ Message (LocalStateQuery block point query) from to → () # | |
(NFData txid, NFData tx, NFData slot) ⇒ NFData (Message (LocalTxMonitor txid tx slot) from to) Source # | |
Defined in Ouroboros.Network.Protocol.LocalTxMonitor.Type Methods rnf ∷ Message (LocalTxMonitor txid tx slot) from to → () # | |
(NFData tx, NFData reject) ⇒ NFData (Message (LocalTxSubmission tx reject) from to) Source # | |
Defined in Ouroboros.Network.Protocol.LocalTxSubmission.Type Methods rnf ∷ Message (LocalTxSubmission tx reject) from to → () # | |
NFData peerAddress ⇒ NFData (Message (PeerSharing peerAddress) from to) Source # | |
Defined in Ouroboros.Network.Protocol.PeerSharing.Type Methods rnf ∷ Message (PeerSharing peerAddress) from to → () # | |
(NFData txid, NFData tx) ⇒ NFData (Message (TxSubmission2 txid tx) from to) Source # | |
Defined in Ouroboros.Network.Protocol.TxSubmission2.Type Methods rnf ∷ Message (TxSubmission2 txid tx) from to → () # | |
(Eq tx, Eq reject) ⇒ Eq (Message (LocalTxSubmission tx reject) from to) Source # | |
Defined in Ouroboros.Network.Protocol.LocalTxSubmission.Type Methods (==) ∷ Message (LocalTxSubmission tx reject) from to → Message (LocalTxSubmission tx reject) from to → Bool # (/=) ∷ Message (LocalTxSubmission tx reject) from to → Message (LocalTxSubmission tx reject) from to → Bool # | |
(Eq txid, Eq tx) ⇒ Eq (Message (TxSubmission2 txid tx) from to) Source # | |
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 # | |
data Message KeepAlive (from ∷ KeepAlive) (to ∷ KeepAlive) Source # | |
data Message (PeerSharing peerAddress) (from ∷ PeerSharing peerAddress) (to ∷ PeerSharing peerAddress) Source # | |
Defined in Ouroboros.Network.Protocol.PeerSharing.Type data Message (PeerSharing peerAddress) (from ∷ PeerSharing peerAddress) (to ∷ PeerSharing peerAddress) where
| |
data Message (BlockFetch block point) (from ∷ BlockFetch block point) (to ∷ BlockFetch block point) Source # | |
Defined in Ouroboros.Network.Protocol.BlockFetch.Type data Message (BlockFetch block point) (from ∷ BlockFetch block point) (to ∷ BlockFetch block point) where
| |
data Message (LocalTxSubmission tx reject) (from ∷ LocalTxSubmission tx reject) (to ∷ LocalTxSubmission tx reject) Source # | |
Defined in Ouroboros.Network.Protocol.LocalTxSubmission.Type data Message (LocalTxSubmission tx reject) (from ∷ LocalTxSubmission tx reject) (to ∷ LocalTxSubmission tx reject) where
| |
data Message (TxSubmission2 txid tx) (from ∷ TxSubmission2 txid tx) (to ∷ TxSubmission2 txid tx) Source # | |
Defined in Ouroboros.Network.Protocol.TxSubmission2.Type data Message (TxSubmission2 txid tx) (from ∷ TxSubmission2 txid tx) (to ∷ TxSubmission2 txid tx) where
| |
data Message (LocalStateQuery block point query) (from ∷ LocalStateQuery block point query) (to ∷ LocalStateQuery block point query) Source # | |
Defined in Ouroboros.Network.Protocol.LocalStateQuery.Type data Message (LocalStateQuery block point query) (from ∷ LocalStateQuery block point query) (to ∷ LocalStateQuery block point query) where
| |
data Message (ChainSync header point tip) (from ∷ ChainSync header point tip) (to ∷ ChainSync header point tip) Source # | |
Defined in Ouroboros.Network.Protocol.ChainSync.Type data Message (ChainSync header point tip) (from ∷ ChainSync header point tip) (to ∷ ChainSync header point tip) where
| |
data Message (LocalTxMonitor txid tx slot) (from ∷ LocalTxMonitor txid tx slot) (to ∷ LocalTxMonitor txid tx slot) Source # | |
Defined in Ouroboros.Network.Protocol.LocalTxMonitor.Type data Message (LocalTxMonitor txid tx slot) (from ∷ LocalTxMonitor txid tx slot) (to ∷ LocalTxMonitor txid tx slot) where
|
data family ClientHasAgency (st ∷ ps) Source #
Tokens for those protocol states in which the client has agency.
Instances
data family ServerHasAgency (st ∷ ps) Source #
Tokens for those protocol states in which the server has agency.
Instances
data family NobodyHasAgency (st ∷ ps) Source #
Tokens for terminal protocol states in which neither the client nor server has agency.
Instances
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.
Constructors
TokBlocking ∷ TokBlockingStyle StBlocking | |
TokNonBlocking ∷ TokBlockingStyle StNonBlocking |
Instances
Show (TokBlockingStyle b) Source # | |
Defined in Ouroboros.Network.Protocol.TxSubmission2.Type Methods showsPrec ∷ Int → TokBlockingStyle b → ShowS # show ∷ TokBlockingStyle b → String # showList ∷ [TokBlockingStyle b] → ShowS # | |
NFData (TokBlockingStyle b) Source # | |
Defined in Ouroboros.Network.Protocol.TxSubmission2.Type Methods rnf ∷ TokBlockingStyle b → () # | |
Eq (TokBlockingStyle b) Source # | |
Defined in Ouroboros.Network.Protocol.TxSubmission2.Type Methods (==) ∷ TokBlockingStyle b → TokBlockingStyle b → Bool # (/=) ∷ TokBlockingStyle b → TokBlockingStyle b → Bool # |
data StBlockingStyle where Source #
Constructors
StBlocking ∷ StBlockingStyle | In this sub-state the reply need not be prompt. There is no timeout. |
StNonBlocking ∷ StBlockingStyle | In this state the peer must reply. There is a timeout. |
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.
Constructors
BlockingReply ∷ NonEmpty a → BlockingReplyList StBlocking a | |
NonBlockingReply ∷ [a] → BlockingReplyList StNonBlocking a |
Instances
Show a ⇒ Show (BlockingReplyList blocking a) Source # | |
Defined in Ouroboros.Network.Protocol.TxSubmission2.Type Methods showsPrec ∷ Int → BlockingReplyList blocking a → ShowS # show ∷ BlockingReplyList blocking a → String # showList ∷ [BlockingReplyList blocking a] → ShowS # | |
NFData a ⇒ NFData (BlockingReplyList blocking a) Source # | |
Defined in Ouroboros.Network.Protocol.TxSubmission2.Type Methods rnf ∷ BlockingReplyList blocking a → () # | |
Eq a ⇒ Eq (BlockingReplyList blocking a) Source # | |
Defined in Ouroboros.Network.Protocol.TxSubmission2.Type Methods (==) ∷ BlockingReplyList blocking a → BlockingReplyList blocking a → Bool # (/=) ∷ BlockingReplyList blocking a → BlockingReplyList blocking a → Bool # |
newtype NumTxIdsToAck Source #
Constructors
NumTxIdsToAck | |
Fields |
Instances
newtype NumTxIdsToReq Source #
Constructors
NumTxIdsToReq | |
Fields |
Instances
newtype SizeInBytes Source #
Constructors
SizeInBytes | |
Fields |
Instances
type TxSizeInBytes = SizeInBytes Source #
Deprecated: Use SizeInBytes
instead
Transactions are typically not big, but in principle in future we could have ones over 64k large.