Skip to content

Commit eb1c294

Browse files
committed
fix bug in seed calculation
1 parent 208f368 commit eb1c294

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

specs/fulu/beacon-chain.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -163,9 +163,9 @@ def compute_proposer_indices(state: BeaconState, epoch: Epoch) -> List[Validator
163163
"""
164164
Return the proposer indices for the given `epoch`.
165165
"""
166-
start_seed = get_seed(state, epoch, DOMAIN_BEACON_PROPOSER) + uint_to_bytes(compute_start_slot_at_epoch(epoch))
167-
seeds = [hash(start_seed + uint_to_bytes(Slot(i))) for i in range(SLOTS_PER_EPOCH)]
166+
epoch_seed = get_seed(state, epoch, DOMAIN_BEACON_PROPOSER)
168167
indices = get_active_validator_indices(state, epoch)
168+
seeds = [hash(epoch_seed + uint_to_bytes(Slot(i))) for i in range(SLOTS_PER_EPOCH)]
169169
return [compute_proposer_index(state, indices, seed) for seed in seeds]
170170
```
171171

@@ -235,4 +235,4 @@ def process_proposer_lookahead(state: BeaconState) -> None:
235235
# Fill in the last epoch with new proposer indices
236236
last_epoch_proposers = compute_proposer_indices(state, Epoch(get_current_epoch(state) + MIN_SEED_LOOKAHEAD + 1))
237237
state.proposer_lookahead[last_epoch_start:] = last_epoch_proposers
238-
```
238+
```

0 commit comments

Comments
 (0)