mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-03 00:31:50 +00:00
Gloas payload bid consensus (#8801)
- [x] Consensus changes for execution payload bids - [x] EF tests for bids (and `block_header` -- no changes required). Co-Authored-By: Michael Sproul <michael@sigmaprime.io>
This commit is contained in:
@@ -48,8 +48,6 @@ excluded_paths = [
|
||||
"tests/.*/eip7732",
|
||||
"tests/.*/eip7805",
|
||||
# TODO(gloas): remove these ignores as more Gloas operations are implemented
|
||||
"tests/.*/gloas/operations/block_header/.*",
|
||||
"tests/.*/gloas/operations/execution_payload_bid/.*",
|
||||
"tests/.*/gloas/operations/payload_attestation/.*",
|
||||
# TODO(EIP-7732): remove these ignores as Gloas consensus is implemented
|
||||
"tests/.*/gloas/epoch_processing/.*",
|
||||
|
||||
@@ -16,7 +16,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,
|
||||
@@ -51,6 +51,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,
|
||||
@@ -459,6 +465,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;
|
||||
|
||||
|
||||
@@ -1139,11 +1139,13 @@ impl<E: EthSpec + TypeName, O: Operation<E>> Handler for OperationsHandler<E, O>
|
||||
&& (!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,
|
||||
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;
|
||||
|
||||
@@ -93,6 +93,12 @@ fn operations_execution_payload_envelope() {
|
||||
OperationsHandler::<MainnetEthSpec, SignedExecutionPayloadEnvelope<_>>::default().run();
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn operations_execution_payload_bid() {
|
||||
OperationsHandler::<MinimalEthSpec, ExecutionPayloadBidBlock<_>>::default().run();
|
||||
OperationsHandler::<MainnetEthSpec, ExecutionPayloadBidBlock<_>>::default().run();
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn operations_withdrawals() {
|
||||
OperationsHandler::<MinimalEthSpec, WithdrawalsPayload<_>>::default().run();
|
||||
|
||||
Reference in New Issue
Block a user