mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-03 16:51:41 +00:00
Gloas(EIP-7732): Containers / Constants (#7923)
* #7850 This is the first round of the conga line! 🎉 Just spec constants and container changes so far. Co-Authored-By: shane-moore <skm1790@gmail.com> Co-Authored-By: Mark Mackey <mark@sigmaprime.io> Co-Authored-By: Shane K Moore <41407272+shane-moore@users.noreply.github.com> Co-Authored-By: Eitan Seri- Levi <eserilev@gmail.com> Co-Authored-By: ethDreamer <37123614+ethDreamer@users.noreply.github.com> Co-Authored-By: Jimmy Chen <jchen.tc@gmail.com> Co-Authored-By: Jimmy Chen <jimmy@sigmaprime.io> Co-Authored-By: Michael Sproul <michael@sigmaprime.io>
This commit is contained in:
@@ -715,8 +715,9 @@ mod tests {
|
||||
harness
|
||||
}
|
||||
|
||||
// TODO(EIP-7732) Extend this test for gloas
|
||||
#[tokio::test]
|
||||
async fn check_all_blocks_from_altair_to_gloas() {
|
||||
async fn check_all_blocks_from_altair_to_fulu() {
|
||||
let slots_per_epoch = MinimalEthSpec::slots_per_epoch() as usize;
|
||||
let num_epochs = 12;
|
||||
let bellatrix_fork_epoch = 2usize;
|
||||
@@ -724,7 +725,6 @@ mod tests {
|
||||
let deneb_fork_epoch = 6usize;
|
||||
let electra_fork_epoch = 8usize;
|
||||
let fulu_fork_epoch = 10usize;
|
||||
let gloas_fork_epoch = 12usize;
|
||||
let num_blocks_produced = num_epochs * slots_per_epoch;
|
||||
|
||||
let mut spec = test_spec::<MinimalEthSpec>();
|
||||
@@ -734,7 +734,6 @@ mod tests {
|
||||
spec.deneb_fork_epoch = Some(Epoch::new(deneb_fork_epoch as u64));
|
||||
spec.electra_fork_epoch = Some(Epoch::new(electra_fork_epoch as u64));
|
||||
spec.fulu_fork_epoch = Some(Epoch::new(fulu_fork_epoch as u64));
|
||||
spec.gloas_fork_epoch = Some(Epoch::new(gloas_fork_epoch as u64));
|
||||
let spec = Arc::new(spec);
|
||||
|
||||
let harness = get_harness(VALIDATOR_COUNT, spec.clone());
|
||||
|
||||
@@ -5795,60 +5795,7 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
|
||||
execution_payload_value,
|
||||
)
|
||||
}
|
||||
BeaconState::Gloas(_) => {
|
||||
let (
|
||||
payload,
|
||||
kzg_commitments,
|
||||
maybe_blobs_and_proofs,
|
||||
maybe_requests,
|
||||
execution_payload_value,
|
||||
) = block_contents
|
||||
.ok_or(BlockProductionError::MissingExecutionPayload)?
|
||||
.deconstruct();
|
||||
|
||||
(
|
||||
BeaconBlock::Gloas(BeaconBlockGloas {
|
||||
slot,
|
||||
proposer_index,
|
||||
parent_root,
|
||||
state_root: Hash256::zero(),
|
||||
body: BeaconBlockBodyGloas {
|
||||
randao_reveal,
|
||||
eth1_data,
|
||||
graffiti,
|
||||
proposer_slashings: proposer_slashings
|
||||
.try_into()
|
||||
.map_err(BlockProductionError::SszTypesError)?,
|
||||
attester_slashings: attester_slashings_electra
|
||||
.try_into()
|
||||
.map_err(BlockProductionError::SszTypesError)?,
|
||||
attestations: attestations_electra
|
||||
.try_into()
|
||||
.map_err(BlockProductionError::SszTypesError)?,
|
||||
deposits: deposits
|
||||
.try_into()
|
||||
.map_err(BlockProductionError::SszTypesError)?,
|
||||
voluntary_exits: voluntary_exits
|
||||
.try_into()
|
||||
.map_err(BlockProductionError::SszTypesError)?,
|
||||
sync_aggregate: sync_aggregate
|
||||
.ok_or(BlockProductionError::MissingSyncAggregate)?,
|
||||
execution_payload: payload
|
||||
.try_into()
|
||||
.map_err(|_| BlockProductionError::InvalidPayloadFork)?,
|
||||
bls_to_execution_changes: bls_to_execution_changes
|
||||
.try_into()
|
||||
.map_err(BlockProductionError::SszTypesError)?,
|
||||
blob_kzg_commitments: kzg_commitments
|
||||
.ok_or(BlockProductionError::InvalidPayloadFork)?,
|
||||
execution_requests: maybe_requests
|
||||
.ok_or(BlockProductionError::MissingExecutionRequests)?,
|
||||
},
|
||||
}),
|
||||
maybe_blobs_and_proofs,
|
||||
execution_payload_value,
|
||||
)
|
||||
}
|
||||
BeaconState::Gloas(_) => return Err(BlockProductionError::GloasNotImplemented),
|
||||
};
|
||||
|
||||
let block = SignedBeaconBlock::from_block(
|
||||
|
||||
@@ -320,6 +320,8 @@ pub enum BlockProductionError {
|
||||
FailedToBuildBlobSidecars(String),
|
||||
MissingExecutionRequests,
|
||||
SszTypesError(ssz_types::Error),
|
||||
// TODO(gloas): Remove this once Gloas is implemented
|
||||
GloasNotImplemented,
|
||||
}
|
||||
|
||||
easy_from_to!(BlockProcessingError, BlockProductionError);
|
||||
|
||||
@@ -3300,9 +3300,7 @@ pub fn generate_rand_block_and_blobs<E: EthSpec>(
|
||||
SignedBeaconBlock::Fulu(SignedBeaconBlockFulu {
|
||||
ref mut message, ..
|
||||
}) => add_blob_transactions!(message, FullPayloadFulu<E>, num_blobs, rng, fork_name),
|
||||
SignedBeaconBlock::Gloas(SignedBeaconBlockGloas {
|
||||
ref mut message, ..
|
||||
}) => add_blob_transactions!(message, FullPayloadGloas<E>, num_blobs, rng, fork_name),
|
||||
// TODO(EIP-7732) Add `SignedBeaconBlock::Gloas` variant
|
||||
_ => return (block, blob_sidecars),
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user