nimbus-eth2/research
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
..
.gitignore update research VCS ignores (#2849) 2021-09-07 23:09:49 +00:00
block_sim.nim Handle access to historical data for which there is no state (#3217) 2022-01-05 19:38:04 +01:00
block_sim.nim.cfg block pool simulator (#956) 2020-05-01 17:51:24 +02:00
simutils.nim ncli_db: add putState, putBlock (#3096) 2021-11-18 13:02:43 +01:00
stack_sizes.nim altair fork handling cleanups (#3050) 2021-11-05 08:34:34 +01:00
stack_sizes.nim.cfg cleanups (#962) 2020-05-04 07:38:14 +02:00
state_sim.nim ncli_db: add putState, putBlock (#3096) 2021-11-18 13:02:43 +01:00
state_sim.nim.cfg add simple wasm page with state simulator (#334) 2020-01-22 15:36:16 +00:00