mirror of
https://github.com/sigp/lighthouse.git
synced 2026-05-08 17:26:04 +00:00
Merge branch 'gloas-block-and-bid-production' into gloas-devnet-0
This commit is contained in:
@@ -240,7 +240,7 @@ pub struct PrePayloadAttributes {
|
|||||||
///
|
///
|
||||||
/// The parent block number is not part of the payload attributes sent to the EL, but *is*
|
/// The parent block number is not part of the payload attributes sent to the EL, but *is*
|
||||||
/// sent to builders via SSE.
|
/// sent to builders via SSE.
|
||||||
pub parent_block_number: u64,
|
pub parent_block_number: Option<u64>,
|
||||||
/// The block root of the block being built upon (same block as fcU `headBlockHash`).
|
/// The block root of the block being built upon (same block as fcU `headBlockHash`).
|
||||||
pub parent_beacon_block_root: Hash256,
|
pub parent_beacon_block_root: Hash256,
|
||||||
}
|
}
|
||||||
@@ -4694,15 +4694,25 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
|
|||||||
return Ok(None);
|
return Ok(None);
|
||||||
};
|
};
|
||||||
|
|
||||||
// Get the `prev_randao` and parent block number.
|
// TODO(gloas) not sure what to do here see this issue
|
||||||
let head_block_number = cached_head.head_block_number()?;
|
// https://github.com/sigp/lighthouse/issues/8817
|
||||||
let (prev_randao, parent_block_number) = if proposer_head == head_parent_block_root {
|
let (prev_randao, parent_block_number) = if self
|
||||||
(
|
.spec
|
||||||
cached_head.parent_random()?,
|
.fork_name_at_slot::<T::EthSpec>(proposal_slot)
|
||||||
head_block_number.saturating_sub(1),
|
.gloas_enabled()
|
||||||
)
|
{
|
||||||
|
(cached_head.head_random()?, None)
|
||||||
} else {
|
} else {
|
||||||
(cached_head.head_random()?, head_block_number)
|
// Get the `prev_randao` and parent block number.
|
||||||
|
let head_block_number = cached_head.head_block_number()?;
|
||||||
|
if proposer_head == head_parent_block_root {
|
||||||
|
(
|
||||||
|
cached_head.parent_random()?,
|
||||||
|
Some(head_block_number.saturating_sub(1)),
|
||||||
|
)
|
||||||
|
} else {
|
||||||
|
(cached_head.head_random()?, Some(head_block_number))
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
Ok(Some(PrePayloadAttributes {
|
Ok(Some(PrePayloadAttributes {
|
||||||
@@ -6057,18 +6067,20 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
|
|||||||
if let Some(event_handler) = &self.event_handler
|
if let Some(event_handler) = &self.event_handler
|
||||||
&& event_handler.has_payload_attributes_subscribers()
|
&& event_handler.has_payload_attributes_subscribers()
|
||||||
{
|
{
|
||||||
event_handler.register(EventKind::PayloadAttributes(ForkVersionedResponse {
|
if let Some(parent_block_number) = pre_payload_attributes.parent_block_number {
|
||||||
data: SseExtendedPayloadAttributes {
|
event_handler.register(EventKind::PayloadAttributes(ForkVersionedResponse {
|
||||||
proposal_slot: prepare_slot,
|
data: SseExtendedPayloadAttributes {
|
||||||
proposer_index: proposer,
|
proposal_slot: prepare_slot,
|
||||||
parent_block_root: head_root,
|
proposer_index: proposer,
|
||||||
parent_block_number: pre_payload_attributes.parent_block_number,
|
parent_block_root: head_root,
|
||||||
parent_block_hash: forkchoice_update_params.head_hash.unwrap_or_default(),
|
parent_block_number,
|
||||||
payload_attributes: payload_attributes.into(),
|
parent_block_hash: forkchoice_update_params.head_hash.unwrap_or_default(),
|
||||||
},
|
payload_attributes: payload_attributes.into(),
|
||||||
metadata: Default::default(),
|
},
|
||||||
version: self.spec.fork_name_at_slot::<T::EthSpec>(prepare_slot),
|
metadata: Default::default(),
|
||||||
}));
|
version: self.spec.fork_name_at_slot::<T::EthSpec>(prepare_slot),
|
||||||
|
}));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let Some(till_prepare_slot) = self.slot_clock.duration_to_slot(prepare_slot) else {
|
let Some(till_prepare_slot) = self.slot_clock.duration_to_slot(prepare_slot) else {
|
||||||
|
|||||||
@@ -670,15 +670,26 @@ pub fn post_validator_prepare_beacon_proposer<T: BeaconChainTypes>(
|
|||||||
)
|
)
|
||||||
.await;
|
.await;
|
||||||
|
|
||||||
chain
|
// TODO(gloas): verify this is correct. We skip proposer preparation for
|
||||||
.prepare_beacon_proposer(current_slot)
|
// GLOAS because the execution payload is no longer embedded in the beacon
|
||||||
.await
|
// block (it's in the payload envelope), so the head block's
|
||||||
.map_err(|e| {
|
// execution_payload() is unavailable.
|
||||||
warp_utils::reject::custom_bad_request(format!(
|
let next_slot = current_slot + 1;
|
||||||
"error updating proposer preparations: {:?}",
|
if !chain
|
||||||
e
|
.spec
|
||||||
))
|
.fork_name_at_slot::<T::EthSpec>(next_slot)
|
||||||
})?;
|
.gloas_enabled()
|
||||||
|
{
|
||||||
|
chain
|
||||||
|
.prepare_beacon_proposer(current_slot)
|
||||||
|
.await
|
||||||
|
.map_err(|e| {
|
||||||
|
warp_utils::reject::custom_bad_request(format!(
|
||||||
|
"error updating proposer preparations: {:?}",
|
||||||
|
e
|
||||||
|
))
|
||||||
|
})?;
|
||||||
|
}
|
||||||
|
|
||||||
if chain.spec.is_peer_das_scheduled() {
|
if chain.spec.is_peer_das_scheduled() {
|
||||||
let (finalized_beacon_state, _, _) =
|
let (finalized_beacon_state, _, _) =
|
||||||
|
|||||||
Reference in New Issue
Block a user