mirror of
https://gitlab.com/pulsechaincom/lighthouse-pulse.git
synced 2025-01-12 14:00:06 +00:00
Update fork_choice for v0.6.1
This commit is contained in:
parent
e310bdd904
commit
4287891026
@ -83,10 +83,8 @@ impl<T: Store, E: EthSpec> BitwiseLMDGhost<T, E> {
|
|||||||
current_state.get_active_validator_indices(block_slot.epoch(spec.slots_per_epoch));
|
current_state.get_active_validator_indices(block_slot.epoch(spec.slots_per_epoch));
|
||||||
|
|
||||||
for index in active_validator_indices {
|
for index in active_validator_indices {
|
||||||
let balance = std::cmp::min(
|
let balance = std::cmp::min(current_state.balances[index], spec.max_effective_balance)
|
||||||
current_state.validator_balances[index],
|
/ spec.effective_balance_increment;
|
||||||
spec.max_deposit_amount,
|
|
||||||
) / spec.fork_choice_balance_increment;
|
|
||||||
if balance > 0 {
|
if balance > 0 {
|
||||||
if let Some(target) = self.latest_attestation_targets.get(&(index as u64)) {
|
if let Some(target) = self.latest_attestation_targets.get(&(index as u64)) {
|
||||||
*latest_votes.entry(*target).or_insert_with(|| 0) += balance;
|
*latest_votes.entry(*target).or_insert_with(|| 0) += balance;
|
||||||
|
@ -83,10 +83,8 @@ impl<T: Store, E: EthSpec> OptimizedLMDGhost<T, E> {
|
|||||||
current_state.get_active_validator_indices(block_slot.epoch(spec.slots_per_epoch));
|
current_state.get_active_validator_indices(block_slot.epoch(spec.slots_per_epoch));
|
||||||
|
|
||||||
for index in active_validator_indices {
|
for index in active_validator_indices {
|
||||||
let balance = std::cmp::min(
|
let balance = std::cmp::min(current_state.balances[index], spec.max_effective_balance)
|
||||||
current_state.validator_balances[index],
|
/ spec.effective_balance_increment;
|
||||||
spec.max_deposit_amount,
|
|
||||||
) / spec.fork_choice_balance_increment;
|
|
||||||
if balance > 0 {
|
if balance > 0 {
|
||||||
if let Some(target) = self.latest_attestation_targets.get(&(index as u64)) {
|
if let Some(target) = self.latest_attestation_targets.get(&(index as u64)) {
|
||||||
*latest_votes.entry(*target).or_insert_with(|| 0) += balance;
|
*latest_votes.entry(*target).or_insert_with(|| 0) += balance;
|
||||||
|
@ -52,10 +52,8 @@ impl<T: Store, E: EthSpec> SlowLMDGhost<T, E> {
|
|||||||
current_state.get_active_validator_indices(block_slot.epoch(spec.slots_per_epoch));
|
current_state.get_active_validator_indices(block_slot.epoch(spec.slots_per_epoch));
|
||||||
|
|
||||||
for index in active_validator_indices {
|
for index in active_validator_indices {
|
||||||
let balance = std::cmp::min(
|
let balance = std::cmp::min(current_state.balances[index], spec.max_effective_balance)
|
||||||
current_state.validator_balances[index],
|
/ spec.effective_balance_increment;
|
||||||
spec.max_deposit_amount,
|
|
||||||
) / spec.fork_choice_balance_increment;
|
|
||||||
if balance > 0 {
|
if balance > 0 {
|
||||||
if let Some(target) = self.latest_attestation_targets.get(&(index as u64)) {
|
if let Some(target) = self.latest_attestation_targets.get(&(index as u64)) {
|
||||||
*latest_votes.entry(*target).or_insert_with(|| 0) += balance;
|
*latest_votes.entry(*target).or_insert_with(|| 0) += balance;
|
||||||
|
Loading…
Reference in New Issue
Block a user