mirror of
https://github.com/sigp/lighthouse.git
synced 2026-04-16 12:28:24 +00:00
Merge branch 'unstable' of https://github.com/sigp/lighthouse into gloas-block-and-bid-production
This commit is contained in:
@@ -79,6 +79,8 @@ pub struct InactivityUpdates;
|
||||
pub struct ParticipationFlagUpdates;
|
||||
#[derive(Debug)]
|
||||
pub struct ProposerLookahead;
|
||||
#[derive(Debug)]
|
||||
pub struct BuilderPendingPayments;
|
||||
|
||||
type_name!(
|
||||
JustificationAndFinalization,
|
||||
@@ -100,6 +102,7 @@ type_name!(SyncCommitteeUpdates, "sync_committee_updates");
|
||||
type_name!(InactivityUpdates, "inactivity_updates");
|
||||
type_name!(ParticipationFlagUpdates, "participation_flag_updates");
|
||||
type_name!(ProposerLookahead, "proposer_lookahead");
|
||||
type_name!(BuilderPendingPayments, "builder_pending_payments");
|
||||
|
||||
impl<E: EthSpec> EpochTransition<E> for JustificationAndFinalization {
|
||||
fn run(state: &mut BeaconState<E>, spec: &ChainSpec) -> Result<(), EpochProcessingError> {
|
||||
@@ -293,6 +296,20 @@ impl<E: EthSpec> EpochTransition<E> for ProposerLookahead {
|
||||
}
|
||||
}
|
||||
|
||||
impl<E: EthSpec> EpochTransition<E> for BuilderPendingPayments {
|
||||
fn run(state: &mut BeaconState<E>, spec: &ChainSpec) -> Result<(), EpochProcessingError> {
|
||||
process_epoch_single_pass(
|
||||
state,
|
||||
spec,
|
||||
SinglePassConfig {
|
||||
builder_pending_payments: true,
|
||||
..SinglePassConfig::disable_all()
|
||||
},
|
||||
)
|
||||
.map(|_| ())
|
||||
}
|
||||
}
|
||||
|
||||
impl<E: EthSpec, T: EpochTransition<E>> LoadCase for EpochProcessing<E, T> {
|
||||
fn load_from_dir(path: &Path, fork_name: ForkName) -> Result<Self, Error> {
|
||||
let spec = &testing_spec::<E>(fork_name);
|
||||
@@ -356,6 +373,10 @@ impl<E: EthSpec, T: EpochTransition<E>> Case for EpochProcessing<E, T> {
|
||||
return false;
|
||||
}
|
||||
|
||||
if !fork_name.gloas_enabled() && T::name() == "builder_pending_payments" {
|
||||
return false;
|
||||
}
|
||||
|
||||
true
|
||||
}
|
||||
|
||||
|
||||
@@ -448,7 +448,7 @@ impl<E: EthSpec> Tester<E> {
|
||||
.spec(spec.clone())
|
||||
.keypairs(vec![])
|
||||
.chain_config(ChainConfig {
|
||||
reconstruct_historic_states: true,
|
||||
archive: true,
|
||||
..ChainConfig::default()
|
||||
})
|
||||
.genesis_state_ephemeral_store(case.anchor_state.clone())
|
||||
|
||||
@@ -17,7 +17,7 @@ use state_processing::{
|
||||
per_block_processing::{
|
||||
VerifyBlockRoot, VerifySignatures,
|
||||
errors::BlockProcessingError,
|
||||
process_block_header, process_execution_payload,
|
||||
process_block_header, process_execution_payload, process_execution_payload_bid,
|
||||
process_operations::{
|
||||
altair_deneb, base, gloas, process_attester_slashings,
|
||||
process_bls_to_execution_changes, process_deposits, process_exits,
|
||||
@@ -52,6 +52,12 @@ pub struct WithdrawalsPayload<E: EthSpec> {
|
||||
payload: Option<ExecutionPayload<E>>,
|
||||
}
|
||||
|
||||
/// Newtype for testing execution payload bids.
|
||||
#[derive(Debug, Clone, Deserialize)]
|
||||
pub struct ExecutionPayloadBidBlock<E: EthSpec> {
|
||||
block: BeaconBlock<E>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct Operations<E: EthSpec, O: Operation<E>> {
|
||||
metadata: Metadata,
|
||||
@@ -467,6 +473,37 @@ impl<E: EthSpec> Operation<E> for SignedExecutionPayloadEnvelope<E> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<E: EthSpec> Operation<E> for ExecutionPayloadBidBlock<E> {
|
||||
type Error = BlockProcessingError;
|
||||
|
||||
fn handler_name() -> String {
|
||||
"execution_payload_bid".into()
|
||||
}
|
||||
|
||||
fn filename() -> String {
|
||||
"block.ssz_snappy".into()
|
||||
}
|
||||
|
||||
fn is_enabled_for_fork(fork_name: ForkName) -> bool {
|
||||
fork_name.gloas_enabled()
|
||||
}
|
||||
|
||||
fn decode(path: &Path, _fork_name: ForkName, spec: &ChainSpec) -> Result<Self, Error> {
|
||||
ssz_decode_file_with(path, |bytes| BeaconBlock::from_ssz_bytes(bytes, spec))
|
||||
.map(|block| ExecutionPayloadBidBlock { block })
|
||||
}
|
||||
|
||||
fn apply_to(
|
||||
&self,
|
||||
state: &mut BeaconState<E>,
|
||||
spec: &ChainSpec,
|
||||
_: &Operations<E, Self>,
|
||||
) -> Result<(), BlockProcessingError> {
|
||||
process_execution_payload_bid(state, self.block.to_ref(), VerifySignatures::True, spec)?;
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
impl<E: EthSpec> Operation<E> for WithdrawalsPayload<E> {
|
||||
type Error = BlockProcessingError;
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ pub trait Handler {
|
||||
// Add forks here to exclude them from EF spec testing. Helpful for adding future or
|
||||
// unspecified forks.
|
||||
fn disabled_forks(&self) -> Vec<ForkName> {
|
||||
vec![ForkName::Gloas]
|
||||
vec![]
|
||||
}
|
||||
|
||||
fn is_enabled_for_fork(&self, fork_name: ForkName) -> bool {
|
||||
@@ -395,11 +395,6 @@ where
|
||||
T::name().into()
|
||||
}
|
||||
|
||||
fn disabled_forks(&self) -> Vec<ForkName> {
|
||||
// TODO(gloas): Can be removed once we enable Gloas on all tests
|
||||
vec![]
|
||||
}
|
||||
|
||||
fn is_enabled_for_fork(&self, fork_name: ForkName) -> bool {
|
||||
self.supported_forks.contains(&fork_name)
|
||||
}
|
||||
@@ -422,11 +417,6 @@ where
|
||||
fn handler_name(&self) -> String {
|
||||
BeaconState::<E>::name().into()
|
||||
}
|
||||
|
||||
fn disabled_forks(&self) -> Vec<ForkName> {
|
||||
// TODO(gloas): Can be removed once we enable Gloas on all tests
|
||||
vec![]
|
||||
}
|
||||
}
|
||||
|
||||
impl<T, E> Handler for SszStaticWithSpecHandler<T, E>
|
||||
@@ -449,11 +439,6 @@ where
|
||||
T::name().into()
|
||||
}
|
||||
|
||||
fn disabled_forks(&self) -> Vec<ForkName> {
|
||||
// TODO(gloas): Can be removed once we enable Gloas on all tests
|
||||
vec![]
|
||||
}
|
||||
|
||||
fn is_enabled_for_fork(&self, fork_name: ForkName) -> bool {
|
||||
self.supported_forks.contains(&fork_name)
|
||||
}
|
||||
@@ -552,6 +537,11 @@ impl<E: EthSpec + TypeName> Handler for RandomHandler<E> {
|
||||
fn handler_name(&self) -> String {
|
||||
"random".into()
|
||||
}
|
||||
|
||||
fn disabled_forks(&self) -> Vec<ForkName> {
|
||||
// TODO(gloas): remove once we have Gloas random tests
|
||||
vec![ForkName::Gloas]
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Educe)]
|
||||
@@ -622,6 +612,11 @@ impl<E: EthSpec + TypeName> Handler for ForkHandler<E> {
|
||||
fn handler_name(&self) -> String {
|
||||
"fork".into()
|
||||
}
|
||||
|
||||
fn disabled_forks(&self) -> Vec<ForkName> {
|
||||
// TODO(gloas): remove once onboard_builders_from_pending_deposits is implemented
|
||||
vec![ForkName::Gloas]
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Educe)]
|
||||
@@ -726,6 +721,11 @@ impl<E: EthSpec + TypeName> Handler for ForkChoiceHandler<E> {
|
||||
// run them with fake crypto.
|
||||
cfg!(not(feature = "fake_crypto"))
|
||||
}
|
||||
|
||||
fn disabled_forks(&self) -> Vec<ForkName> {
|
||||
// TODO(gloas): remove once we have Gloas fork choice tests
|
||||
vec![ForkName::Gloas]
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Educe)]
|
||||
@@ -755,6 +755,11 @@ impl<E: EthSpec + TypeName> Handler for OptimisticSyncHandler<E> {
|
||||
fn is_enabled_for_fork(&self, fork_name: ForkName) -> bool {
|
||||
fork_name.bellatrix_enabled() && cfg!(not(feature = "fake_crypto"))
|
||||
}
|
||||
|
||||
fn disabled_forks(&self) -> Vec<ForkName> {
|
||||
// TODO(gloas): remove once we have Gloas optimistic sync tests
|
||||
vec![ForkName::Gloas]
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Educe)]
|
||||
@@ -975,6 +980,11 @@ impl<E: EthSpec> Handler for KZGComputeCellsHandler<E> {
|
||||
fn handler_name(&self) -> String {
|
||||
"compute_cells".into()
|
||||
}
|
||||
|
||||
fn disabled_forks(&self) -> Vec<ForkName> {
|
||||
// TODO(gloas): remove once we have Gloas KZG tests
|
||||
vec![ForkName::Gloas]
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Educe)]
|
||||
@@ -995,6 +1005,11 @@ impl<E: EthSpec> Handler for KZGComputeCellsAndKZGProofHandler<E> {
|
||||
fn handler_name(&self) -> String {
|
||||
"compute_cells_and_kzg_proofs".into()
|
||||
}
|
||||
|
||||
fn disabled_forks(&self) -> Vec<ForkName> {
|
||||
// TODO(gloas): remove once we have Gloas KZG tests
|
||||
vec![ForkName::Gloas]
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Educe)]
|
||||
@@ -1015,6 +1030,11 @@ impl<E: EthSpec> Handler for KZGVerifyCellKZGProofBatchHandler<E> {
|
||||
fn handler_name(&self) -> String {
|
||||
"verify_cell_kzg_proof_batch".into()
|
||||
}
|
||||
|
||||
fn disabled_forks(&self) -> Vec<ForkName> {
|
||||
// TODO(gloas): remove once we have Gloas KZG tests
|
||||
vec![ForkName::Gloas]
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Educe)]
|
||||
@@ -1035,6 +1055,11 @@ impl<E: EthSpec> Handler for KZGRecoverCellsAndKZGProofHandler<E> {
|
||||
fn handler_name(&self) -> String {
|
||||
"recover_cells_and_kzg_proofs".into()
|
||||
}
|
||||
|
||||
fn disabled_forks(&self) -> Vec<ForkName> {
|
||||
// TODO(gloas): remove once we have Gloas KZG tests
|
||||
vec![ForkName::Gloas]
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Educe)]
|
||||
@@ -1059,6 +1084,11 @@ impl<E: EthSpec + TypeName> Handler for KzgInclusionMerkleProofValidityHandler<E
|
||||
fn is_enabled_for_fork(&self, fork_name: ForkName) -> bool {
|
||||
fork_name.deneb_enabled()
|
||||
}
|
||||
|
||||
fn disabled_forks(&self) -> Vec<ForkName> {
|
||||
// TODO(gloas): remove once we have Gloas KZG merkle proof tests
|
||||
vec![ForkName::Gloas]
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Educe)]
|
||||
@@ -1083,6 +1113,11 @@ impl<E: EthSpec + TypeName> Handler for MerkleProofValidityHandler<E> {
|
||||
fn is_enabled_for_fork(&self, fork_name: ForkName) -> bool {
|
||||
fork_name.altair_enabled()
|
||||
}
|
||||
|
||||
fn disabled_forks(&self) -> Vec<ForkName> {
|
||||
// TODO(gloas): remove once we have Gloas light client tests
|
||||
vec![ForkName::Gloas]
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Educe)]
|
||||
@@ -1108,6 +1143,11 @@ impl<E: EthSpec + TypeName> Handler for LightClientUpdateHandler<E> {
|
||||
// Enabled in Altair
|
||||
fork_name.altair_enabled()
|
||||
}
|
||||
|
||||
fn disabled_forks(&self) -> Vec<ForkName> {
|
||||
// TODO(gloas): remove once we have Gloas light client tests
|
||||
vec![ForkName::Gloas]
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Educe)]
|
||||
@@ -1129,21 +1169,18 @@ impl<E: EthSpec + TypeName, O: Operation<E>> Handler for OperationsHandler<E, O>
|
||||
O::handler_name()
|
||||
}
|
||||
|
||||
fn disabled_forks(&self) -> Vec<ForkName> {
|
||||
// TODO(gloas): Can be removed once we enable Gloas on all tests
|
||||
vec![]
|
||||
}
|
||||
|
||||
fn is_enabled_for_fork(&self, fork_name: ForkName) -> bool {
|
||||
Self::Case::is_enabled_for_fork(fork_name)
|
||||
&& (!fork_name.gloas_enabled()
|
||||
|| self.handler_name() == "attestation"
|
||||
|| self.handler_name() == "attester_slashing"
|
||||
|| self.handler_name() == "block_header"
|
||||
|| self.handler_name() == "bls_to_execution_change"
|
||||
|| self.handler_name() == "consolidation_request"
|
||||
|| self.handler_name() == "deposit_request"
|
||||
|| self.handler_name() == "deposit"
|
||||
|| self.handler_name() == "execution_payload"
|
||||
|| self.handler_name() == "execution_payload_bid"
|
||||
|| self.handler_name() == "proposer_slashing"
|
||||
|| self.handler_name() == "sync_aggregate"
|
||||
|| self.handler_name() == "withdrawal_request"
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
pub use case_result::CaseResult;
|
||||
pub use cases::WithdrawalsPayload;
|
||||
pub use cases::{
|
||||
Case, EffectiveBalanceUpdates, Eth1DataReset, FeatureName, HistoricalRootsUpdate,
|
||||
HistoricalSummariesUpdate, InactivityUpdates, JustificationAndFinalization,
|
||||
ParticipationFlagUpdates, ParticipationRecordUpdates, PendingBalanceDeposits,
|
||||
PendingConsolidations, ProposerLookahead, RandaoMixesReset, RegistryUpdates,
|
||||
RewardsAndPenalties, Slashings, SlashingsReset, SyncCommitteeUpdates,
|
||||
BuilderPendingPayments, Case, EffectiveBalanceUpdates, Eth1DataReset, ExecutionPayloadBidBlock,
|
||||
FeatureName, HistoricalRootsUpdate, HistoricalSummariesUpdate, InactivityUpdates,
|
||||
JustificationAndFinalization, ParticipationFlagUpdates, ParticipationRecordUpdates,
|
||||
PendingBalanceDeposits, PendingConsolidations, ProposerLookahead, RandaoMixesReset,
|
||||
RegistryUpdates, RewardsAndPenalties, Slashings, SlashingsReset, SyncCommitteeUpdates,
|
||||
WithdrawalsPayload,
|
||||
};
|
||||
pub use decode::log_file_access;
|
||||
pub use error::Error;
|
||||
|
||||
Reference in New Issue
Block a user