Skip to content

Commit 76a386f

Browse files
committed
Cleanup some TODOs
1 parent 117ee3c commit 76a386f

File tree

4 files changed

+9
-2
lines changed

4 files changed

+9
-2
lines changed

beacon_node/beacon_chain/src/builder.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -692,6 +692,7 @@ where
692692
None
693693
};
694694

695+
let anchor_state = fork_choice.anchor_state();
695696
let initial_head_block_root = fork_choice
696697
.get_head(current_slot, &self.spec)
697698
.map_err(|e| format!("Unable to get fork choice head: {:?}", e))?;
@@ -741,6 +742,7 @@ where
741742
Some(current_slot),
742743
&self.spec,
743744
self.chain_config.progressive_balances_mode,
745+
anchor_state,
744746
&log,
745747
)?;
746748
}

beacon_node/beacon_chain/src/canonical_head.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -746,7 +746,7 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
746746
head_hash: new_forkchoice_update_parameters.head_hash,
747747
justified_hash: new_forkchoice_update_parameters.justified_hash,
748748
finalized_hash: new_forkchoice_update_parameters.finalized_hash,
749-
anchor_state: new_view.anchor_state, // TODO: check this
749+
anchor_state: new_view.anchor_state,
750750
};
751751

752752
let mut cached_head_write_lock = self.canonical_head.cached_head_write_lock();

beacon_node/beacon_chain/src/fork_revert.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ pub fn reset_fork_choice_to_finalization<E: EthSpec, Hot: ItemStore<E>, Cold: It
104104
current_slot: Option<Slot>,
105105
spec: &ChainSpec,
106106
progressive_balances_mode: ProgressiveBalancesMode,
107+
anchor_state: AnchorState,
107108
log: &Logger,
108109
) -> Result<ForkChoice<BeaconForkChoiceStore<E, Hot, Cold>, E>, String> {
109110
// Fetch finalized block.
@@ -157,7 +158,7 @@ pub fn reset_fork_choice_to_finalization<E: EthSpec, Hot: ItemStore<E>, Cold: It
157158
finalized_block_root,
158159
&finalized_snapshot.beacon_block,
159160
&finalized_snapshot.beacon_state,
160-
AnchorState::Finalized, // FIXME: this needs to be understood
161+
anchor_state,
161162
current_slot,
162163
spec,
163164
)

consensus/fork_choice/src/fork_choice.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1471,6 +1471,10 @@ where
14711471
.map_err(Into::into)
14721472
}
14731473

1474+
pub fn anchor_state(&self) -> AnchorState {
1475+
self.anchor_state
1476+
}
1477+
14741478
/// Instantiate `Self` from some `PersistedForkChoice` generated by a earlier call to
14751479
/// `Self::to_persisted`.
14761480
pub fn proto_array_from_persisted(

0 commit comments

Comments
 (0)