Electra engine api (#5743)

* Attestation superstruct changes for EIP 7549 (#5644)

* update

* experiment

* superstruct changes

* revert

* superstruct changes

* fix tests

* indexed attestation

* indexed attestation superstruct

* updated TODOs

* `superstruct` the `AttesterSlashing` (#5636)

* `superstruct` Attester Fork Variants

* Push a little further

* Deal with Encode / Decode of AttesterSlashing

* not so sure about this..

* Stop Encode/Decode Bounds from Propagating Out

* Tons of Changes..

* More Conversions to AttestationRef

* Add AsReference trait (#15)

* Add AsReference trait

* Fix some snafus

* Got it Compiling! :D

* Got Tests Building

* Get beacon chain tests compiling

---------

Co-authored-by: Michael Sproul <micsproul@gmail.com>

* Merge remote-tracking branch 'upstream/unstable' into electra_attestation_changes

* Make EF Tests Fork-Agnostic (#5713)

* Finish EF Test Fork Agnostic (#5714)

* Superstruct `AggregateAndProof` (#5715)

* Upgrade `superstruct` to `0.8.0`

* superstruct `AggregateAndProof`

* Merge remote-tracking branch 'sigp/unstable' into electra_attestation_changes

* cargo fmt

* Merge pull request #5726 from realbigsean/electra_attestation_changes

Merge unstable into Electra attestation changes

* process withdrawals updates

* cleanup withdrawals processing

* update `process_operations` deposit length check

* add apply_deposit changes

* add execution layer withdrawal request processing

* process deposit receipts

* add consolidation processing

* update process operations function

* exit updates

* clean up

* update slash_validator

* EIP7549 `get_attestation_indices` (#5657)

* get attesting indices electra impl

* fmt

* get tests to pass

* fmt

* fix some beacon chain tests

* fmt

* fix slasher test

* fmt got me again

* fix more tests

* fix tests

* Some small changes (#5739)

* Merge branch 'electra_attestation_changes' of https://github.com/sigp/lighthouse into block-processing-electra

* cargo fmt (#5740)

* Merge branch 'electra_attestation_changes' of https://github.com/sigp/lighthouse into block-processing-electra

* fix attestation verification

* Add new engine api methods

* Fix the versioning of v4 requests

* Handle new engine api methods in mock EL

* Note todo

* Fix todos

* Add support for electra fields in getPayloadBodies

* Add comments for potential versioning confusion

* Sketch op pool changes

* fix get attesting indices (#5742)

* fix get attesting indices

* better errors

* fix compile

* only get committee index once

* Merge branch 'electra_attestation_changes' of https://github.com/sigp/lighthouse into block-processing-electra

* Ef test fixes (#5753)

* attestation related ef test fixes

* delete commented out stuff

* Merge branch 'electra_attestation_changes' of https://github.com/sigp/lighthouse into block-processing-electra

* Merge branch 'block-processing-electra' of https://github.com/sigp/lighthouse into electra-engine-api

* Fix Aggregation Pool for Electra (#5754)

* Fix Aggregation Pool for Electra

* Remove Outdated Interface

* fix ssz (#5755)

* Get `electra_op_pool` up to date (#5756)

* fix get attesting indices (#5742)

* fix get attesting indices

* better errors

* fix compile

* only get committee index once

* Ef test fixes (#5753)

* attestation related ef test fixes

* delete commented out stuff

* Fix Aggregation Pool for Electra (#5754)

* Fix Aggregation Pool for Electra

* Remove Outdated Interface

* fix ssz (#5755)

---------

Co-authored-by: realbigsean <sean@sigmaprime.io>

* Revert "Get `electra_op_pool` up to date (#5756)" (#5757)

This reverts commit ab9e58aa3d.

* Merge branch 'electra_attestation_changes' of https://github.com/sigp/lighthouse into electra_op_pool

* Merge branch 'electra_attestation_changes' of https://github.com/sigp/lighthouse into block-processing-electra

* Merge branch 'block-processing-electra' of https://github.com/sigp/lighthouse into electra-engine-api

* Compute on chain aggregate impl (#5752)

* add compute_on_chain_agg impl to op pool changes

* fmt

* get op pool tests to pass

* update the naive agg pool interface (#5760)

* Merge branch 'electra_attestation_changes' of https://github.com/sigp/lighthouse into block-processing-electra

* Merge branch 'block-processing-electra' of https://github.com/sigp/lighthouse into electra-engine-api

* Fix bugs in cross-committee aggregation

* Add comment to max cover optimisation

* Fix assert

* Electra epoch processing

* Merge branch 'electra-epoch-proc' of https://github.com/sigp/lighthouse into electra-engine-api

* Merge pull request #5749 from sigp/electra_op_pool

Optimise Electra op pool aggregation

* don't fail on empty consolidations

* Merge branch 'electra_attestation_changes' of https://github.com/sigp/lighthouse into block-processing-electra

* Merge branch 'block-processing-electra' of https://github.com/sigp/lighthouse into electra-epoch-proc

* Merge branch 'electra-epoch-proc' of https://github.com/sigp/lighthouse into electra-engine-api

* update committee offset

* Merge branch 'electra_attestation_changes' of https://github.com/sigp/lighthouse into block-processing-electra

* update committee offset

* update committee offset

* only increment the state deposit index on old deposit flow

* Merge branch 'block-processing-electra' of https://github.com/sigp/lighthouse into electra-epoch-proc

* Merge branch 'electra-epoch-proc' of https://github.com/sigp/lighthouse into electra-engine-api

* use correct max eb in epoch cache initialization

* drop initiate validator ordering optimization

* fix initiate exit for single pass

* Merge branch 'electra-epoch-proc' of https://github.com/sigp/lighthouse into electra-engine-api

* accept new payload v4 in mock el

* Fix Electra Fork Choice Tests (#5764)

* Fix Electra Fork Choice Tests (#5764)

* Fix Electra Fork Choice Tests (#5764)

* Merge branch 'electra_attestation_changes' of https://github.com/sigp/lighthouse into block-processing-electra

* Merge branch 'block-processing-electra' of https://github.com/sigp/lighthouse into electra-epoch-proc

* Merge branch 'electra-epoch-proc' of https://github.com/sigp/lighthouse into electra-engine-api

* Fix Consolidation Sigs & Withdrawals

* Merge pull request #5766 from ethDreamer/two_fixes

Fix Consolidation Sigs & Withdrawals

* Merge branches 'block-processing-electra' and 'electra-epoch-proc' of https://github.com/sigp/lighthouse into electra-epoch-proc

* Merge branch 'electra-epoch-proc' of https://github.com/sigp/lighthouse into electra-engine-api

* Fix ser/de

* Subscribe to the correct subnets for electra attestations (#5782)

* subscribe to the correct att subnets for electra

* subscribe to the correct att subnets for electra

* cargo fmt

* Subscribe to the correct subnets for electra attestations (#5782)

* subscribe to the correct att subnets for electra

* subscribe to the correct att subnets for electra

* cargo fmt

* Subscribe to the correct subnets for electra attestations (#5782)

* subscribe to the correct att subnets for electra

* subscribe to the correct att subnets for electra

* cargo fmt

* Subscribe to the correct subnets for electra attestations (#5782)

* subscribe to the correct att subnets for electra

* subscribe to the correct att subnets for electra

* cargo fmt

* update electra readiness with new endpoints

* fix slashing handling

* Fix Bug In Block Processing with 0x02 Credentials

* Merge remote-tracking branch 'upstream/unstable'

* Send unagg attestation based on fork

* Publish all aggregates

* just one more check bro plz..

* Merge pull request #5832 from ethDreamer/electra_attestation_changes_merge_unstable

Merge `unstable` into `electra_attestation_changes`

* Merge pull request #5835 from realbigsean/fix-validator-logic

Fix validator logic

* Merge pull request #5816 from realbigsean/electra-attestation-slashing-handling

Electra slashing handling

* Merge branch 'electra_attestation_changes' of https://github.com/sigp/lighthouse into block-processing-electra

* Merge branch 'block-processing-electra' of https://github.com/sigp/lighthouse into electra-epoch-proc

* Merge branch 'electra-epoch-proc' of https://github.com/sigp/lighthouse into electra-engine-api

* fix: serde rename camle case for execution payload body (#5846)

* Electra attestation changes rm decode impl (#5856)

* Remove Crappy Decode impl for Attestation

* Remove Inefficient Attestation Decode impl

* Implement Schema Upgrade / Downgrade

* Update beacon_node/beacon_chain/src/schema_change/migration_schema_v20.rs

Co-authored-by: Michael Sproul <micsproul@gmail.com>

---------

Co-authored-by: Michael Sproul <micsproul@gmail.com>

* Fix failing attestation tests and misc electra attestation cleanup (#5810)

* - get attestation related beacon chain tests to pass
- observed attestations are now keyed off of data + committee index
- rename op pool attestationref to compactattestationref
- remove unwraps in agg pool and use options instead
- cherry pick some changes from ef-tests-electra

* cargo fmt

* fix failing test

* Revert dockerfile changes

* make committee_index return option

* function args shouldnt be a ref to attestation ref

* fmt

* fix dup imports

---------

Co-authored-by: realbigsean <seananderson33@GMAIL.com>

* fix some todos (#5817)

* Merge branch 'unstable' of https://github.com/sigp/lighthouse into electra_attestation_changes

* add consolidations to merkle calc for inclusion proof

* Merge branch 'electra_attestation_changes' of https://github.com/sigp/lighthouse into block-processing-electra

* Merge branch 'block-processing-electra' of https://github.com/sigp/lighthouse into electra-epoch-proc

* Merge branch 'electra-epoch-proc' of https://github.com/sigp/lighthouse into electra-engine-api

* Remove Duplicate KZG Commitment Merkle Proof Code (#5874)

* Remove Duplicate KZG Commitment Merkle Proof Code

* s/tree_lists/fields/

* Merge branch 'unstable' of https://github.com/sigp/lighthouse into electra_attestation_changes

* Merge branch 'electra_attestation_changes' of https://github.com/sigp/lighthouse into block-processing-electra

* Merge branch 'block-processing-electra' of https://github.com/sigp/lighthouse into electra-epoch-proc

* Merge branch 'electra-epoch-proc' of https://github.com/sigp/lighthouse into electra-engine-api

* fix compile

* Merge branch 'electra_attestation_changes' of https://github.com/sigp/lighthouse into block-processing-electra

* Merge branch 'block-processing-electra' of https://github.com/sigp/lighthouse into electra-epoch-proc

* Merge branch 'electra-epoch-proc' of https://github.com/sigp/lighthouse into electra-engine-api

* Fix slasher tests (#5906)

* Fix electra tests

* Add electra attestations to double vote tests

* Update superstruct to 0.8

* Merge remote-tracking branch 'origin/unstable' into electra_attestation_changes

* Small cleanup in slasher tests

* Clean up Electra observed aggregates (#5929)

* Use consistent key in observed_attestations

* Remove unwraps from observed aggregates

* Merge branch 'unstable' of https://github.com/sigp/lighthouse into electra_attestation_changes

* De-dup attestation constructor logic

* Remove unwraps in Attestation construction

* Dedup match_attestation_data

* Remove outdated TODO

* Use ForkName Ord in fork-choice tests

* Use ForkName Ord in BeaconBlockBody

* Make to_electra not fallible

* Remove TestRandom impl for IndexedAttestation

* Remove IndexedAttestation faulty Decode impl

* Drop TestRandom impl

* Add PendingAttestationInElectra

* Indexed att on disk (#35)

* indexed att on disk

* fix lints

* Update slasher/src/migrate.rs

Co-authored-by: ethDreamer <37123614+ethDreamer@users.noreply.github.com>

---------

Co-authored-by: Lion - dapplion <35266934+dapplion@users.noreply.github.com>
Co-authored-by: ethDreamer <37123614+ethDreamer@users.noreply.github.com>

* add electra fork enabled fn to ForkName impl (#36)

* add electra fork enabled fn to ForkName impl

* remove inadvertent file

* Update common/eth2/src/types.rs

Co-authored-by: ethDreamer <37123614+ethDreamer@users.noreply.github.com>

* Dedup attestation constructor logic in attester cache

* Use if let Ok for committee_bits

* Dedup Attestation constructor code

* Diff reduction in tests

* Fix beacon_chain tests

* Diff reduction

* Use Ord for ForkName in pubsub

* Resolve into_attestation_and_indices todo

* Remove stale TODO

* Fix beacon_chain tests

* Test spec invariant

* Use electra_enabled in pubsub

* Remove get_indexed_attestation_from_signed_aggregate

* Use ok_or instead of if let else

* committees are sorted

* remove dup method `get_indexed_attestation_from_committees`

* Merge pull request #5940 from dapplion/electra_attestation_changes_lionreview

Electra attestations #5712 review

* update default persisted op pool deserialization

* ensure aggregate and proof uses serde untagged on ref

* Fork aware ssz static attestation tests

* Electra attestation changes from Lions review (#5971)

* dedup/cleanup and remove unneeded hashset use

* remove irrelevant TODOs

* Merge branch 'unstable' of https://github.com/sigp/lighthouse into electra_attestation_changes

* Merge branch 'electra_attestation_changes' of https://github.com/sigp/lighthouse into block-processing-electra

* Merge branch 'block-processing-electra' of https://github.com/sigp/lighthouse into electra-epoch-proc

* Merge branch 'electra-epoch-proc' of https://github.com/sigp/lighthouse into electra-engine-api

* Electra attestation changes sean review (#5972)

* instantiate empty bitlist in unreachable code

* clean up error conversion

* fork enabled bool cleanup

* remove a couple todos

* return bools instead of options in `aggregate` and use the result

* delete commented out code

* use map macros in simple transformations

* remove signers_disjoint_from

* get ef tests compiling

* get ef tests compiling

* update intentionally excluded files

* Avoid changing slasher schema for Electra

* Delete slasher schema v4

* Fix clippy

* Fix compilation of beacon_chain tests

* Update database.rs

* Update per_block_processing.rs

* Add electra lightclient types

* Update slasher/src/database.rs

* fix imports

* Merge pull request #5980 from dapplion/electra-lightclient

Add electra lightclient types

* Merge pull request #5975 from michaelsproul/electra-slasher-no-migration

Avoid changing slasher schema for Electra

* Update beacon_node/beacon_chain/src/attestation_verification.rs

* Update beacon_node/beacon_chain/src/attestation_verification.rs

* Merge branch 'unstable' of https://github.com/sigp/lighthouse into electra_attestation_changes

* Merge branch 'electra_attestation_changes' of https://github.com/realbigsean/lighthouse into block-processing-electra

* Merge branch 'block-processing-electra' of https://github.com/sigp/lighthouse into electra-epoch-proc

* Merge branch 'electra-epoch-proc' of https://github.com/sigp/lighthouse into electra-engine-api

* The great renaming receipt -> request

* Address some more review comments

* Merge branch 'unstable' of https://github.com/sigp/lighthouse into electra-engine-api

* Update beacon_node/beacon_chain/src/electra_readiness.rs

* Update consensus/types/src/chain_spec.rs
This commit is contained in:
Pawan Dhananjay
2024-07-01 09:33:55 -07:00
committed by GitHub
parent 3f2af5cf80
commit 2a13b4f3fa
25 changed files with 361 additions and 114 deletions

View File

@@ -481,7 +481,7 @@ where
#[superstruct(only(Electra), partial_getter(copy))]
#[metastruct(exclude_from(tree_lists))]
#[serde(with = "serde_utils::quoted_u64")]
pub deposit_receipts_start_index: u64,
pub deposit_requests_start_index: u64,
#[superstruct(only(Electra), partial_getter(copy))]
#[metastruct(exclude_from(tree_lists))]
#[serde(with = "serde_utils::quoted_u64")]

View File

@@ -180,7 +180,7 @@ pub struct ChainSpec {
pub electra_fork_version: [u8; 4],
/// The Electra fork epoch is optional, with `None` representing "Electra never happens".
pub electra_fork_epoch: Option<Epoch>,
pub unset_deposit_receipts_start_index: u64,
pub unset_deposit_requests_start_index: u64,
pub full_exit_request_amount: u64,
pub min_activation_balance: u64,
pub max_effective_balance_electra: u64,
@@ -747,7 +747,7 @@ impl ChainSpec {
*/
electra_fork_version: [0x05, 00, 00, 00],
electra_fork_epoch: None,
unset_deposit_receipts_start_index: u64::MAX,
unset_deposit_requests_start_index: u64::MAX,
full_exit_request_amount: 0,
min_activation_balance: option_wrapper(|| {
u64::checked_pow(2, 5)?.checked_mul(u64::checked_pow(10, 9)?)
@@ -1049,7 +1049,7 @@ impl ChainSpec {
*/
electra_fork_version: [0x05, 0x00, 0x00, 0x64],
electra_fork_epoch: None,
unset_deposit_receipts_start_index: u64::MAX,
unset_deposit_requests_start_index: u64::MAX,
full_exit_request_amount: 0,
min_activation_balance: option_wrapper(|| {
u64::checked_pow(2, 5)?.checked_mul(u64::checked_pow(10, 9)?)

View File

@@ -124,7 +124,7 @@ pub fn get_extra_fields(spec: &ChainSpec) -> HashMap<String, Value> {
"versioned_hash_version_kzg".to_uppercase() => deneb::VERSIONED_HASH_VERSION_KZG.to_string().into(),
// Electra
"compounding_withdrawal_prefix".to_uppercase() => u8_hex(spec.compounding_withdrawal_prefix_byte),
"unset_deposit_receipts_start_index".to_uppercase() => spec.unset_deposit_receipts_start_index.to_string().into(),
"unset_deposit_requests_start_index".to_uppercase() => spec.unset_deposit_requests_start_index.to_string().into(),
"full_exit_request_amount".to_uppercase() => spec.full_exit_request_amount.to_string().into(),
"domain_consolidation".to_uppercase()=> u32_hex(spec.domain_consolidation),
}

View File

@@ -19,7 +19,7 @@ use tree_hash_derive::TreeHash;
TreeHash,
TestRandom,
)]
pub struct DepositReceipt {
pub struct DepositRequest {
pub pubkey: PublicKeyBytes,
pub withdrawal_credentials: Hash256,
#[serde(with = "serde_utils::quoted_u64")]
@@ -33,5 +33,5 @@ pub struct DepositReceipt {
mod tests {
use super::*;
ssz_and_tree_hash_tests!(DepositReceipt);
ssz_and_tree_hash_tests!(DepositRequest);
}

View File

@@ -144,7 +144,7 @@ pub trait EthSpec:
type PendingPartialWithdrawalsLimit: Unsigned + Clone + Sync + Send + Debug + PartialEq;
type PendingConsolidationsLimit: Unsigned + Clone + Sync + Send + Debug + PartialEq;
type MaxConsolidations: Unsigned + Clone + Sync + Send + Debug + PartialEq;
type MaxDepositReceiptsPerPayload: Unsigned + Clone + Sync + Send + Debug + PartialEq;
type MaxDepositRequestsPerPayload: Unsigned + Clone + Sync + Send + Debug + PartialEq;
type MaxAttesterSlashingsElectra: Unsigned + Clone + Sync + Send + Debug + PartialEq;
type MaxAttestationsElectra: Unsigned + Clone + Sync + Send + Debug + PartialEq;
type MaxWithdrawalRequestsPerPayload: Unsigned + Clone + Sync + Send + Debug + PartialEq;
@@ -330,9 +330,9 @@ pub trait EthSpec:
Self::MaxConsolidations::to_usize()
}
/// Returns the `MAX_DEPOSIT_RECEIPTS_PER_PAYLOAD` constant for this specification.
fn max_deposit_receipts_per_payload() -> usize {
Self::MaxDepositReceiptsPerPayload::to_usize()
/// Returns the `MAX_DEPOSIT_REQUESTS_PER_PAYLOAD` constant for this specification.
fn max_deposit_requests_per_payload() -> usize {
Self::MaxDepositRequestsPerPayload::to_usize()
}
/// Returns the `MAX_ATTESTER_SLASHINGS_ELECTRA` constant for this specification.
@@ -405,7 +405,7 @@ impl EthSpec for MainnetEthSpec {
type PendingPartialWithdrawalsLimit = U134217728;
type PendingConsolidationsLimit = U262144;
type MaxConsolidations = U1;
type MaxDepositReceiptsPerPayload = U8192;
type MaxDepositRequestsPerPayload = U8192;
type MaxAttesterSlashingsElectra = U1;
type MaxAttestationsElectra = U8;
type MaxWithdrawalRequestsPerPayload = U16;
@@ -442,7 +442,7 @@ impl EthSpec for MinimalEthSpec {
type KzgCommitmentInclusionProofDepth = U9;
type PendingPartialWithdrawalsLimit = U64;
type PendingConsolidationsLimit = U64;
type MaxDepositReceiptsPerPayload = U4;
type MaxDepositRequestsPerPayload = U4;
type MaxWithdrawalRequestsPerPayload = U2;
params_from_eth_spec!(MainnetEthSpec {
@@ -528,7 +528,7 @@ impl EthSpec for GnosisEthSpec {
type PendingPartialWithdrawalsLimit = U134217728;
type PendingConsolidationsLimit = U262144;
type MaxConsolidations = U1;
type MaxDepositReceiptsPerPayload = U8192;
type MaxDepositRequestsPerPayload = U8192;
type MaxAttesterSlashingsElectra = U1;
type MaxAttestationsElectra = U8;
type MaxWithdrawalRequestsPerPayload = U16;

View File

@@ -13,6 +13,10 @@ pub type Transactions<E> = VariableList<
>;
pub type Withdrawals<E> = VariableList<Withdrawal, <E as EthSpec>::MaxWithdrawalsPerPayload>;
pub type DepositRequests<E> =
VariableList<DepositRequest, <E as EthSpec>::MaxDepositRequestsPerPayload>;
pub type WithdrawalRequests<E> =
VariableList<ExecutionLayerWithdrawalRequest, <E as EthSpec>::MaxWithdrawalRequestsPerPayload>;
#[superstruct(
variants(Bellatrix, Capella, Deneb, Electra),
@@ -90,7 +94,7 @@ pub struct ExecutionPayload<E: EthSpec> {
#[serde(with = "serde_utils::quoted_u64")]
pub excess_blob_gas: u64,
#[superstruct(only(Electra))]
pub deposit_receipts: VariableList<DepositReceipt, E::MaxDepositReceiptsPerPayload>,
pub deposit_requests: VariableList<DepositRequest, E::MaxDepositRequestsPerPayload>,
#[superstruct(only(Electra))]
pub withdrawal_requests:
VariableList<ExecutionLayerWithdrawalRequest, E::MaxWithdrawalRequestsPerPayload>,

View File

@@ -295,7 +295,7 @@ impl<'a, E: EthSpec> From<&'a ExecutionPayloadElectra<E>> for ExecutionPayloadHe
withdrawals_root: payload.withdrawals.tree_hash_root(),
blob_gas_used: payload.blob_gas_used,
excess_blob_gas: payload.excess_blob_gas,
deposit_receipts_root: payload.deposit_receipts.tree_hash_root(),
deposit_receipts_root: payload.deposit_requests.tree_hash_root(),
withdrawal_requests_root: payload.withdrawal_requests.tree_hash_root(),
}
}

View File

@@ -150,7 +150,7 @@ pub use crate::contribution_and_proof::ContributionAndProof;
pub use crate::deposit::{Deposit, DEPOSIT_TREE_DEPTH};
pub use crate::deposit_data::DepositData;
pub use crate::deposit_message::DepositMessage;
pub use crate::deposit_receipt::DepositReceipt;
pub use crate::deposit_receipt::DepositRequest;
pub use crate::deposit_tree_snapshot::{DepositTreeSnapshot, FinalizedExecutionBlock};
pub use crate::enr_fork_id::EnrForkId;
pub use crate::epoch_cache::{EpochCache, EpochCacheError, EpochCacheKey};

View File

@@ -45,9 +45,9 @@ pub trait ExecPayload<E: EthSpec>: Debug + Clone + PartialEq + Hash + TreeHash +
Option<VariableList<ExecutionLayerWithdrawalRequest, E::MaxWithdrawalRequestsPerPayload>>,
Error,
>;
fn deposit_receipts(
fn deposit_requests(
&self,
) -> Result<Option<VariableList<DepositReceipt, E::MaxDepositReceiptsPerPayload>>, Error>;
) -> Result<Option<VariableList<DepositRequest, E::MaxDepositRequestsPerPayload>>, Error>;
/// Is this a default payload with 0x0 roots for transactions and withdrawals?
fn is_default_with_zero_roots(&self) -> bool;
@@ -303,15 +303,15 @@ impl<E: EthSpec> ExecPayload<E> for FullPayload<E> {
}
}
fn deposit_receipts(
fn deposit_requests(
&self,
) -> Result<Option<VariableList<DepositReceipt, E::MaxDepositReceiptsPerPayload>>, Error> {
) -> Result<Option<VariableList<DepositRequest, E::MaxDepositRequestsPerPayload>>, Error> {
match self {
FullPayload::Bellatrix(_) | FullPayload::Capella(_) | FullPayload::Deneb(_) => {
Err(Error::IncorrectStateVariant)
}
FullPayload::Electra(inner) => {
Ok(Some(inner.execution_payload.deposit_receipts.clone()))
Ok(Some(inner.execution_payload.deposit_requests.clone()))
}
}
}
@@ -464,15 +464,15 @@ impl<'b, E: EthSpec> ExecPayload<E> for FullPayloadRef<'b, E> {
}
}
fn deposit_receipts(
fn deposit_requests(
&self,
) -> Result<Option<VariableList<DepositReceipt, E::MaxDepositReceiptsPerPayload>>, Error> {
) -> Result<Option<VariableList<DepositRequest, E::MaxDepositRequestsPerPayload>>, Error> {
match self {
FullPayloadRef::Bellatrix(_)
| FullPayloadRef::Capella(_)
| FullPayloadRef::Deneb(_) => Err(Error::IncorrectStateVariant),
FullPayloadRef::Electra(inner) => {
Ok(Some(inner.execution_payload.deposit_receipts.clone()))
Ok(Some(inner.execution_payload.deposit_requests.clone()))
}
}
}
@@ -666,9 +666,9 @@ impl<E: EthSpec> ExecPayload<E> for BlindedPayload<E> {
Ok(None)
}
fn deposit_receipts(
fn deposit_requests(
&self,
) -> Result<Option<VariableList<DepositReceipt, E::MaxDepositReceiptsPerPayload>>, Error> {
) -> Result<Option<VariableList<DepositRequest, E::MaxDepositRequestsPerPayload>>, Error> {
Ok(None)
}
@@ -782,9 +782,9 @@ impl<'b, E: EthSpec> ExecPayload<E> for BlindedPayloadRef<'b, E> {
Ok(None)
}
fn deposit_receipts(
fn deposit_requests(
&self,
) -> Result<Option<VariableList<DepositReceipt, E::MaxDepositReceiptsPerPayload>>, Error> {
) -> Result<Option<VariableList<DepositRequest, E::MaxDepositRequestsPerPayload>>, Error> {
Ok(None)
}
@@ -890,9 +890,9 @@ macro_rules! impl_exec_payload_common {
i(self)
}
fn deposit_receipts(
fn deposit_requests(
&self,
) -> Result<Option<VariableList<DepositReceipt, E::MaxDepositReceiptsPerPayload>>, Error> {
) -> Result<Option<VariableList<DepositRequest, E::MaxDepositRequestsPerPayload>>, Error> {
let j = $j;
j(self)
}
@@ -1052,11 +1052,11 @@ macro_rules! impl_exec_payload_for_fork {
let c: for<'a> fn(
&'a $wrapper_type_full<E>,
) -> Result<
Option<VariableList<DepositReceipt, E::MaxDepositReceiptsPerPayload>>,
Option<VariableList<DepositRequest, E::MaxDepositRequestsPerPayload>>,
Error,
> = |payload: &$wrapper_type_full<E>| {
let wrapper_ref_type = FullPayloadRef::$fork_variant(&payload);
wrapper_ref_type.deposit_receipts()
wrapper_ref_type.deposit_requests()
};
c
}

View File

@@ -248,7 +248,7 @@ pub struct ElectraPreset {
#[serde(with = "serde_utils::quoted_u64")]
pub max_consolidations: u64,
#[serde(with = "serde_utils::quoted_u64")]
pub max_deposit_receipts_per_payload: u64,
pub max_deposit_requests_per_payload: u64,
#[serde(with = "serde_utils::quoted_u64")]
pub max_attester_slashings_electra: u64,
#[serde(with = "serde_utils::quoted_u64")]
@@ -270,7 +270,7 @@ impl ElectraPreset {
pending_partial_withdrawals_limit: E::pending_partial_withdrawals_limit() as u64,
pending_consolidations_limit: E::pending_consolidations_limit() as u64,
max_consolidations: E::max_consolidations() as u64,
max_deposit_receipts_per_payload: E::max_deposit_receipts_per_payload() as u64,
max_deposit_requests_per_payload: E::max_deposit_requests_per_payload() as u64,
max_attester_slashings_electra: E::max_attester_slashings_electra() as u64,
max_attestations_electra: E::max_attestations_electra() as u64,
max_withdrawal_requests_per_payload: E::max_withdrawal_requests_per_payload() as u64,