mirror of
https://github.com/sigp/lighthouse.git
synced 2026-05-08 17:26:04 +00:00
More cleanup
This commit is contained in:
@@ -281,19 +281,6 @@ impl<'a, E: EthSpec> From<IndexedAttestationRef<'a, E>> for QueuedAttestation {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Used for queuing payload attestations (PTC votes) from the current slot.
|
|
||||||
/// Payload attestations have different dequeue timing than regular attestations:
|
|
||||||
/// gossiped payload attestations need an extra slot of delay (slot + 1 < current_slot).
|
|
||||||
#[derive(Clone, PartialEq, Encode, Decode)]
|
|
||||||
pub struct QueuedPayloadAttestation {
|
|
||||||
slot: Slot,
|
|
||||||
/// Resolved PTC committee positions (not validator indices).
|
|
||||||
ptc_indices: Vec<usize>,
|
|
||||||
block_root: Hash256,
|
|
||||||
payload_present: bool,
|
|
||||||
blob_data_available: bool,
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Returns all values in `self.queued_attestations` that have a slot that is earlier than the
|
/// Returns all values in `self.queued_attestations` that have a slot that is earlier than the
|
||||||
/// current slot. Also removes those values from `self.queued_attestations`.
|
/// current slot. Also removes those values from `self.queued_attestations`.
|
||||||
fn dequeue_attestations(
|
fn dequeue_attestations(
|
||||||
@@ -450,6 +437,7 @@ where
|
|||||||
execution_status,
|
execution_status,
|
||||||
execution_payload_parent_hash,
|
execution_payload_parent_hash,
|
||||||
execution_payload_block_hash,
|
execution_payload_block_hash,
|
||||||
|
anchor_block.message().proposer_index(),
|
||||||
spec,
|
spec,
|
||||||
)?;
|
)?;
|
||||||
|
|
||||||
@@ -462,7 +450,7 @@ where
|
|||||||
head_hash: None,
|
head_hash: None,
|
||||||
justified_hash: None,
|
justified_hash: None,
|
||||||
finalized_hash: None,
|
finalized_hash: None,
|
||||||
// These will be updated during the next call to `Self::get_head`.
|
// This will be updated during the next call to `Self::get_head`.
|
||||||
head_root: Hash256::zero(),
|
head_root: Hash256::zero(),
|
||||||
},
|
},
|
||||||
_phantom: PhantomData,
|
_phantom: PhantomData,
|
||||||
|
|||||||
@@ -5,8 +5,7 @@ mod metrics;
|
|||||||
pub use crate::fork_choice::{
|
pub use crate::fork_choice::{
|
||||||
AttestationFromBlock, Error, ForkChoice, ForkChoiceView, ForkchoiceUpdateParameters,
|
AttestationFromBlock, Error, ForkChoice, ForkChoiceView, ForkchoiceUpdateParameters,
|
||||||
InvalidAttestation, InvalidBlock, PayloadVerificationStatus, PersistedForkChoice,
|
InvalidAttestation, InvalidBlock, PayloadVerificationStatus, PersistedForkChoice,
|
||||||
PersistedForkChoiceV28, PersistedForkChoiceV29, QueuedAttestation, QueuedPayloadAttestation,
|
PersistedForkChoiceV28, PersistedForkChoiceV29, QueuedAttestation, ResetPayloadStatuses,
|
||||||
ResetPayloadStatuses,
|
|
||||||
};
|
};
|
||||||
pub use fork_choice_store::ForkChoiceStore;
|
pub use fork_choice_store::ForkChoiceStore;
|
||||||
pub use proto_array::{
|
pub use proto_array::{
|
||||||
|
|||||||
@@ -144,6 +144,7 @@ impl ForkChoiceTestDefinition {
|
|||||||
ExecutionStatus::Optimistic(ExecutionBlockHash::zero()),
|
ExecutionStatus::Optimistic(ExecutionBlockHash::zero()),
|
||||||
self.execution_payload_parent_hash,
|
self.execution_payload_parent_hash,
|
||||||
self.execution_payload_block_hash,
|
self.execution_payload_block_hash,
|
||||||
|
0,
|
||||||
&spec,
|
&spec,
|
||||||
)
|
)
|
||||||
.expect("should create fork choice struct");
|
.expect("should create fork choice struct");
|
||||||
|
|||||||
@@ -479,6 +479,7 @@ impl ProtoArrayForkChoice {
|
|||||||
execution_status: ExecutionStatus,
|
execution_status: ExecutionStatus,
|
||||||
execution_payload_parent_hash: Option<ExecutionBlockHash>,
|
execution_payload_parent_hash: Option<ExecutionBlockHash>,
|
||||||
execution_payload_block_hash: Option<ExecutionBlockHash>,
|
execution_payload_block_hash: Option<ExecutionBlockHash>,
|
||||||
|
proposer_index: u64,
|
||||||
spec: &ChainSpec,
|
spec: &ChainSpec,
|
||||||
) -> Result<Self, String> {
|
) -> Result<Self, String> {
|
||||||
let mut proto_array = ProtoArray {
|
let mut proto_array = ProtoArray {
|
||||||
@@ -505,7 +506,7 @@ impl ProtoArrayForkChoice {
|
|||||||
unrealized_finalized_checkpoint: Some(finalized_checkpoint),
|
unrealized_finalized_checkpoint: Some(finalized_checkpoint),
|
||||||
execution_payload_parent_hash,
|
execution_payload_parent_hash,
|
||||||
execution_payload_block_hash,
|
execution_payload_block_hash,
|
||||||
proposer_index: Some(0),
|
proposer_index: Some(proposer_index),
|
||||||
};
|
};
|
||||||
|
|
||||||
proto_array
|
proto_array
|
||||||
@@ -1317,6 +1318,7 @@ mod test_compute_deltas {
|
|||||||
execution_status,
|
execution_status,
|
||||||
None,
|
None,
|
||||||
None,
|
None,
|
||||||
|
0,
|
||||||
&spec,
|
&spec,
|
||||||
)
|
)
|
||||||
.unwrap();
|
.unwrap();
|
||||||
@@ -1471,6 +1473,7 @@ mod test_compute_deltas {
|
|||||||
execution_status,
|
execution_status,
|
||||||
None,
|
None,
|
||||||
None,
|
None,
|
||||||
|
0,
|
||||||
&spec,
|
&spec,
|
||||||
)
|
)
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|||||||
Reference in New Issue
Block a user