BIP 331 implements receiver-initiated package relay, where receivers can request missing information about packages. However, this requires excessive round trips. If the sender knows that it is giving the receiver a transaction for which it doesn’t have the ancestors, it should be able to just send a package (containing the transaction and the unknown ancestor(s)) instead.
This PR could potentially reduce some bandwidth, and could also reduce the number of transactions in the orphanage. However, if a node is sending packages that the receiver already knows about, this could increase significant bandwidth. As a result, this PR needs more testing. I did some initial testing between two nodes with sendpackages enabled, and it showed that no redundant packages were sent, which indicates that this may be a useful feature.
This PR implements the following:
- signaling support for
sendpackagesand the corresponding negotiation logic - a node will send a
pkgtxnsmessage to the receiver node if the ancestor of a transaction that has been requested is not in the receiver node’sm_tx_inventory_known_filter - nodes can process
pkgtxnsmessages - the maximum number of transactions that can be sent through sender-initialized package relay has been set to 2, although this can be changed in the future
- adds logging, functional tests, and fuzzing (for
ReceivedPackage)
Thank you to glozow for her help with this PR!