Thesis

When selecting what peers we should be fanning out transaction to, a question arises for whether peers that already know about it should also be considered. In none of the cases the transaction would be announced more than once, but, in theory, the peer selection strategy affects how the fanout rate evolves with respect to the transaction propagation rate.

Filtering nodes that already know the transaction

Filtering out nodes based on the knowledge of the transaction should have the effect that the fanout rate stays high when the propagation of the transaction is low, and it should decrease gradually when the transaction reaches a bigger chunk of the network. This is because, as long as the number of peers that don’t know about the transaction is smaller than our fanout target rate, the rate would remain constant, and once the number grows too small, the remaining peers will be picked.

Not filtering based on transaction knowledge

Not filtering peers should have a less smooth effect. It means that, on average, nodes should be able to reach the target fanout rate when not many of their peers know about the transaction, and hit mostly peers that already know about it the further the transaction has propagated. However, some nodes could be “unlucky” for the propagation of certain transactions, hitting mostly peers that already know about it, and achieving a fanout rate bellow what would be expected based on how much the transaction has propagated.

Simulation

To simulate the difference between this two approaches, a new filtering functionality has been added to the simulator that would filter fanout candidates based on their knowledge of the transaction (local knowledge, as seen by the node that makes the decision, not the global simulation knowledge). The code for this can be found at https://github.com/sr-gi/hyperion/pull/31

Results

The main result from this simulation is that there is no significant difference between filtering or not, which, surprisingly, didn’t fit our thesis.

Here are the results of a network of 110000 nodes, 10000 reachable, 100000 unreachable with 8 outbounds per node without filtering:

2024-12-17T18:45:04.569Z INFO  [hyper_lib::simulator] Using user provided rng seed: 14569482637851975056
2024-12-17T18:45:04.578Z INFO  [hyper_lib::network] Creating nodes (110000: 10000 reachable, 100000 unreachable)
2024-12-17T18:45:04.721Z INFO  [hyperion] The simulation will be run 100 times and results will be averaged
2024-12-17T18:49:49.995Z INFO  [hyper_lib] Transaction reached 90% of nodes in the network in 20.593739s
2024-12-17T18:49:49.995Z INFO  [hyper_lib] Reachable nodes sent/received 219.7265/365.32852 messages (715.5123/1067.8059 bytes) (avg)
2024-12-17T18:49:49.995Z INFO  [hyper_lib] Unreachable nodes sent/received 31.987862/17.427662 messages (94.282135/59.05277 bytes) (avg)

The same simulation with filtering yields:

2024-12-17T18:56:26.415Z INFO  [hyper_lib::simulator] Using user provided rng seed: 14569482637851975056
2024-12-17T18:56:26.422Z INFO  [hyper_lib::network] Creating nodes (110000: 10000 reachable, 100000 unreachable)
2024-12-17T18:56:26.568Z INFO  [hyperion] The simulation will be run 100 times and results will be averaged
2024-12-17T19:01:15.641Z INFO  [hyper_lib] Transaction reached 90% of nodes in the network in 20.795815s
2024-12-17T19:01:15.641Z INFO  [hyper_lib] Reachable nodes sent/received 222.6441/371.3514 messages (720.47595/1109.9666 bytes) (avg)
2024-12-17T19:01:15.641Z INFO  [hyper_lib] Unreachable nodes sent/received 32.525223/17.654491 messages (98.37036/59.421295 bytes) (avg)

The results are within the expected variance for simulations of the same setup. For comparison purposes, here is a re-run of the same simulation without filtering:

2024-12-17T19:02:32.958Z INFO  [hyper_lib::simulator] Using user provided rng seed: 14569482637851975056
2024-12-17T19:02:32.965Z INFO  [hyper_lib::network] Creating nodes (110000: 10000 reachable, 100000 unreachable)
2024-12-17T19:02:33.115Z INFO  [hyperion] The simulation will be run 100 times and results will be averaged
2024-12-17T19:07:24.090Z INFO  [hyper_lib] Transaction reached 90% of nodes in the network in 20.801981s
2024-12-17T19:07:24.090Z INFO  [hyper_lib] Reachable nodes sent/received 222.98781/371.10538 messages (715.7427/1070.6921 bytes) (avg)
2024-12-17T19:07:24.090Z INFO  [hyper_lib] Unreachable nodes sent/received 32.490536/17.67878 messages (94.54821/59.053257 bytes) (avg)