updates per per review

This commit is contained in:
shane-moore
2025-08-11 14:03:10 -07:00
committed by Mark Mackey
parent e90abb0981
commit 161bd2d1bf
10 changed files with 74 additions and 311 deletions

View File

@@ -5726,45 +5726,7 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
execution_payload_value,
)
}
// Below is my attempt at handling the Gloas variant
// Note that Mark's implementation had this as:
// BeaconState::EIP7732(_) => todo!("EIP-7732 block production"),
BeaconState::Gloas(_) => {
// Gloas blocks contain execution bids, not execution payloads
let block_proposal_contents =
block_contents.ok_or(BlockProductionError::MissingExecutionBid)?;
let (signed_execution_bid, payload_attestations) = block_proposal_contents
.into_execution_bid()
.map_err(|_| BlockProductionError::InvalidPayloadFork)?;
(
BeaconBlock::Gloas(BeaconBlockGloas {
slot,
proposer_index,
parent_root,
state_root: Hash256::zero(),
body: BeaconBlockBodyGloas {
randao_reveal,
eth1_data,
graffiti,
proposer_slashings: proposer_slashings.into(),
attester_slashings: attester_slashings_electra.into(),
attestations: attestations_electra.into(),
deposits: deposits.into(),
voluntary_exits: voluntary_exits.into(),
sync_aggregate: sync_aggregate
.ok_or(BlockProductionError::MissingSyncAggregate)?,
bls_to_execution_changes: bls_to_execution_changes.into(),
// Gloas: Use actual execution bid data
signed_execution_bid: signed_execution_bid.clone(),
payload_attestations,
_phantom: PhantomData,
},
}),
None, // blob commitments moved to `ExecutionPayloadEnvelope`
Uint256::ZERO, // No execution payload value for Gloas blocks, just bids value
)
}
BeaconState::Gloas(_) => todo!("Gloas block production"),
};
let block = SignedBeaconBlock::from_block(

View File

@@ -51,7 +51,7 @@ use types::non_zero_usize::new_non_zero_usize;
use types::payload::BlockProductionVersion;
use types::{
AbstractExecPayload, BlobsList, ExecutionPayloadDeneb, ExecutionRequests, KzgProofs,
PayloadAttestation, SignedBlindedBeaconBlock, SignedExecutionBid,
SignedBlindedBeaconBlock,
};
use types::{
BeaconStateError, BlindedPayload, ChainSpec, Epoch, ExecPayload, ExecutionPayloadBellatrix,
@@ -212,11 +212,6 @@ pub enum BlockProposalContents<E: EthSpec, Payload: AbstractExecPayload<E>> {
// See: https://github.com/sigp/lighthouse/issues/6981
requests: Option<ExecutionRequests<E>>,
},
/// Gloas: Execution bid and payload attestations
BidAndPayloadAttestations {
signed_execution_bid: SignedExecutionBid,
payload_attestations: VariableList<PayloadAttestation<E>, E::MaxPayloadAttestations>,
},
}
impl<E: EthSpec> From<BlockProposalContents<E, FullPayload<E>>>
@@ -244,13 +239,6 @@ impl<E: EthSpec> From<BlockProposalContents<E, FullPayload<E>>>
blobs_and_proofs: None,
requests,
},
BlockProposalContents::BidAndPayloadAttestations {
signed_execution_bid,
payload_attestations,
} => BlockProposalContents::BidAndPayloadAttestations {
signed_execution_bid,
payload_attestations,
},
}
}
}
@@ -318,28 +306,6 @@ impl<E: EthSpec, Payload: AbstractExecPayload<E>> BlockProposalContents<E, Paylo
requests,
block_value,
),
Self::BidAndPayloadAttestations { .. } => {
panic!("Cannot deconstruct BidAndPayloadAttestations variant into execution payload components")
}
}
}
/// Extract execution bid data for EIP-7732 Gloas blocks
pub fn into_execution_bid(
self,
) -> Result<
(
SignedExecutionBid,
VariableList<PayloadAttestation<E>, E::MaxPayloadAttestations>,
),
&'static str,
> {
match self {
Self::BidAndPayloadAttestations {
signed_execution_bid,
payload_attestations,
} => Ok((signed_execution_bid, payload_attestations)),
_ => Err("Cannot extract execution bid from non-BidAndPayloadAttestations variant"),
}
}
@@ -347,27 +313,18 @@ impl<E: EthSpec, Payload: AbstractExecPayload<E>> BlockProposalContents<E, Paylo
match self {
Self::Payload { payload, .. } => payload,
Self::PayloadAndBlobs { payload, .. } => payload,
Self::BidAndPayloadAttestations { .. } => {
panic!("BidAndPayloadAttestations variant does not contain execution payload")
}
}
}
pub fn to_payload(self) -> Payload {
match self {
Self::Payload { payload, .. } => payload,
Self::PayloadAndBlobs { payload, .. } => payload,
Self::BidAndPayloadAttestations { .. } => {
panic!("BidAndPayloadAttestations variant does not contain execution payload")
}
}
}
pub fn block_value(&self) -> &Uint256 {
match self {
Self::Payload { block_value, .. } => block_value,
Self::PayloadAndBlobs { block_value, .. } => block_value,
Self::BidAndPayloadAttestations { .. } => {
panic!("BidAndPayloadAttestations variant does not have block_value")
}
}
}
}

View File

@@ -153,7 +153,6 @@ where
#[superstruct(only(Fulu, Gloas))]
pub proposer_lookahead: Vector<u64, E::ProposerLookaheadSlots>,
// Gloas
// Gloas
#[superstruct(only(Gloas))]
pub execution_payload_availability: BitVector<E::SlotsPerHistoricalRoot>,