This commit is contained in:
Eitan Seri-Levi
2025-01-07 13:24:29 +07:00
parent 30e9ff2a14
commit 63a26b1107
9 changed files with 39 additions and 34 deletions

View File

@@ -820,7 +820,7 @@ impl<E: EthSpec> BeaconState<E> {
) -> Result<InclusionListCommittee<E>, Error> {
let epoch = slot.epoch(E::slots_per_epoch());
let current_epoch = self.current_epoch();
let next_epoch = current_epoch + 1;
let next_epoch = current_epoch.safe_add(1)?;
if epoch != current_epoch || epoch != next_epoch {
return Err(Error::SlotOutOfBounds);
}
@@ -828,9 +828,10 @@ impl<E: EthSpec> BeaconState<E> {
let seed = self.get_inclusion_list_seed(slot, spec)?;
let indices = self.get_active_validator_indices(epoch, spec)?;
let start =
(slot % E::slots_per_epoch()).as_usize() * E::InclusionListCommitteeSize::to_usize();
let end = start + E::InclusionListCommitteeSize::to_usize();
let start = (slot.safe_rem(E::slots_per_epoch())?)
.as_usize()
.safe_mul(E::InclusionListCommitteeSize::to_usize())?;
let end = start.safe_add(E::InclusionListCommitteeSize::to_usize())?;
let mut i = start;
let mut il_committee_indices =

View File

@@ -6,7 +6,6 @@ use serde::{Deserialize, Serialize};
use ssz_derive::{Decode, Encode};
use ssz_types::VariableList;
use test_random_derive::TestRandom;
use tree_hash::TreeHash;
use tree_hash_derive::TreeHash;
pub type InclusionListTransactions<E> = VariableList<