Skip to content

Commit

Permalink
Add new features to RoutingTableActor (#5160)
Browse files Browse the repository at this point in the history
Add new features to routing table actor.

- do edge pruning (not used yet)
- store all edges in `edges_info`
-  `StartRoutingTableSync` (handling first message of protocol_feature_routing_exchange_algorithm)  (not yet used)
-  `RoutingTableUpdate` (updating routing table and maybe pruning edges) (not yet used)
-  `AddVerifiedEdges` - adds verified edges and updates stats (Similar to `AddEdges`, but does more) (not yet used)

This is done to split #5089 into smaller pieces.
This should be reviewed after #5159, as this PR also includes changes in that request.
  • Loading branch information
pmnoxx authored Nov 9, 2021
1 parent 8203fc2 commit 56b3d7c
Show file tree
Hide file tree
Showing 3 changed files with 428 additions and 37 deletions.
1 change: 1 addition & 0 deletions chain/network/src/peer_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,7 @@ impl PeerManagerActor {
}
});
}

#[cfg(feature = "protocol_feature_routing_exchange_algorithm")]
fn start_routing_table_syncv2(&self, ctx: &mut Context<Self>, addr: Addr<Peer>, seed: u64) {
self.routing_table_addr
Expand Down
4 changes: 4 additions & 0 deletions chain/network/src/routing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -922,6 +922,10 @@ impl Graph {
res
}

pub fn my_peer_id(&self) -> &PeerId {
&self.my_peer_id
}

pub fn total_active_edges(&self) -> u64 {
self.total_active_edges
}
Expand Down
Loading

0 comments on commit 56b3d7c

Please sign in to comment.