54f92cc263
## 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 |
||
---|---|---|
.. | ||
cached_tree_hash | ||
fork_choice | ||
int_to_bytes | ||
merkle_proof | ||
proto_array | ||
safe_arith | ||
serde_utils | ||
ssz | ||
ssz_derive | ||
ssz_types | ||
state_processing | ||
swap_or_not_shuffle | ||
tree_hash | ||
tree_hash_derive | ||
types |