mirror of
https://github.com/sigp/lighthouse.git
synced 2026-04-21 06:48:27 +00:00
adding michael commits
This commit is contained in:
committed by
hopinheimer
parent
491b69f364
commit
3e3ccba1a6
@@ -3,7 +3,7 @@ use crate::{ForkChoiceStore, InvalidationOperation};
|
||||
use fixed_bytes::FixedBytesExtended;
|
||||
use logging::crit;
|
||||
use proto_array::{
|
||||
Block as ProtoBlock, DisallowedReOrgOffsets, ExecutionStatus, JustifiedBalances,
|
||||
Block as ProtoBlock, DisallowedReOrgOffsets, ExecutionStatus, JustifiedBalances, LatestMessage,
|
||||
ProposerHeadError, ProposerHeadInfo, ProtoArrayForkChoice, ReOrgThreshold,
|
||||
};
|
||||
use ssz::{Decode, Encode};
|
||||
@@ -1136,7 +1136,8 @@ where
|
||||
self.proto_array.process_attestation(
|
||||
*validator_index as usize,
|
||||
attestation.data().beacon_block_root,
|
||||
attestation.data().target.epoch,
|
||||
attestation.data().slot,
|
||||
payload_present,
|
||||
)?;
|
||||
}
|
||||
} else {
|
||||
@@ -1256,10 +1257,12 @@ where
|
||||
&mut self.queued_attestations,
|
||||
) {
|
||||
for validator_index in attestation.attesting_indices.iter() {
|
||||
// FIXME(sproul): backwards compat/fork abstraction
|
||||
self.proto_array.process_attestation(
|
||||
*validator_index as usize,
|
||||
attestation.block_root,
|
||||
attestation.target_epoch,
|
||||
attestation.slot,
|
||||
attestation.payload_present,
|
||||
)?;
|
||||
}
|
||||
}
|
||||
@@ -1389,13 +1392,15 @@ where
|
||||
|
||||
/// Returns the latest message for a given validator, if any.
|
||||
///
|
||||
/// Returns `(block_root, block_slot)`.
|
||||
/// Returns `block_root, block_slot, payload_present`.
|
||||
///
|
||||
/// ## Notes
|
||||
///
|
||||
/// It may be prudent to call `Self::update_time` before calling this function,
|
||||
/// since some attestations might be queued and awaiting processing.
|
||||
pub fn latest_message(&self, validator_index: usize) -> Option<(Hash256, Epoch)> {
|
||||
///
|
||||
/// This function is only used in tests.
|
||||
pub fn latest_message(&self, validator_index: usize) -> Option<LatestMessage> {
|
||||
self.proto_array.latest_message(validator_index)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user