merge upstream/unstable

This commit is contained in:
Mark Mackey
2022-12-28 14:43:25 -06:00
37 changed files with 112 additions and 122 deletions

View File

@@ -504,7 +504,7 @@ impl<T: EthSpec> BeaconState<T> {
/// Spec v0.12.1
pub fn get_committee_count_at_slot(&self, slot: Slot) -> Result<u64, Error> {
let cache = self.committee_cache_at_slot(slot)?;
Ok(cache.committees_per_slot() as u64)
Ok(cache.committees_per_slot())
}
/// Compute the number of committees in an entire epoch.

View File

@@ -144,7 +144,7 @@ impl CommitteeCache {
self.committees_per_slot as usize,
index as usize,
);
let committee = self.compute_committee(committee_index as usize)?;
let committee = self.compute_committee(committee_index)?;
Some(BeaconCommittee {
slot,

View File

@@ -344,12 +344,7 @@ mod committees {
let cache_epoch = cache_epoch.into_epoch(state_epoch);
execute_committee_consistency_test(
new_head_state,
cache_epoch,
validator_count as usize,
spec,
);
execute_committee_consistency_test(new_head_state, cache_epoch, validator_count, spec);
}
async fn committee_consistency_test_suite<T: EthSpec>(cached_epoch: RelativeEpoch) {
@@ -361,18 +356,13 @@ mod committees {
.mul(spec.target_committee_size)
.add(1);
committee_consistency_test::<T>(validator_count as usize, Epoch::new(0), cached_epoch)
committee_consistency_test::<T>(validator_count, Epoch::new(0), cached_epoch).await;
committee_consistency_test::<T>(validator_count, T::genesis_epoch() + 4, cached_epoch)
.await;
committee_consistency_test::<T>(
validator_count as usize,
T::genesis_epoch() + 4,
cached_epoch,
)
.await;
committee_consistency_test::<T>(
validator_count as usize,
validator_count,
T::genesis_epoch()
+ (T::slots_per_historical_root() as u64)
.mul(T::slots_per_epoch())

View File

@@ -223,7 +223,7 @@ mod test {
}
fn preset_from_file<T: DeserializeOwned>(preset_name: &str, filename: &str) -> T {
let f = File::open(&presets_base_path().join(preset_name).join(filename))
let f = File::open(presets_base_path().join(preset_name).join(filename))
.expect("preset file exists");
serde_yaml::from_reader(f).unwrap()
}