mirror of
https://gitlab.com/pulsechaincom/lighthouse-pulse.git
synced 2025-01-12 14:00:06 +00:00
v0.6: remove some FIXMEs
This commit is contained in:
parent
8c5964a758
commit
1823378bfa
@ -450,10 +450,10 @@ impl<T: EthSpec> BeaconState<T> {
|
|||||||
Ok(&self.latest_block_roots[i])
|
Ok(&self.latest_block_roots[i])
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Return the block root at a recent `slot`.
|
/// Return the block root at a recent `epoch`.
|
||||||
///
|
///
|
||||||
/// Spec v0.6.0
|
/// Spec v0.6.0
|
||||||
// FIXME(sproul): name swap with get_block_root
|
// NOTE: the spec calls this get_block_root
|
||||||
pub fn get_block_root_at_epoch(&self, epoch: Epoch) -> Result<&Hash256, BeaconStateError> {
|
pub fn get_block_root_at_epoch(&self, epoch: Epoch) -> Result<&Hash256, BeaconStateError> {
|
||||||
self.get_block_root(epoch.start_slot(T::slots_per_epoch()))
|
self.get_block_root(epoch.start_slot(T::slots_per_epoch()))
|
||||||
}
|
}
|
||||||
@ -854,8 +854,6 @@ impl<T: EthSpec> BeaconState<T> {
|
|||||||
self.committee_caches[Self::cache_index(relative_epoch)] = CommitteeCache::default();
|
self.committee_caches[Self::cache_index(relative_epoch)] = CommitteeCache::default();
|
||||||
}
|
}
|
||||||
|
|
||||||
// FIXME(sproul): drop_previous/current_committee_cache
|
|
||||||
|
|
||||||
/// Updates the pubkey cache, if required.
|
/// Updates the pubkey cache, if required.
|
||||||
///
|
///
|
||||||
/// Adds all `pubkeys` from the `validator_registry` which are not already in the cache. Will
|
/// Adds all `pubkeys` from the `validator_registry` which are not already in the cache. Will
|
||||||
|
@ -175,7 +175,7 @@ impl<T: EthSpec> TestingBeaconStateBuilder<T> {
|
|||||||
|
|
||||||
state.slot = slot;
|
state.slot = slot;
|
||||||
|
|
||||||
// FIXME(sproul): update latest_start_shard?
|
// NOTE: we could update the latest start shard here
|
||||||
|
|
||||||
state.previous_justified_epoch = epoch - 3;
|
state.previous_justified_epoch = epoch - 3;
|
||||||
state.current_justified_epoch = epoch - 2;
|
state.current_justified_epoch = epoch - 2;
|
||||||
|
@ -23,12 +23,18 @@ impl TestingPendingAttestationBuilder {
|
|||||||
) -> Self {
|
) -> Self {
|
||||||
let data_builder = TestingAttestationDataBuilder::new(state, shard, slot, spec);
|
let data_builder = TestingAttestationDataBuilder::new(state, shard, slot, spec);
|
||||||
|
|
||||||
|
let relative_epoch =
|
||||||
|
RelativeEpoch::from_epoch(state.current_epoch(), slot.epoch(T::slots_per_epoch()))
|
||||||
|
.expect("epoch out of bounds");
|
||||||
|
let proposer_index = state
|
||||||
|
.get_beacon_proposer_index(slot, relative_epoch, spec)
|
||||||
|
.unwrap() as u64;
|
||||||
|
|
||||||
let pending_attestation = PendingAttestation {
|
let pending_attestation = PendingAttestation {
|
||||||
aggregation_bitfield: Bitfield::new(),
|
aggregation_bitfield: Bitfield::new(),
|
||||||
data: data_builder.build(),
|
data: data_builder.build(),
|
||||||
inclusion_delay: spec.min_attestation_inclusion_delay,
|
inclusion_delay: spec.min_attestation_inclusion_delay,
|
||||||
// FIXME(sproul)
|
proposer_index,
|
||||||
proposer_index: 0,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
Self {
|
Self {
|
||||||
|
Loading…
Reference in New Issue
Block a user