mirror of
https://github.com/sigp/lighthouse.git
synced 2026-05-30 04:37:13 +00:00
fix payload v5
This commit is contained in:
@@ -96,15 +96,10 @@ pub fn per_slot_processing<E: EthSpec>(
|
||||
if spec.fulu_fork_epoch == Some(state.current_epoch()) {
|
||||
upgrade_to_fulu(state, spec)?;
|
||||
}
|
||||
// Heze.
|
||||
if spec.heze_fork_epoch == Some(state.current_epoch()) {
|
||||
upgrade_to_heze(state, spec)?;
|
||||
}
|
||||
// Gloas.
|
||||
if spec.gloas_fork_epoch == Some(state.current_epoch()) {
|
||||
upgrade_to_gloas(state, spec)?;
|
||||
}
|
||||
|
||||
// Heze.
|
||||
if spec.heze_fork_epoch == Some(state.current_epoch()) {
|
||||
upgrade_to_heze(state, spec)?;
|
||||
|
||||
@@ -1021,9 +1021,20 @@ impl<E: EthSpec> BeaconState<E> {
|
||||
}
|
||||
|
||||
let committee_size = E::InclusionListCommitteeSize::to_usize();
|
||||
let num_indices = indices.len();
|
||||
// num_indices > 0 is guaranteed by the is_empty() check above
|
||||
let il_committee: Vec<u64> = (0..committee_size)
|
||||
.map(|i| indices[i % indices.len()] as u64)
|
||||
.collect();
|
||||
.map(|i| {
|
||||
let idx = i
|
||||
.safe_rem(num_indices)
|
||||
.map_err(|_| BeaconStateError::InsufficientValidators)?;
|
||||
indices
|
||||
.get(idx)
|
||||
.copied()
|
||||
.map(|v| v as u64)
|
||||
.ok_or(BeaconStateError::InsufficientValidators)
|
||||
})
|
||||
.collect::<Result<Vec<u64>, BeaconStateError>>()?;
|
||||
|
||||
Ok(InclusionListCommittee::<E>::from(il_committee.try_into()?))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user