mirror of
https://github.com/sigp/lighthouse.git
synced 2026-07-05 05:44:30 +00:00
Gloas fix proposer preferences gossip verification (#9337)
Ensure we are using the correct state when validating proposer preferences over gossip. Previously we were only using the head state. At epoch boundaries the head state could be at `current_epoch - 1`. Peers submitting proposer preferences for `current_epoch + 1` would be penalized because our head states lookahead did not have proposer duties for `current_epoch + 1` Co-Authored-By: Eitan Seri-Levi <eserilev@ucsc.edu>
This commit is contained in:
@@ -2924,8 +2924,16 @@ impl ApiTester {
|
||||
.get(lookahead_index)
|
||||
.expect("slot index should be in lookahead") as usize;
|
||||
|
||||
let dependent_root = head_state
|
||||
.proposer_shuffling_decision_root_at_epoch(
|
||||
proposal_slot.epoch(E::slots_per_epoch()),
|
||||
head.beacon_block_root,
|
||||
&self.chain.spec,
|
||||
)
|
||||
.expect("should compute proposer shuffling decision root");
|
||||
|
||||
let preferences = ProposerPreferences {
|
||||
dependent_root: Hash256::ZERO,
|
||||
dependent_root,
|
||||
proposal_slot,
|
||||
validator_index: validator_index as u64,
|
||||
fee_recipient: Address::repeat_byte(0xaa),
|
||||
|
||||
Reference in New Issue
Block a user