lighthouse-pulse/consensus
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
..
cached_tree_hash Rust 1.54.0 lints (#2483) 2021-07-30 01:11:47 +00:00
fork_choice Altair consensus changes and refactors (#2279) 2021-07-09 06:15:32 +00:00
int_to_bytes Update to tokio 1.1 (#2172) 2021-02-10 23:29:49 +00:00
merkle_proof Rust 1.54.0 lints (#2483) 2021-07-30 01:11:47 +00:00
proto_array Rust 1.54.0 lints (#2483) 2021-07-30 01:11:47 +00:00
safe_arith Remove saturating arith from state_processing (#1644) 2020-09-25 05:18:21 +00:00
serde_utils Altair consensus changes and refactors (#2279) 2021-07-09 06:15:32 +00:00
ssz Rust 1.54.0 lints (#2483) 2021-07-30 01:11:47 +00:00
ssz_derive Rust 1.54.0 lints (#2483) 2021-07-30 01:11:47 +00:00
ssz_types Rust 1.54.0 lints (#2483) 2021-07-30 01:11:47 +00:00
state_processing Rust 1.54.0 lints (#2483) 2021-07-30 01:11:47 +00:00
swap_or_not_shuffle Use hardware acceleration for SHA256 (#2426) 2021-07-12 08:47:01 +00:00
tree_hash Rust 1.54.0 lints (#2483) 2021-07-30 01:11:47 +00:00
tree_hash_derive Rust 1.54.0 lints (#2483) 2021-07-30 01:11:47 +00:00
types Use THC for state.inactivity_scores (#2504) 2021-08-09 04:58:17 +00:00