This is a re-attempt of #28765
The main differences from it are:
- Most outstanding comments have been addressed (or responded to on the original PR)
- The description of how a node is picked in
IsFanoutTarget
has been updated to reflect what the algorithm is doing (not how it is doing it) - The way
hash_key
is seeded inIsFanoutTarget
has changed (fromm_k0
tonode_id
). This is to prevent usingm_k0
for something it is not intended to, given what data we feed to the randomizer should not matter for this - The cache in
IsFanoutTarget
was only being fed data to, but never checked. This has been reworked to make use of it destinations/target
has been renamed ton
inShouldFanoutTo/IsFanoutTarget
- The PR has been rebased
Also, the following things have been added/changed to the approach:
- Deal with short id collisions by fanning out both transactions
- Deal with ancestors being present on the mempool when a child needs to be placed in the fanout or reconciliation sets (as opposed to dealing with parents, which was the wrong approach)
- Move fanout/reconcile logic from INV creation to
RelayTransaction
The differences can be easily checked via git range-diff a14dfd9c873d1e196252c77ad7a8b32bd21b6f6d...2e0b6742b82e60ea685afd25f2d19b8b558678ce
Erlay Project Tracking: https://github.com/bitcoin/bitcoin/issues/30249