lighthouse/beacon_node
Paul Hauner d34f922c1d Add early check for RPC block relevancy (#2289)
## Issue Addressed

NA

## Proposed Changes

When observing `jemallocator` heap profiles and Grafana, it became clear that Lighthouse is spending significant RAM/CPU on processing blocks from the RPC. On investigation, it seems that we are loading the parent of the block *before* we check to see if the block is already known. This is a big waste of resources.

This PR adds an additional `check_block_relevancy` call as the first thing we do when we try to process a `SignedBeaconBlock` via the RPC (or other similar methods). Ultimately, `check_block_relevancy` will be called again later in the block processing flow. It's a very light function and I don't think trying to optimize it out is worth the risk of a bad block slipping through. 

Also adds a `New RPC block received` info log when we process a new RPC block. This seems like interesting and infrequent info.

## Additional Info

NA
2021-06-02 01:07:27 +00:00
..
beacon_chain Add early check for RPC block relevancy (#2289) 2021-06-02 01:07:27 +00:00
client Monitoring service api (#2251) 2021-05-26 05:58:41 +00:00
eth1 Return more detail in Eth1 HTTP errors (#2383) 2021-06-01 06:59:41 +00:00
eth2_libp2p Minimum Outbound-Only Peers Requirement (#2356) 2021-05-31 04:18:19 +00:00
genesis Add SensitiveUrl to redact user secrets from endpoints (#2326) 2021-05-04 01:59:51 +00:00
http_api Use the forwards iterator more often (#2376) 2021-05-31 04:18:20 +00:00
http_metrics Tune GNU malloc (#2299) 2021-05-28 05:59:45 +00:00
network Add early check for RPC block relevancy (#2289) 2021-06-02 01:07:27 +00:00
operation_pool Pack attestations into blocks in parallel (#2307) 2021-04-13 05:27:42 +00:00
src Tune GNU malloc (#2299) 2021-05-28 05:59:45 +00:00
store Return a specific error for frozen attn states (#2384) 2021-06-01 06:59:43 +00:00
tests Update to tokio 1.1 (#2172) 2021-02-10 23:29:49 +00:00
timer Update to tokio 1.1 (#2172) 2021-02-10 23:29:49 +00:00
websocket_server Server sent events (#1920) 2020-12-04 00:18:58 +00:00
Cargo.toml Monitoring service api (#2251) 2021-05-26 05:58:41 +00:00