Struct ExecutionPayloadV2
pub struct ExecutionPayloadV2 {
pub payload_inner: ExecutionPayloadV1,
pub withdrawals: Vec<Withdrawal>,
}engine only.Expand description
This structure maps on the ExecutionPayloadV2 structure of the beacon chain spec.
Fields§
§payload_inner: ExecutionPayloadV1Inner V1 payload
withdrawals: Vec<Withdrawal>Array of Withdrawal enabled with V2
See https://github.com/ethereum/execution-apis/blob/6709c2a795b707202e93c4f2867fa0bf2640a84f/src/engine/shanghai.md#executionpayloadv2
Implementations§
§impl ExecutionPayloadV2
impl ExecutionPayloadV2
pub fn from_block_slow<T, H>(block: &Block<T, H>) -> ExecutionPayloadV2where
T: Encodable2718,
H: BlockHeader + Sealable,
Available on crate feature ssz only.
pub fn from_block_slow<T, H>(block: &Block<T, H>) -> ExecutionPayloadV2where
T: Encodable2718,
H: BlockHeader + Sealable,
ssz only.Converts [alloy_consensus::Block] to ExecutionPayloadV2.
See also ExecutionPayloadV1::from_block_unchecked.
If the block does not have any withdrawals, an empty vector is used.
Note: This re-calculates the block hash.
pub fn from_block_unchecked<T, H>(
block_hash: FixedBytes<32>,
block: &Block<T, H>,
) -> ExecutionPayloadV2where
T: Encodable2718,
H: BlockHeader,
Available on crate feature ssz only.
pub fn from_block_unchecked<T, H>(
block_hash: FixedBytes<32>,
block: &Block<T, H>,
) -> ExecutionPayloadV2where
T: Encodable2718,
H: BlockHeader,
ssz only.Converts [alloy_consensus::Block] to ExecutionPayloadV2 using the given block hash.
See also ExecutionPayloadV1::from_block_unchecked.
If the block does not have any withdrawals, an empty vector is used.
pub const fn timestamp(&self) -> u64
Available on crate feature ssz only.
pub const fn timestamp(&self) -> u64
ssz only.Returns the timestamp for the execution payload.
pub fn into_payload_input_v2(
self,
is_shanghai_active: bool,
) -> ExecutionPayloadInputV2
Available on crate feature ssz only.
pub fn into_payload_input_v2( self, is_shanghai_active: bool, ) -> ExecutionPayloadInputV2
ssz only.Converts ExecutionPayloadV2 to ExecutionPayloadInputV2.
An ExecutionPayloadInputV2 should have a Some withdrawals field if shanghai is
active, otherwise the withdrawals field should be None, so the is_shanghai_active
argument is provided which will either:
pub fn try_into_block<T>(self) -> Result<Block<T>, PayloadError>where
T: Decodable2718,
Available on crate feature ssz only.
pub fn try_into_block<T>(self) -> Result<Block<T>, PayloadError>where
T: Decodable2718,
ssz only.Converts ExecutionPayloadV2 to [Block].
This performs the same conversion as the underlying V1 payload, but calculates the withdrawals root and adds withdrawals.
See also ExecutionPayloadV1::try_into_block.
pub fn try_into_block_with<T, F, E>(
self,
f: F,
) -> Result<Block<T>, PayloadError>
Available on crate feature ssz only.
pub fn try_into_block_with<T, F, E>( self, f: F, ) -> Result<Block<T>, PayloadError>
ssz only.Converts ExecutionPayloadV2 to [Block] with a custom transaction mapper.
See also ExecutionPayloadV1::try_into_block_with.
pub fn into_block_raw(self) -> Result<Block<Bytes>, PayloadError>
Available on crate feature ssz only.
pub fn into_block_raw(self) -> Result<Block<Bytes>, PayloadError>
ssz only.Converts ExecutionPayloadV2 to [Block] with raw [Bytes] transactions.
This is similar to Self::try_into_block_with but returns the transactions as raw bytes
without any conversion.
pub fn into_block_raw_with_transactions_root(
self,
transactions_root: FixedBytes<32>,
) -> Result<Block<Bytes>, PayloadError>
Available on crate feature ssz only.
pub fn into_block_raw_with_transactions_root( self, transactions_root: FixedBytes<32>, ) -> Result<Block<Bytes>, PayloadError>
ssz only.Converts ExecutionPayloadV2 to [Block] with raw [Bytes] transactions using the
given transactions_root.
See also ExecutionPayloadV1::into_block_raw_with_transactions_root.
pub fn into_block_raw_with_transactions_root_opt(
self,
transactions_root: Option<FixedBytes<32>>,
) -> Result<Block<Bytes>, PayloadError>
Available on crate feature ssz only.
pub fn into_block_raw_with_transactions_root_opt( self, transactions_root: Option<FixedBytes<32>>, ) -> Result<Block<Bytes>, PayloadError>
ssz only.Converts ExecutionPayloadV2 to [Block] with raw [Bytes] transactions, optionally
using the given transactions_root.
If transactions_root is None, it will be computed from the transactions.
Trait Implementations§
§impl<'arbitrary> Arbitrary<'arbitrary> for ExecutionPayloadV2
impl<'arbitrary> Arbitrary<'arbitrary> for ExecutionPayloadV2
§fn arbitrary(
u: &mut Unstructured<'arbitrary>,
) -> Result<ExecutionPayloadV2, Error>
fn arbitrary( u: &mut Unstructured<'arbitrary>, ) -> Result<ExecutionPayloadV2, Error>
Self from the given unstructured data. Read more§fn arbitrary_take_rest(
u: Unstructured<'arbitrary>,
) -> Result<ExecutionPayloadV2, Error>
fn arbitrary_take_rest( u: Unstructured<'arbitrary>, ) -> Result<ExecutionPayloadV2, Error>
Self from the entirety of the given
unstructured data. Read more§fn size_hint(depth: usize) -> (usize, Option<usize>)
fn size_hint(depth: usize) -> (usize, Option<usize>)
Unstructured this type
needs to construct itself. Read more§fn try_size_hint(
depth: usize,
) -> Result<(usize, Option<usize>), MaxRecursionReached>
fn try_size_hint( depth: usize, ) -> Result<(usize, Option<usize>), MaxRecursionReached>
Unstructured this type
needs to construct itself. Read more§impl Clone for ExecutionPayloadV2
impl Clone for ExecutionPayloadV2
§fn clone(&self) -> ExecutionPayloadV2
fn clone(&self) -> ExecutionPayloadV2
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more§impl Debug for ExecutionPayloadV2
impl Debug for ExecutionPayloadV2
§impl Decode for ExecutionPayloadV2
Available on crate feature ssz only.
impl Decode for ExecutionPayloadV2
ssz only.§fn is_ssz_fixed_len() -> bool
fn is_ssz_fixed_len() -> bool
true if this object has a fixed-length. Read more§fn from_ssz_bytes(bytes: &[u8]) -> Result<ExecutionPayloadV2, DecodeError>
fn from_ssz_bytes(bytes: &[u8]) -> Result<ExecutionPayloadV2, DecodeError>
§fn ssz_fixed_len() -> usize
fn ssz_fixed_len() -> usize
§impl<'de> Deserialize<'de> for ExecutionPayloadV2
Available on crate feature serde only.
impl<'de> Deserialize<'de> for ExecutionPayloadV2
serde only.§fn deserialize<D>(
deserializer: D,
) -> Result<ExecutionPayloadV2, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D,
) -> Result<ExecutionPayloadV2, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
§impl Encode for ExecutionPayloadV2
Available on crate feature ssz only.
impl Encode for ExecutionPayloadV2
ssz only.§fn is_ssz_fixed_len() -> bool
fn is_ssz_fixed_len() -> bool
true if this object has a fixed-length. Read more§fn ssz_append(&self, buf: &mut Vec<u8>)
fn ssz_append(&self, buf: &mut Vec<u8>)
§fn ssz_bytes_len(&self) -> usize
fn ssz_bytes_len(&self) -> usize
self is serialized. Read more§fn ssz_fixed_len() -> usize
fn ssz_fixed_len() -> usize
impl Eq for ExecutionPayloadV2
§impl<'a> From<BeaconExecutionPayloadV2<'a>> for ExecutionPayloadV2
impl<'a> From<BeaconExecutionPayloadV2<'a>> for ExecutionPayloadV2
§fn from(payload: BeaconExecutionPayloadV2<'a>) -> ExecutionPayloadV2
fn from(payload: BeaconExecutionPayloadV2<'a>) -> ExecutionPayloadV2
§impl From<ExecutionPayloadV2> for ExecutionPayloadEnvelopeShanghai
impl From<ExecutionPayloadV2> for ExecutionPayloadEnvelopeShanghai
§fn from(payload: ExecutionPayloadV2) -> ExecutionPayloadEnvelopeShanghai
fn from(payload: ExecutionPayloadV2) -> ExecutionPayloadEnvelopeShanghai
§impl From<ExecutionPayloadV2> for ExecutionPayload
impl From<ExecutionPayloadV2> for ExecutionPayload
§fn from(payload: ExecutionPayloadV2) -> ExecutionPayload
fn from(payload: ExecutionPayloadV2) -> ExecutionPayload
§impl PartialEq for ExecutionPayloadV2
impl PartialEq for ExecutionPayloadV2
§impl Serialize for ExecutionPayloadV2
impl Serialize for ExecutionPayloadV2
§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl StructuralPartialEq for ExecutionPayloadV2
Auto Trait Implementations§
impl !Freeze for ExecutionPayloadV2
impl RefUnwindSafe for ExecutionPayloadV2
impl Send for ExecutionPayloadV2
impl Sync for ExecutionPayloadV2
impl Unpin for ExecutionPayloadV2
impl UnsafeUnpin for ExecutionPayloadV2
impl UnwindSafe for ExecutionPayloadV2
Blanket Implementations§
impl<A> ArbInterop for A
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<'de, T> BorrowedRpcObject<'de> for Twhere
T: RpcBorrow<'de> + RpcSend,
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Conv for T
impl<T> Conv for T
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<T> FmtForward for T
impl<T> FmtForward for T
§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self to use its Binary implementation when Debug-formatted.§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self to use its Display implementation when
Debug-formatted.§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self to use its LowerExp implementation when
Debug-formatted.§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self to use its LowerHex implementation when
Debug-formatted.§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self to use its Octal implementation when Debug-formatted.§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self to use its Pointer implementation when
Debug-formatted.§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self to use its UpperExp implementation when
Debug-formatted.§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self to use its UpperHex implementation when
Debug-formatted.§fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Layered].impl<T> MaybeDebug for Twhere
T: Debug,
impl<T> MaybeSerde for Twhere
T: Serialize + for<'de> Deserialize<'de>,
impl<T> NippyJarHeader for T
§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read more§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read more§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self, then passes self.as_ref() into the pipe function.§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self, then passes self.as_mut() into the pipe
function.§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self, then passes self.deref() into the pipe function.§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
impl<'de, T> RpcBorrow<'de> for T
impl<T> RpcObject for Twhere
T: RpcSend + RpcRecv,
impl<T> RpcRecv for T
impl<T> RpcSend for T
§impl<T> Tap for T
impl<T> Tap for T
§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B> of a value. Read more§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B> of a value. Read more§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R> view of a value. Read more§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R> view of a value. Read more§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target of a value. Read more§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target of a value. Read more§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds.§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow() only in debug builds, and is erased in release
builds.§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut() only in debug builds, and is erased in release
builds.§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref() only in debug builds, and is erased in release
builds.§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut() only in debug builds, and is erased in release
builds.§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in release
builds.§impl<T> TryConv for T
impl<T> TryConv for T
§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘwhere
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘwhere
S: Into<Dispatch>,
§fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ
fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ
Source§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
Source§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘwhere
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘwhere
S: Into<Dispatch>,
Source§fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ
fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 584 bytes