mirror of
https://github.com/sigp/lighthouse.git
synced 2026-05-30 04:37:13 +00:00
Emit correct beacon IL event
This commit is contained in:
@@ -75,7 +75,9 @@ use crate::{
|
|||||||
kzg_utils, metrics, AvailabilityPendingExecutedBlock, BeaconChainError, BeaconForkChoiceStore,
|
kzg_utils, metrics, AvailabilityPendingExecutedBlock, BeaconChainError, BeaconForkChoiceStore,
|
||||||
BeaconSnapshot, CachedHead,
|
BeaconSnapshot, CachedHead,
|
||||||
};
|
};
|
||||||
use eth2::types::{EventKind, SseBlobSidecar, SseBlock, SseExtendedPayloadAttributes};
|
use eth2::types::{
|
||||||
|
EventKind, SseBlobSidecar, SseBlock, SseExtendedPayloadAttributes, SseInclusionList,
|
||||||
|
};
|
||||||
use execution_layer::{
|
use execution_layer::{
|
||||||
BlockProposalContents, BlockProposalContentsType, BuilderParams, ChainHealth, ExecutionLayer,
|
BlockProposalContents, BlockProposalContentsType, BuilderParams, ChainHealth, ExecutionLayer,
|
||||||
FailedCondition, PayloadAttributes, PayloadStatus,
|
FailedCondition, PayloadAttributes, PayloadStatus,
|
||||||
@@ -2395,7 +2397,10 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
|
|||||||
GossipVerifiedInclusionList::verify(inclusion_list, self).inspect(|v| {
|
GossipVerifiedInclusionList::verify(inclusion_list, self).inspect(|v| {
|
||||||
metrics::inc_counter(&metrics::INCLUSION_LIST_PROCESSING_SUCCESSES);
|
metrics::inc_counter(&metrics::INCLUSION_LIST_PROCESSING_SUCCESSES);
|
||||||
if let Some(event_handler) = self.event_handler.as_ref() {
|
if let Some(event_handler) = self.event_handler.as_ref() {
|
||||||
event_handler.register(EventKind::InclusionList(Box::new(v.signed_il.clone())));
|
event_handler.register(EventKind::InclusionList(SseInclusionList {
|
||||||
|
version: ForkName::Eip7805,
|
||||||
|
data: v.signed_il.clone(),
|
||||||
|
}));
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -984,6 +984,13 @@ pub struct SseHead {
|
|||||||
pub execution_optimistic: bool,
|
pub execution_optimistic: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[derive(PartialEq, Debug, Serialize, Deserialize, Clone)]
|
||||||
|
#[serde(bound = "E: EthSpec")]
|
||||||
|
pub struct SseInclusionList<E: EthSpec> {
|
||||||
|
pub version: ForkName,
|
||||||
|
pub data: SignedInclusionList<E>,
|
||||||
|
}
|
||||||
|
|
||||||
#[derive(Debug, PartialEq, Clone, Serialize, Deserialize)]
|
#[derive(Debug, PartialEq, Clone, Serialize, Deserialize)]
|
||||||
pub struct BlockGossip {
|
pub struct BlockGossip {
|
||||||
pub slot: Slot,
|
pub slot: Slot,
|
||||||
@@ -1130,7 +1137,7 @@ pub enum EventKind<E: EthSpec> {
|
|||||||
AttesterSlashing(Box<AttesterSlashing<E>>),
|
AttesterSlashing(Box<AttesterSlashing<E>>),
|
||||||
BlsToExecutionChange(Box<SignedBlsToExecutionChange>),
|
BlsToExecutionChange(Box<SignedBlsToExecutionChange>),
|
||||||
BlockGossip(Box<BlockGossip>),
|
BlockGossip(Box<BlockGossip>),
|
||||||
InclusionList(Box<SignedInclusionList<E>>),
|
InclusionList(SseInclusionList<E>),
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<E: EthSpec> EventKind<E> {
|
impl<E: EthSpec> EventKind<E> {
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ pub struct InclusionList<E: EthSpec> {
|
|||||||
#[serde(with = "serde_utils::quoted_u64")]
|
#[serde(with = "serde_utils::quoted_u64")]
|
||||||
pub validator_index: u64,
|
pub validator_index: u64,
|
||||||
pub inclusion_list_committee_root: Hash256,
|
pub inclusion_list_committee_root: Hash256,
|
||||||
|
#[serde(with = "ssz_types::serde_utils::list_of_hex_var_list")]
|
||||||
pub transactions: Transactions<E>,
|
pub transactions: Transactions<E>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user