Use grid topology for bitfileds distribution messages (#5389)

* Move NewGossipTopology -> SessionGridTopology outside as this implementation is shared

* Add method to return peers difference between topologies

* Implement basic grid topology usage for the bitfield distribution

* Fix tests

* Oops, fix tests

* Add some tests for random routing

* Add a unit test for topology distribution

* Store the current and the previous topology to match sessions boundaries

* Update tests

* Update node/network/bitfield-distribution/src/lib.rs

Co-authored-by: Andronik <write@reusable.software>

* Update node/network/protocol/src/grid_topology.rs

Co-authored-by: Andronik <write@reusable.software>

* Update node/network/bitfield-distribution/src/lib.rs

Co-authored-by: Andronik <write@reusable.software>

* Add some debug

* Fix tests as HashSet order is undefined

Co-authored-by: Andronik <write@reusable.software>
This commit is contained in:
Vsevolod Stakhov
2022-05-06 13:24:11 +01:00
committed by GitHub
parent 53a1db59bc
commit 673a32d968
9 changed files with 419 additions and 83 deletions
+4 -1
View File
@@ -18,4 +18,7 @@ futures = "0.3.21"
thiserror = "1.0.31"
fatality = "0.0.6"
rand = "0.8"
derive_more = "0.99"
derive_more = "0.99"
[dev-dependencies]
rand_chacha = "0.3.1"