mirror of
https://github.com/sigp/lighthouse.git
synced 2026-05-31 05:07:12 +00:00
rebase onto fulu
This commit is contained in:
@@ -7399,7 +7399,7 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn on_verified_inclusion_list(&self, signed_il: SignedInclusionList<T::EthSpec>) {
|
pub fn on_verified_inclusion_list(&self, signed_il: SignedInclusionList<T::EthSpec>) {
|
||||||
debug!(self.log, "Adding verified inclusion list to the cache");
|
info!(self.log, "Adding verified inclusion list to the cache");
|
||||||
self.inclusion_list_cache
|
self.inclusion_list_cache
|
||||||
.write()
|
.write()
|
||||||
.on_inclusion_list(signed_il, &self.log);
|
.on_inclusion_list(signed_il, &self.log);
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ pub struct NewPayloadRequest<'block, E: EthSpec> {
|
|||||||
pub parent_beacon_block_root: Hash256,
|
pub parent_beacon_block_root: Hash256,
|
||||||
#[superstruct(only(Electra, Fulu))]
|
#[superstruct(only(Electra, Fulu))]
|
||||||
pub execution_requests: &'block ExecutionRequests<E>,
|
pub execution_requests: &'block ExecutionRequests<E>,
|
||||||
#[superstruct(only(Electra, Fulu))]
|
#[superstruct(only(Fulu))]
|
||||||
pub il_transactions: InclusionListTransactions<E>,
|
pub il_transactions: InclusionListTransactions<E>,
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -204,7 +204,6 @@ impl<'a, E: EthSpec> NewPayloadRequest<'a, E> {
|
|||||||
.collect(),
|
.collect(),
|
||||||
parent_beacon_block_root: block_ref.parent_root,
|
parent_beacon_block_root: block_ref.parent_root,
|
||||||
execution_requests: &block_ref.body.execution_requests,
|
execution_requests: &block_ref.body.execution_requests,
|
||||||
il_transactions,
|
|
||||||
})),
|
})),
|
||||||
BeaconBlockRef::Fulu(block_ref) => Ok(Self::Fulu(NewPayloadRequestFulu {
|
BeaconBlockRef::Fulu(block_ref) => Ok(Self::Fulu(NewPayloadRequestFulu {
|
||||||
execution_payload: &block_ref.body.execution_payload.execution_payload,
|
execution_payload: &block_ref.body.execution_payload.execution_payload,
|
||||||
@@ -259,7 +258,6 @@ impl<'a, E: EthSpec> TryFrom<BeaconBlockRef<'a, E>> for NewPayloadRequest<'a, E>
|
|||||||
.collect(),
|
.collect(),
|
||||||
parent_beacon_block_root: block_ref.parent_root,
|
parent_beacon_block_root: block_ref.parent_root,
|
||||||
execution_requests: &block_ref.body.execution_requests,
|
execution_requests: &block_ref.body.execution_requests,
|
||||||
il_transactions: vec![].into(),
|
|
||||||
})),
|
})),
|
||||||
BeaconBlockRef::Fulu(block_ref) => Ok(Self::Fulu(NewPayloadRequestFulu {
|
BeaconBlockRef::Fulu(block_ref) => Ok(Self::Fulu(NewPayloadRequestFulu {
|
||||||
execution_payload: &block_ref.body.execution_payload.execution_payload,
|
execution_payload: &block_ref.body.execution_payload.execution_payload,
|
||||||
|
|||||||
@@ -193,7 +193,7 @@ fn verify_and_publish_inclusion_list<T: BeaconChainTypes>(
|
|||||||
inclusion_list: &SignedInclusionList<T::EthSpec>,
|
inclusion_list: &SignedInclusionList<T::EthSpec>,
|
||||||
seen_timestamp: Duration,
|
seen_timestamp: Duration,
|
||||||
network_tx: &UnboundedSender<NetworkMessage<T::EthSpec>>,
|
network_tx: &UnboundedSender<NetworkMessage<T::EthSpec>>,
|
||||||
_log: &Logger,
|
log: &Logger,
|
||||||
) -> Result<(), Error> {
|
) -> Result<(), Error> {
|
||||||
let verified_inclusion_list = chain
|
let verified_inclusion_list = chain
|
||||||
.verify_inclusion_list_for_gossip(inclusion_list)
|
.verify_inclusion_list_for_gossip(inclusion_list)
|
||||||
@@ -207,6 +207,12 @@ fn verify_and_publish_inclusion_list<T: BeaconChainTypes>(
|
|||||||
})
|
})
|
||||||
.map_err(|_| Error::Publication)?;
|
.map_err(|_| Error::Publication)?;
|
||||||
|
|
||||||
|
info!(
|
||||||
|
log,
|
||||||
|
"Published inclusion list";
|
||||||
|
"slot" => verified_inclusion_list.signed_il.message.slot
|
||||||
|
);
|
||||||
|
|
||||||
// TODO(focil) add reprocess logic?
|
// TODO(focil) add reprocess logic?
|
||||||
|
|
||||||
// Notify the validator monitor.
|
// Notify the validator monitor.
|
||||||
|
|||||||
@@ -456,14 +456,14 @@ impl ChainSpec {
|
|||||||
|
|
||||||
/// Returns true if the given epoch is greater than or equal to the `EIP7805_FORK_EPOCH`.
|
/// Returns true if the given epoch is greater than or equal to the `EIP7805_FORK_EPOCH`.
|
||||||
pub fn is_focil_enabled_for_epoch(&self, block_epoch: Epoch) -> bool {
|
pub fn is_focil_enabled_for_epoch(&self, block_epoch: Epoch) -> bool {
|
||||||
self.eip7805_fork_epoch.map_or(false, |eip7805_fork_epoch| {
|
self.eip7805_fork_epoch.is_some_and(|eip7805_fork_epoch| {
|
||||||
block_epoch >= eip7805_fork_epoch
|
block_epoch >= eip7805_fork_epoch
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Returns true if `EIP7805_FORK_EPOCH` is set and is not set to `FAR_FUTURE_EPOCH`.
|
/// Returns true if `EIP7805_FORK_EPOCH` is set and is not set to `FAR_FUTURE_EPOCH`.
|
||||||
pub fn is_focil_scheduled(&self) -> bool {
|
pub fn is_focil_scheduled(&self) -> bool {
|
||||||
self.eip7805_fork_epoch.map_or(false, |eip7805_fork_epoch| {
|
self.eip7805_fork_epoch.is_some_and(|eip7805_fork_epoch| {
|
||||||
eip7805_fork_epoch != self.far_future_epoch
|
eip7805_fork_epoch != self.far_future_epoch
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1402,10 +1402,10 @@ async fn poll_beacon_inclusion_list_duties_for_epoch<T: SlotClock + 'static, E:
|
|||||||
local_pubkeys
|
local_pubkeys
|
||||||
.iter()
|
.iter()
|
||||||
.filter(|pubkey| {
|
.filter(|pubkey| {
|
||||||
inclusion_list_duties.get(pubkey).map_or(true, |duties| {
|
inclusion_list_duties.get(pubkey).is_none_or(|duties| {
|
||||||
duties
|
duties
|
||||||
.get(&epoch)
|
.get(&epoch)
|
||||||
.map_or(true, |(prior, _)| *prior != dependent_root)
|
.is_none_or(|(prior, _)| *prior != dependent_root)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
.collect::<Vec<_>>()
|
.collect::<Vec<_>>()
|
||||||
|
|||||||
Reference in New Issue
Block a user