lighthouse/consensus/types
Paul Hauner 54f92cc263 Use THC for state.inactivity_scores (#2504)
## Issue Addressed

- Resolves #2502

## Proposed Changes

Adds tree-hash caching (THC 🍁) for `state.inactivity_scores`, as per #2502.

Since the `inactivity_scores` field is introduced during Altair, the cache must be optional (i.e., not present pre-Altair). The mechanism for optional caches was already implemented via the `ParticipationTreeHashCache`, albeit not quite generically enough. To this end, I made the `ParticipationTreeHashCache` more generic and renamed it to `OptionalTreeHashCache`. This made the code a little more verbose around the previous/current epoch participation fields, but overall less verbose when the needs of `inactivity_scores` are considered.

All changes to `ParticipationTreeHashCache` should be *non-substantial*.

## Additional Info

NA
2021-08-09 04:58:17 +00:00
..
benches Altair consensus changes and refactors (#2279) 2021-07-09 06:15:32 +00:00
examples Altair consensus changes and refactors (#2279) 2021-07-09 06:15:32 +00:00
presets Altair consensus changes and refactors (#2279) 2021-07-09 06:15:32 +00:00
src Use THC for state.inactivity_scores (#2504) 2021-08-09 04:58:17 +00:00
Cargo.toml Altair validator client and HTTP API (#2404) 2021-08-06 00:47:31 +00:00
clippy.toml Lint for sum and product in consensus code (#2226) 2021-03-01 00:57:13 +00:00