lighthouse/beacon_node
Pawan Dhananjay fff4dd6311 Fix rpc limits version 2 (#3146)
## Issue Addressed

N/A

## Proposed Changes

https://github.com/sigp/lighthouse/pull/3133 changed the rpc type limits to be fork aware i.e. if our current fork based on wall clock slot is Altair, then we apply only altair rpc type limits. This is a bug because phase0 blocks can still be sent over rpc and phase 0 block minimum size is smaller than altair block minimum size. So a phase0 block with `size < SIGNED_BEACON_BLOCK_ALTAIR_MIN` will return an `InvalidData` error as it doesn't pass the rpc types bound check.

This error can be seen when we try syncing pre-altair blocks with size smaller than `SIGNED_BEACON_BLOCK_ALTAIR_MIN`.

This PR fixes the issue by also accounting for forks earlier than current_fork in the rpc limits calculation in the  `rpc_block_limits_by_fork` function. I decided to hardcode the limits in the function because that seemed simpler than calculating previous forks based on current fork and doing a min across forks. Adding a new fork variant is simple and can the limits can be easily checked in a review. 

Adds unit tests and modifies the syncing simulator to check the syncing from across fork boundaries. 
The syncing simulator's block 1 would always be of phase 0 minimum size (404 bytes) which is smaller than altair min block size (since block 1 contains no attestations).
2022-04-07 23:45:38 +00:00
..
beacon_chain Transition Block Proposer Preparation (#3088) 2022-04-07 14:03:34 +00:00
client Update and consolidate dependencies (#3136) 2022-04-04 00:26:16 +00:00
eth1 v2.2.0 (#3139) 2022-04-05 02:53:09 +00:00
execution_layer Transition Block Proposer Preparation (#3088) 2022-04-07 14:03:34 +00:00
genesis Update and consolidate dependencies (#3136) 2022-04-04 00:26:16 +00:00
http_api Update and consolidate dependencies (#3136) 2022-04-04 00:26:16 +00:00
http_metrics Support IPv6 in BN and VC HTTP APIs (#3104) 2022-03-24 00:04:49 +00:00
lighthouse_network Fix rpc limits version 2 (#3146) 2022-04-07 23:45:38 +00:00
network v2.2.0 (#3139) 2022-04-05 02:53:09 +00:00
operation_pool Update and consolidate dependencies (#3136) 2022-04-04 00:26:16 +00:00
src Fix SPRP default value in cli (#3145) 2022-04-07 04:04:11 +00:00
store Update and consolidate dependencies (#3136) 2022-04-04 00:26:16 +00:00
tests Altair consensus changes and refactors (#2279) 2021-07-09 06:15:32 +00:00
timer Update to Rust 1.59 and 2021 edition (#3038) 2022-02-25 00:10:17 +00:00
Cargo.toml v2.2.0 (#3139) 2022-04-05 02:53:09 +00:00