nimbus-eth2/beacon_chain/rpc
Jacek Sieka 0a4728a241
Handle access to historical data for which there is no state (#3217)
With checkpoint sync in particular, and state pruning in the future,
loading states or state-dependent data may fail. This PR adjusts the
code to allow this to be handled gracefully.

In particular, the new availability assumption is that states are always
available for the finalized checkpoint and newer, but may fail for
anything older.

The `tail` remains the point where state loading de-facto fails, meaning
that between the tail and the finalized checkpoint, we can still get
historical data (but code should be prepared to handle this as an
error).

However, to harden the code against long replays, several operations
which are assumed to work only with non-final data (such as gossip
verification and validator duties) now limit their search horizon to
post-finalized data.

* harden several state-dependent operations by logging an error instead
of introducing a panic when state loading fails
* `withState` -> `withUpdatedState` to differentiate from the other
`withState`
* `updateStateData` can now fail if no state is found in database - it
is also hardened against excessively long replays
* `getEpochRef` can now fail when replay fails
* reject blocks with invalid target root - they would be ignored
previously
* fix recursion bug in `isProposed`
2022-01-05 19:38:04 +01:00
..
rest_api.nim Validator key management API (#2755) 2021-10-04 22:08:31 +03:00
rest_beacon_api.nim Implement #3129 (Optimized history traversals in the REST API) (#3219) 2022-01-05 15:49:10 +01:00
rest_config_api.nim update from phase0/altair v1.1.6 URLs to v1.1.8 spec URLs (#3238) 2022-01-04 03:57:15 +00:00
rest_constants.nim Handle access to historical data for which there is no state (#3217) 2022-01-05 19:38:04 +01:00
rest_debug_api.nim Implement #3129 (Optimized history traversals in the REST API) (#3219) 2022-01-05 15:49:10 +01:00
rest_event_api.nim Improve chronos.Future tracking. (#2988) 2021-10-27 14:01:11 +02:00
rest_key_management_api.nim shift block_sim fork epochs; allow VC to work with non-multiple-of-3 SECONDS_PER_SLOT (#3244) 2022-01-05 13:41:39 +00:00
rest_nimbus_api.nim Handle access to historical data for which there is no state (#3217) 2022-01-05 19:38:04 +01:00
rest_node_api.nim Fix for /eth/v1/node/identity call missing `syncnets` parameter. 2021-12-01 18:39:43 +02:00
rest_utils.nim Handle access to historical data for which there is no state (#3217) 2022-01-05 19:38:04 +01:00
rest_validator_api.nim Handle access to historical data for which there is no state (#3217) 2022-01-05 19:38:04 +01:00
rpc_api.nim REST API client, JSON-RPC cleanups (#2756) 2021-08-03 17:17:11 +02:00
rpc_beacon_api.nim BlockId reform (#3176) 2021-12-09 19:06:21 +02:00
rpc_config_api.nim fix type-conversions-to-self, unexport from nimbus_beacon_node, and rm unused vars/procs (#3211) 2021-12-20 12:21:17 +01:00
rpc_debug_api.nim import cleanup (#2997) 2021-10-19 16:09:26 +02:00
rpc_event_api.nim import cleanup (#2997) 2021-10-19 16:09:26 +02:00
rpc_nimbus_api.nim Handle access to historical data for which there is no state (#3217) 2022-01-05 19:38:04 +01:00
rpc_node_api.nim nim-libp2p auto bump (#2840) 2021-10-21 13:01:29 +02:00
rpc_utils.nim Handle access to historical data for which there is no state (#3217) 2022-01-05 19:38:04 +01:00
rpc_validator_api.nim Handle access to historical data for which there is no state (#3217) 2022-01-05 19:38:04 +01:00
state_ttl_cache.nim Implement #3129 (Optimized history traversals in the REST API) (#3219) 2022-01-05 15:49:10 +01:00