diff --git a/consensus/fork_choice/src/fork_choice.rs b/consensus/fork_choice/src/fork_choice.rs index b6db69a0fb..655275acba 100644 --- a/consensus/fork_choice/src/fork_choice.rs +++ b/consensus/fork_choice/src/fork_choice.rs @@ -531,11 +531,6 @@ where } /// Returns the dependent root for `block_root`, per the spec `get_dependent_root` helper. - /// - /// The dependent root is the block root at the slot immediately preceding the start of epoch - /// `current_epoch - MIN_SEED_LOOKAHEAD`. Two blocks that share a dependent root descend from - /// the same shuffling, which is the condition used to gate proposer boost (see the spec - /// `update_proposer_boost_root`). fn get_dependent_root( &self, block_root: Hash256, @@ -856,18 +851,16 @@ where let is_first_block = self.fc_store.proposer_boost_root().is_zero(); if is_timely && is_first_block { - // Compute the head *before* this block is added to fork choice, matching the spec's - // `head = get_head(store)` in `on_block`. This is gated on `is_timely && is_first_block` - // so `get_head` runs at most once per slot. + // Compute the head before adding this block to fork choice let (head_root, _) = self.get_head(system_time_current_slot, spec)?; - // The block has not yet been added to proto-array, so resolve its dependent root via - // its parent. The ancestor at the dependent slot (an earlier epoch boundary) is - // identical whether resolved from the block or its parent. + // The block isn't in fork choice so resolve its dependent root via its parent. let block_dependent_root = self.get_dependent_root(block.parent_root(), current_slot, spec)?; let head_dependent_root = self.get_dependent_root(head_root, current_slot, spec)?; + // Add proposer score boost if the block is timely, not conflicting with an + // existing block, with the same dependent root as the canonical chain head. if block_dependent_root.is_some() && block_dependent_root == head_dependent_root { self.fc_store.set_proposer_boost_root(block_root); } diff --git a/consensus/state_processing/src/upgrade/fulu.rs b/consensus/state_processing/src/upgrade/fulu.rs index 29e8c2231d..c14c1edbec 100644 --- a/consensus/state_processing/src/upgrade/fulu.rs +++ b/consensus/state_processing/src/upgrade/fulu.rs @@ -42,13 +42,6 @@ pub fn upgrade_state_to_fulu( let epoch = pre_state.current_epoch(); let proposer_lookahead = initialize_proposer_lookahead(pre_state, spec)?; let pre = pre_state.as_electra_mut()?; - // Finalize the Eth1 bridge at the Fulu fork (spec PR #5322). - let deposit_requests_start_index = - if pre.deposit_requests_start_index == spec.unset_deposit_requests_start_index { - pre.eth1_data.deposit_count - } else { - pre.deposit_requests_start_index - }; // Where possible, use something like `mem::take` to move fields from behind the &mut // reference. For other fields that don't have a good default value, use `clone`. // @@ -100,7 +93,7 @@ pub fn upgrade_state_to_fulu( next_withdrawal_validator_index: pre.next_withdrawal_validator_index, historical_summaries: pre.historical_summaries.clone(), // Electra - deposit_requests_start_index, + deposit_requests_start_index: pre.deposit_requests_start_index, deposit_balance_to_consume: pre.deposit_balance_to_consume, exit_balance_to_consume: pre.exit_balance_to_consume, earliest_exit_epoch: pre.earliest_exit_epoch,