Files
lighthouse/consensus/state_processing
Michael Sproul 9b08e1ad63 Fix total_effective_balance=0 in PreEpochCache (#9106)
Fix a **consensus fault** in `PreEpochCache` 🙀

Fortunately it's only reachable on a network with `total_active_balance=0`, i.e. a network that's already completely dead. As such this PR is not time-sensitive in any way.


  Add the floor on `total_effective_balance` when converting from `PreEpochCache` to `EpochCache`. An alternative would be to add the floor inside `PreEpochCache::get_total_active_balance`, however that would be redundant, as the only place this function is called outside this file is in single-pass epoch processing:

176cce585c/consensus/state_processing/src/per_epoch_processing/single_pass.rs (L461-L462)

The `set_total_active_balance` call already handles the floor.

A regression test is included.


Co-Authored-By: Michael Sproul <michael@sigmaprime.io>
2026-04-20 00:59:39 +00:00
..
2020-05-18 21:24:23 +10:00
2026-03-06 23:09:31 +00:00