-
Notifications
You must be signed in to change notification settings - Fork 662
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Move routing table exchange to another thread #5089
Move routing table exchange to another thread #5089
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First part of the review. I'll add more comments tomorrow.
I moved out some of the changes to: #5097 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mm-near please review
@mm-near If you think it will make reviewing easier, I can extract the refactoring mentioned in summary to a separate change. |
@mm-near @bowenwang1996 I added summary to the first post in the PR, I hope it helps. |
We should refactor network code, before #5089 - This refactoring doesn't contain any code changes, only methods/attributes are renamed to better names - All changes are extracted from #5089, this was done to keep that PR smaller. This will cause merge conflicts, but it's better to extract syntax only changes to make #5089 easier to review. Here is design doc for changes planned (https://docs.google.com/document/d/1FV3oyMRo52EQAgYroVd6Ws-5-ylkLSTdMOstY-IdL-M/edit?usp=sharing)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mm-near please review this PR
Make `RoutingTableActor` use Context instead of `SyncContext`. `SyncContext` is meant to be used in situations, where someone wants to start multiple instances of actors, each one separate thread. We only have one instance, and the code wouldn't work with multiple instances, so we are changing `SyncContext` to `Context`, to make reading code less confusion. Additional changes: - Add `edge_verifier_pool` to `RoutingTableActor` (for #5089) - Rename `routing_table_pool` to `routing_table_addr` Changes are extracted from #5089 to make it easier to review.
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.
@mm-near Can you take a look? This PR is much smaller after splitting it 6 times. |
@chefsale @frol @khorolets Can you take a look? |
@chefsale @frol @khorolets Can you take a look? |
Make `RoutingTableActor` use Context instead of `SyncContext`. `SyncContext` is meant to be used in situations, where someone wants to start multiple instances of actors, each one separate thread. We only have one instance, and the code wouldn't work with multiple instances, so we are changing `SyncContext` to `Context`, to make reading code less confusion. Additional changes: - Add `edge_verifier_pool` to `RoutingTableActor` (for #5089) - Rename `routing_table_pool` to `routing_table_addr` Changes are extracted from #5089 to make it easier to review.
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.
In this PR we will creating copy of routing table to another thread.
This is related to #4859
Summary:
PeerManager
no longer has copy ofedges_info
, instead it only stores list of edges to peers that it is/was connected tolocal_edges_info
PeerManager
that were stored inedges_info
peer_forwarding
is done inRoutingTableActor
,PeerManager
gets it from another thread every second / tests now useRoutingTableActor
instead ofRoutingTable
structpub raw_graph: Graph,
and a few other data structures toRoutingTableActor
adv_get_routing_table_new
from jsonrpc server. Now, routing table is only stored in one place, so this method is no longer neededCloses #4859