mirror of
https://github.com/sigp/lighthouse.git
synced 2026-04-26 09:13:41 +00:00
Align GLOAS fork choice with spec
- Move proposer boost from apply_score_changes to get_weight, matching the spec's structure where get_weight adds boost via is_supporting_vote - Implement is_supporting_vote and get_ancestor_node spec functions - Fix should_extend_payload: return true when proposer_boost_root is zero - Compute record_block_timeliness from time_into_slot instead of hardcoding false - Fix anchor block_timeliness to [true, true] per get_forkchoice_store spec - Add equivocating_attestation_score for is_head_weak monotonicity - Use payload-aware weight in is_parent_strong - Add with_status helper on IndexedForkChoiceNode - Simplify find_head_walk to return IndexedForkChoiceNode directly
This commit is contained in:
@@ -797,6 +797,11 @@ where
|
||||
let attestation_threshold = spec.get_unaggregated_attestation_due();
|
||||
|
||||
// Add proposer score boost if the block is timely.
|
||||
// TODO(gloas): the spec's `update_proposer_boost_root` additionally checks that
|
||||
// `block.proposer_index == get_beacon_proposer_index(head_state)` — i.e. that
|
||||
// the block's proposer matches the expected proposer on the canonical chain.
|
||||
// This requires calling `get_head` and advancing the head state to the current
|
||||
// slot, which is expensive. Implement once we have a cached proposer index.
|
||||
let is_before_attesting_interval = block_delay < attestation_threshold;
|
||||
|
||||
let is_first_block = self.fc_store.proposer_boost_root().is_zero();
|
||||
@@ -1001,6 +1006,7 @@ where
|
||||
self.justified_checkpoint(),
|
||||
self.finalized_checkpoint(),
|
||||
spec,
|
||||
block_delay,
|
||||
)?;
|
||||
|
||||
Ok(())
|
||||
|
||||
Reference in New Issue
Block a user