diff --git a/eth2/fork_choice/src/bitwise_lmd_ghost.rs b/eth2/fork_choice/src/bitwise_lmd_ghost.rs index 0e579c0b9..c159def35 100644 --- a/eth2/fork_choice/src/bitwise_lmd_ghost.rs +++ b/eth2/fork_choice/src/bitwise_lmd_ghost.rs @@ -83,10 +83,8 @@ impl BitwiseLMDGhost { current_state.get_active_validator_indices(block_slot.epoch(spec.slots_per_epoch)); for index in active_validator_indices { - let balance = std::cmp::min( - current_state.validator_balances[index], - spec.max_deposit_amount, - ) / spec.fork_choice_balance_increment; + let balance = std::cmp::min(current_state.balances[index], spec.max_effective_balance) + / spec.effective_balance_increment; if balance > 0 { if let Some(target) = self.latest_attestation_targets.get(&(index as u64)) { *latest_votes.entry(*target).or_insert_with(|| 0) += balance; diff --git a/eth2/fork_choice/src/optimized_lmd_ghost.rs b/eth2/fork_choice/src/optimized_lmd_ghost.rs index dba6e60da..01ad4dd29 100644 --- a/eth2/fork_choice/src/optimized_lmd_ghost.rs +++ b/eth2/fork_choice/src/optimized_lmd_ghost.rs @@ -83,10 +83,8 @@ impl OptimizedLMDGhost { current_state.get_active_validator_indices(block_slot.epoch(spec.slots_per_epoch)); for index in active_validator_indices { - let balance = std::cmp::min( - current_state.validator_balances[index], - spec.max_deposit_amount, - ) / spec.fork_choice_balance_increment; + let balance = std::cmp::min(current_state.balances[index], spec.max_effective_balance) + / spec.effective_balance_increment; if balance > 0 { if let Some(target) = self.latest_attestation_targets.get(&(index as u64)) { *latest_votes.entry(*target).or_insert_with(|| 0) += balance; diff --git a/eth2/fork_choice/src/slow_lmd_ghost.rs b/eth2/fork_choice/src/slow_lmd_ghost.rs index 888356417..bde918d7e 100644 --- a/eth2/fork_choice/src/slow_lmd_ghost.rs +++ b/eth2/fork_choice/src/slow_lmd_ghost.rs @@ -52,10 +52,8 @@ impl SlowLMDGhost { current_state.get_active_validator_indices(block_slot.epoch(spec.slots_per_epoch)); for index in active_validator_indices { - let balance = std::cmp::min( - current_state.validator_balances[index], - spec.max_deposit_amount, - ) / spec.fork_choice_balance_increment; + let balance = std::cmp::min(current_state.balances[index], spec.max_effective_balance) + / spec.effective_balance_increment; if balance > 0 { if let Some(target) = self.latest_attestation_targets.get(&(index as u64)) { *latest_votes.entry(*target).or_insert_with(|| 0) += balance;