lighthouse/beacon_node/network/src
divma d727e55abe Move some rpc processing to the beacon_processor (#1936)
## Issue Addressed
`BlocksByRange` requests were the main culprit of a series of timeouts to peer's requests in general because they produce build up in the router's processor. Those were moved to the blocking executor but a task is being spawned for each; also not ideal since the amount of resources we give to those is not controlled

## Proposed Changes
- Move `BlocksByRange` and `BlocksByRoots` to the `beacon_processor`. The processor crafts the responses and sends them.
- Move too the processing of `StatusMessage`s from other peers. This is a fast operation but it can also build up and won't scale if we keep it in the router (processing one at the time). These don't need to send an answer, so there is no harm in processing them "later" if that were to happen. Sending responses to status requests is still in the router, so we answer as soon as we see them.
- Some "extras" that are basically clean up:
  - Split the `Worker` logic in sync methods (chain processing and rpc blocks), gossip methods (the majority of methods) and rpc methods (the new ones)
  - Move the `status_message` function previously provided by the router's processor to a more central place since it is used by the router, sync, network_context and beacon_processor
 - Some spelling

## Additional Info
What's left to decide/test more thoroughly is the length of the queues and the priority rules. @paulhauner suggested at some point to put status above attestations, and @AgeManning had described an importance of "protecting gossipsub" so my solution is leaving status requests in the router and RPC methods below attestations. Slashings and Exits are at the end.
2020-11-19 23:33:44 +00:00
..
attestation_service Add additional libp2p tests (#1867) 2020-11-19 22:32:09 +00:00
beacon_processor Move some rpc processing to the beacon_processor (#1936) 2020-11-19 23:33:44 +00:00
router Move some rpc processing to the beacon_processor (#1936) 2020-11-19 23:33:44 +00:00
service Upgrade discovery and restructure task execution (#1693) 2020-10-05 18:45:54 +11:00
sync Move some rpc processing to the beacon_processor (#1936) 2020-11-19 23:33:44 +00:00
error.rs Initial work towards v0.2.0 (#924) 2020-03-17 17:24:44 +11:00
lib.rs Move some rpc processing to the beacon_processor (#1936) 2020-11-19 23:33:44 +00:00
metrics.rs Gossipsub scoring (#1668) 2020-11-12 01:48:28 +00:00
nat.rs Update libp2p (#1865) 2020-11-06 04:14:14 +00:00
persisted_dht.rs Add database schema versioning (#1688) 2020-10-01 11:12:36 +10:00
service.rs Avoid string initialization in network metrics and replace by &str where possible (#1898) 2020-11-18 23:31:37 +00:00
status.rs Move some rpc processing to the beacon_processor (#1936) 2020-11-19 23:33:44 +00:00