mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-13 17:31:05 +00:00
Implement grid topology routing for the statement distribution subsystem (#5476)
* 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 * Move session bounded topology to the common code part * Fix tests * Allow to select routing by peer index * Implement grid topology in the statement distribution subsystem * Fix tests compilation * Fix test * Refactor API slightly * Address review comments * Reduce runtime error logging severity * Update node/network/protocol/src/grid_topology.rs Co-authored-by: Bernhard Schuster <bernhard@ahoi.io> * Update node/network/bitfield-distribution/src/tests.rs Co-authored-by: Bernhard Schuster <bernhard@ahoi.io> * Fmt run * Use named struct * Fix logging stuff * One more accidental fmt damage * Increase active queue size and add metrics Signed-off-by: Andrei Sandu <andrei-mihail@parity.io> * Revert "Increase active queue size and add metrics" This reverts commit c4f48e8bded6dfeb9c62814ba2f8d815c34b04cf. * Use validator index to choose the routing strategy Noted by: @rphmeier * Fix test after distribution logic fix Co-authored-by: Andronik <write@reusable.software> Co-authored-by: Bernhard Schuster <bernhard@ahoi.io> Co-authored-by: Andrei Sandu <andrei-mihail@parity.io>
This commit is contained in:
@@ -511,7 +511,7 @@ impl State {
|
||||
|block_entry| block_entry.session == session,
|
||||
|required_routing, local, validator_index| {
|
||||
if *required_routing == RequiredRouting::PendingTopology {
|
||||
*required_routing = topology.required_routing_for(*validator_index, local);
|
||||
*required_routing = topology.required_routing_by_index(*validator_index, local);
|
||||
}
|
||||
},
|
||||
)
|
||||
@@ -861,7 +861,7 @@ impl State {
|
||||
let local = source == MessageSource::Local;
|
||||
|
||||
let required_routing = topology.map_or(RequiredRouting::PendingTopology, |t| {
|
||||
t.required_routing_for(validator_index, local)
|
||||
t.required_routing_by_index(validator_index, local)
|
||||
});
|
||||
|
||||
let message_state = match entry.candidates.get_mut(claimed_candidate_index as usize) {
|
||||
|
||||
Reference in New Issue
Block a user