lighthouse/beacon_node
divma f3200784b4 More metrics + RPC tweaks (#2041)
## Issue Addressed

NA

## Proposed Changes
This was mostly done to find the reason why LH was dropping peers from Nimbus. It proved to be useful so I think it's worth it. But there is also some functional stuff here
- Add metrics for rpc errors per client, error type and direction
- Add metrics for downscoring events per source type, client and penalty type
- Add metrics for gossip validation results per client for non-accepted messages
- Make the RPC handler return errors and requests/responses in the order we see them
- Allow a small burst for the Ping rate limit, from 1 every 5 seconds to 2 every 10 seconds
- Send rate limiting errors with a particular code and use that same code to identify them. I picked something different to 128 since that is most likely what other clients are using for their own errors
- Remove some unused code in the `PeerAction` and the rpc handler
- Remove the unused variant `RateLimited`. tTis was never produced directly, since the only way to get the request's protocol is via de handler. The handler upon receiving from LH a response with an error (rate limited in this case) emits this event with the missing info (It was always like this, just pointing out that we do downscore rate limiting errors regardless of the change)

Metrics for Nimbus looked like this:
Downscoring events: `increase(libp2p_peer_actions_per_client{client="Nimbus"}[5m])`
![image](https://user-images.githubusercontent.com/26765164/101210880-862bf280-3676-11eb-94c0-399f0bf5aa2e.png)

RPC Errors: `increase(libp2p_rpc_errors_per_client{client="Nimbus"}[5m])`
![image](https://user-images.githubusercontent.com/26765164/101210997-ba071800-3676-11eb-847a-f32405ede002.png)

Unaccepted gossip message: `increase(gossipsub_unaccepted_messages_per_client{client="Nimbus"}[5m])`
![image](https://user-images.githubusercontent.com/26765164/101211124-f470b500-3676-11eb-9459-132ecff058ec.png)
2020-12-08 03:55:50 +00:00
..
beacon_chain Pass failed gossip blocks to the slasher (#2047) 2020-12-04 05:03:30 +00:00
client update dependencies (#2032) 2020-12-07 08:20:33 +00:00
eth1 Add a purge-eth1-cache cli option (#2039) 2020-12-04 05:03:28 +00:00
eth2_libp2p More metrics + RPC tweaks (#2041) 2020-12-08 03:55:50 +00:00
genesis Upgrade to tokio 0.3 (#1839) 2020-11-28 05:30:57 +00:00
http_api update dependencies (#2032) 2020-12-07 08:20:33 +00:00
http_metrics update dependencies (#2032) 2020-12-07 08:20:33 +00:00
network More metrics + RPC tweaks (#2041) 2020-12-08 03:55:50 +00:00
operation_pool Update pool/attestations and committees endpoints (#1899) 2020-11-18 23:31:39 +00:00
src Add a purge-eth1-cache cli option (#2039) 2020-12-04 05:03:28 +00:00
store update dependencies (#2032) 2020-12-07 08:20:33 +00:00
tests Upgrade to tokio 0.3 (#1839) 2020-11-28 05:30:57 +00:00
timer Fix new clippy lints (#2036) 2020-12-03 01:10:26 +00:00
websocket_server Server sent events (#1920) 2020-12-04 00:18:58 +00:00
Cargo.toml Bump version to v1.0.3 (#2024) 2020-11-30 22:55:10 +00:00