lighthouse/beacon_node
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
..
beacon_chain Address queue congestion in migrator (#1923) 2020-11-17 23:11:26 +00:00
client Add --testnet mainnet and start HTTP server before genesis (#1862) 2020-11-09 05:04:03 +00:00
eth1 Validate eth1 chain id (#1877) 2020-11-16 23:10:42 +00:00
eth2_libp2p Add additional libp2p tests (#1867) 2020-11-19 22:32:09 +00:00
genesis Return eth1-related data via the API (#1797) 2020-11-02 00:37:30 +00:00
http_api Update pool/attestations and committees endpoints (#1899) 2020-11-18 23:31:39 +00:00
http_metrics Support pre-flight CORS check (#1772) 2020-10-22 04:47:27 +00:00
network Move some rpc processing to the beacon_processor (#1936) 2020-11-19 23:33:44 +00:00
operation_pool Update pool/attestations and committees endpoints (#1899) 2020-11-18 23:31:39 +00:00
src Add new flag to set blocks per eth1 query (#1931) 2020-11-18 22:18:59 +00:00
store Refine compaction (#1916) 2020-11-17 09:10:53 +00:00
tests Implement standard eth2.0 API (#1569) 2020-10-01 11:12:36 +10:00
timer Upgrade discovery and restructure task execution (#1693) 2020-10-05 18:45:54 +11:00
websocket_server Update external deps (#1711) 2020-10-05 08:22:19 +00:00
Cargo.toml Bump to v0.3.5 (#1927) 2020-11-18 00:44:28 +00:00