mempoolfullrbf
allows a node to accept replace-by-fee transactions without requiring replaceability signaling. While the replacement transaction is locally accepted, it should be rejected by all your opt-in rbf peers, the default behavior. As such, the odds are low the replacement transaction propagates to miners, unless there are full-rbf transaction-relay paths existent between the node and those miners mempools.
This PR aims to improve this issue by enabling the setting of full-rbf transaction-relay link, in both manual and automated fashions.
The first commit introduces a NODE_REPLACE_BY_FEE
service flag to advertise support of full-rbf to our peers if mempoolfullrbf
is set to true. From the results of getpeerinfo
or getnetworkinfo
, a node operator can find full-rbf peers on the p2p network to which to manually connect to. The service flag bit select is the 26th one to be compatible with previous full-rbf experiences.
The second commit introduces a ConnectionType::FULLRBF
if mempoolfullrbf
is set to true. In ThreadOpenConnections
, we attempt to keep opened at least 4 outbound full-rbf transaction-relay peer. An outbound full-rbf relay peer is considered as one signaling NODE_REPLACE_BY_FEE
service flag.
I think if we have concerns on the network-wise resources consumption from those new outbound full-rbf relay peers, we could deduce them MAX_ADNNODE_CONNECTIONS
. It should be weighted if we have other concerns about the implications on transaction-relay topology robustness or any spying peers flagging themselves as NODE_REPLACE_BY_FEE
to attract early full-rbf traffic. What else ?
I don’t hold to the approach re-using the current automatic connection logic in ThreadOpenConnections
, if there are others ones I’m interested to consider them. I can split the PR in two, if automatic connection requires more thinking.
TODO:
- add functional tests
- make
MAX_FULLRBF_RELAY_CONNECTIONS
configurable up toMAX_ADDNODE_CONNECTIONS
? - make automatic connection its own boolean setting ?