TxSubmission2
warning
TxSubmission2
has traditionally lived in the Network layer, but it is
intimately related to the Mempool. As such, we describe it here briefly, but
the Networking documentation should have more details.
TxSubmission2
is the mini protocol in charge of diffusing pending transactions
through the network. It is a pull-based miniprotocol: data is transmitted only
upon explicit request from the client.
The goal of TxSubmission2
is to let other peers know about the transactions
that the local node considers valid (with respects to the chain that the local
node has selected in Chain Selection in the
consensus layer), and transmit such transactions if requested.
Honest nodes will try to validate every transaction they come to know about.
There are some situations in which this miniprotocol would terminate abruptly, closing all the connections to the remote peer. Actions that are considered as misbehaviour are (not exclusively):
- Violation of the miniprotocol state machine,
- Too many or not enough transactions sent or acknowledged via the client or server,
- Requesting zero transactions,
- The client requesting a transaction that was not announced by the server.
warning
TODO: Make this list exhaustive
The state machine specification of TxSubmission2
and general mechanics are
described in the Networking spec.
Codecs
The transactions sent through TxSubmission2
on the Cardano network
are tagged with the index of the era they belong to. The serialization
of the transaction proper is its CBOR representation.
serialize tx = <era tag><cbor of tx>
For transaction IDs, the same mechanism is used:
serialize txid = <era tag><cbor of txid>