mirror of
https://github.com/sigp/lighthouse.git
synced 2026-07-03 04:44:28 +00:00
updates per pr review second wave
This commit is contained in:
@@ -292,7 +292,6 @@ pub enum BlockProductionError {
|
|||||||
MissingBlobs,
|
MissingBlobs,
|
||||||
MissingSyncAggregate,
|
MissingSyncAggregate,
|
||||||
MissingExecutionPayload,
|
MissingExecutionPayload,
|
||||||
MissingExecutionBid,
|
|
||||||
MissingKzgCommitment(String),
|
MissingKzgCommitment(String),
|
||||||
TokioJoin(JoinError),
|
TokioJoin(JoinError),
|
||||||
BeaconChain(Box<BeaconChainError>),
|
BeaconChain(Box<BeaconChainError>),
|
||||||
|
|||||||
@@ -87,7 +87,7 @@ pub fn upgrade_state_to_gloas<E: EthSpec>(
|
|||||||
execution_payload_availability: BitVector::default(), // All bits set to false initially
|
execution_payload_availability: BitVector::default(), // All bits set to false initially
|
||||||
builder_pending_payments: Vector::new(vec![
|
builder_pending_payments: Vector::new(vec![
|
||||||
BuilderPendingPayment::default();
|
BuilderPendingPayment::default();
|
||||||
2 * E::slots_per_epoch() as usize
|
E::builder_pending_withdrawals_limit()
|
||||||
])?,
|
])?,
|
||||||
builder_pending_withdrawals: List::default(), // Empty list initially,
|
builder_pending_withdrawals: List::default(), // Empty list initially,
|
||||||
latest_block_hash: pre.latest_execution_payload_header.block_hash,
|
latest_block_hash: pre.latest_execution_payload_header.block_hash,
|
||||||
|
|||||||
@@ -684,6 +684,7 @@ impl<E: EthSpec, Payload: AbstractExecPayload<E>> EmptyBlock for BeaconBlockGloa
|
|||||||
/// TODO(EIP-7732) Mark's branch had the following implementation but not sure if it's needed so will just add header below for reference
|
/// TODO(EIP-7732) Mark's branch had the following implementation but not sure if it's needed so will just add header below for reference
|
||||||
// impl<E: EthSpec, Payload: AbstractExecPayload<E>> BeaconBlockEIP7732<E, Payload> {
|
// impl<E: EthSpec, Payload: AbstractExecPayload<E>> BeaconBlockEIP7732<E, Payload> {
|
||||||
|
|
||||||
|
// TODO(EIP-7732) Look into whether we can remove this in the future since no blinded blocks post-gloas
|
||||||
impl<E: EthSpec> From<BeaconBlockGloas<E, BlindedPayload<E>>>
|
impl<E: EthSpec> From<BeaconBlockGloas<E, BlindedPayload<E>>>
|
||||||
for BeaconBlockGloas<E, FullPayload<E>>
|
for BeaconBlockGloas<E, FullPayload<E>>
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -170,7 +170,6 @@ impl<'a, E: EthSpec, Payload: AbstractExecPayload<E>> BeaconBlockBodyRef<'a, E,
|
|||||||
Self::Deneb(body) => Ok(Payload::Ref::from(&body.execution_payload)),
|
Self::Deneb(body) => Ok(Payload::Ref::from(&body.execution_payload)),
|
||||||
Self::Electra(body) => Ok(Payload::Ref::from(&body.execution_payload)),
|
Self::Electra(body) => Ok(Payload::Ref::from(&body.execution_payload)),
|
||||||
Self::Fulu(body) => Ok(Payload::Ref::from(&body.execution_payload)),
|
Self::Fulu(body) => Ok(Payload::Ref::from(&body.execution_payload)),
|
||||||
// TODO(eip-7732): idk if this is right there's no more execution payload
|
|
||||||
Self::Gloas(_) => Err(Error::IncorrectStateVariant),
|
Self::Gloas(_) => Err(Error::IncorrectStateVariant),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -229,6 +228,7 @@ impl<'a, E: EthSpec, Payload: AbstractExecPayload<E>> BeaconBlockBodyRef<'a, E,
|
|||||||
|
|
||||||
/// Produces the proof of inclusion for a `KzgCommitment` in `self.blob_kzg_commitments`
|
/// Produces the proof of inclusion for a `KzgCommitment` in `self.blob_kzg_commitments`
|
||||||
/// at `index` using an existing proof for the `blob_kzg_commitments` field.
|
/// at `index` using an existing proof for the `blob_kzg_commitments` field.
|
||||||
|
/// TODO(EIP7732) Investigate calling functions since this will no longer work for glas since no block_kzg_commitments in the body anymore
|
||||||
pub fn complete_kzg_commitment_merkle_proof(
|
pub fn complete_kzg_commitment_merkle_proof(
|
||||||
&self,
|
&self,
|
||||||
index: usize,
|
index: usize,
|
||||||
@@ -240,7 +240,6 @@ impl<'a, E: EthSpec, Payload: AbstractExecPayload<E>> BeaconBlockBodyRef<'a, E,
|
|||||||
| Self::Bellatrix(_)
|
| Self::Bellatrix(_)
|
||||||
| Self::Capella(_)
|
| Self::Capella(_)
|
||||||
| Self::Gloas(_) => Err(Error::IncorrectStateVariant),
|
| Self::Gloas(_) => Err(Error::IncorrectStateVariant),
|
||||||
// TODO(eip-7732): Mark's impl had the Self::EIP-7732 variant below, but I think it should produce error instead since no self.blob_kzg_commitments in BeaconState for gloas
|
|
||||||
Self::Deneb(_) | Self::Electra(_) | Self::Fulu(_) => {
|
Self::Deneb(_) | Self::Electra(_) | Self::Fulu(_) => {
|
||||||
// We compute the branches by generating 2 merkle trees:
|
// We compute the branches by generating 2 merkle trees:
|
||||||
// 1. Merkle tree for the `blob_kzg_commitments` List object
|
// 1. Merkle tree for the `blob_kzg_commitments` List object
|
||||||
@@ -521,6 +520,7 @@ impl<E: EthSpec> From<BeaconBlockBodyAltair<E, BlindedPayload<E>>>
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Post-Fulu block bodies without payloads can be converted into block bodies with payloads
|
// Post-Fulu block bodies without payloads can be converted into block bodies with payloads
|
||||||
|
// TODO(EIP-7732) Look into whether we can remove this in the future since no blinded blocks post-gloas
|
||||||
impl<E: EthSpec> From<BeaconBlockBodyGloas<E, BlindedPayload<E>>>
|
impl<E: EthSpec> From<BeaconBlockBodyGloas<E, BlindedPayload<E>>>
|
||||||
for BeaconBlockBodyGloas<E, FullPayload<E>>
|
for BeaconBlockBodyGloas<E, FullPayload<E>>
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1091,7 +1091,7 @@ impl<E: EthSpec> BeaconState<E> {
|
|||||||
BeaconState::Fulu(state) => Ok(ExecutionPayloadHeaderRef::Fulu(
|
BeaconState::Fulu(state) => Ok(ExecutionPayloadHeaderRef::Fulu(
|
||||||
&state.latest_execution_payload_header,
|
&state.latest_execution_payload_header,
|
||||||
)),
|
)),
|
||||||
// FIXME(EIP-7732): this is only to make the code compile, needs to be written later
|
// TODO(EIP-7732): investigate calling functions
|
||||||
BeaconState::Gloas(_) => Err(Error::IncorrectStateVariant),
|
BeaconState::Gloas(_) => Err(Error::IncorrectStateVariant),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1116,7 +1116,7 @@ impl<E: EthSpec> BeaconState<E> {
|
|||||||
BeaconState::Fulu(state) => Ok(ExecutionPayloadHeaderRefMut::Fulu(
|
BeaconState::Fulu(state) => Ok(ExecutionPayloadHeaderRefMut::Fulu(
|
||||||
&mut state.latest_execution_payload_header,
|
&mut state.latest_execution_payload_header,
|
||||||
)),
|
)),
|
||||||
// FIXME(EIP-7732): this is only to make the code compile, needs to be written later
|
// TODO(EIP-7732): investigate calling functions
|
||||||
BeaconState::Gloas(_) => Err(Error::IncorrectStateVariant),
|
BeaconState::Gloas(_) => Err(Error::IncorrectStateVariant),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1854,7 +1854,6 @@ impl<E: EthSpec> BeaconState<E> {
|
|||||||
| BeaconState::Altair(_)
|
| BeaconState::Altair(_)
|
||||||
| BeaconState::Bellatrix(_)
|
| BeaconState::Bellatrix(_)
|
||||||
| BeaconState::Capella(_) => self.get_validator_churn_limit(spec)?,
|
| BeaconState::Capella(_) => self.get_validator_churn_limit(spec)?,
|
||||||
// FIXME(EIP-7732): check this
|
|
||||||
BeaconState::Deneb(_)
|
BeaconState::Deneb(_)
|
||||||
| BeaconState::Electra(_)
|
| BeaconState::Electra(_)
|
||||||
| BeaconState::Fulu(_)
|
| BeaconState::Fulu(_)
|
||||||
|
|||||||
@@ -512,7 +512,6 @@ impl<'de, E: EthSpec> ContextDeserialize<'de, ForkName> for ExecutionPayloadHead
|
|||||||
Self::Fulu(Deserialize::deserialize(deserializer).map_err(convert_err)?)
|
Self::Fulu(Deserialize::deserialize(deserializer).map_err(convert_err)?)
|
||||||
}
|
}
|
||||||
|
|
||||||
// FIXME(EIP7732): Check this
|
|
||||||
ForkName::Base | ForkName::Altair | ForkName::Gloas => {
|
ForkName::Base | ForkName::Altair | ForkName::Gloas => {
|
||||||
return Err(serde::de::Error::custom(format!(
|
return Err(serde::de::Error::custom(format!(
|
||||||
"ExecutionPayloadHeader failed to deserialize: unsupported fork '{}'",
|
"ExecutionPayloadHeader failed to deserialize: unsupported fork '{}'",
|
||||||
|
|||||||
@@ -649,6 +649,7 @@ impl<E: EthSpec> SignedBeaconBlockFulu<E, BlindedPayload<E>> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// We can convert gloas blocks without payloads into blocks "with" payloads.
|
// We can convert gloas blocks without payloads into blocks "with" payloads.
|
||||||
|
// TODO(EIP-7732) Look into whether we can remove this in the future since no blinded blocks post-gloas
|
||||||
impl<E: EthSpec> From<SignedBeaconBlockGloas<E, BlindedPayload<E>>>
|
impl<E: EthSpec> From<SignedBeaconBlockGloas<E, BlindedPayload<E>>>
|
||||||
for SignedBeaconBlockGloas<E, FullPayload<E>>
|
for SignedBeaconBlockGloas<E, FullPayload<E>>
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user