pub enum RethNewPayloadInput<ExecutionData> {
ExecutionData(ExecutionData),
BigBlockData(Box<BigBlockData<ExecutionData>>),
BlockRlp {
block: Bytes,
bal: Option<Bytes>,
},
}Expand description
The input to reth_newPayload.
Reth accepts standard execution data, big-block execution data, and raw RLP-encoded blocks.
Raw blocks are sent as a legacy bare byte string when no block access list is present, and as
an object containing block and bal when one is present.
§Examples
Standard execution data can use any serializable execution-data type:
use alloy_reth::RethNewPayloadInput;
let input = RethNewPayloadInput::execution_data(serde_json::json!({
"payload": "0x01",
"sidecar": "0x02",
}));
assert!(serde_json::to_value(input).is_ok());Big-block data carries the constituent execution environments and their block hashes:
use alloy_primitives::B256;
use alloy_reth::{BigBlockData, RethNewPayloadInput};
let input = RethNewPayloadInput::big_block_data(BigBlockData {
env_switches: vec![serde_json::json!({"payload": "0x01"})],
prior_block_hashes: vec![(7, B256::ZERO)],
block_number: 8,
merged_block_access_list: None,
});
assert!(serde_json::to_value(input).is_ok());Raw RLP data may be sent with an optional merged block access list:
use alloy_primitives::Bytes;
use alloy_reth::RethNewPayloadInput;
let input = RethNewPayloadInput::<serde_json::Value>::block_rlp_with_bal(
Bytes::from_static(&[0x01]),
Bytes::from_static(&[0x02]),
);
assert_eq!(serde_json::to_value(input).unwrap()["block"], "0x01");Variants§
ExecutionData(ExecutionData)
Standard execution data (payload + sidecar).
BigBlockData(Box<BigBlockData<ExecutionData>>)
Big-block execution data.
BlockRlp
Raw RLP-encoded block bytes and an optional merged block access list.
Implementations§
Source§impl<E> RethNewPayloadInput<E>
impl<E> RethNewPayloadInput<E>
Sourcepub const fn execution_data(data: E) -> Self
pub const fn execution_data(data: E) -> Self
Creates a new RethNewPayloadInput from execution data.
Sourcepub fn big_block_data(data: BigBlockData<E>) -> Self
pub fn big_block_data(data: BigBlockData<E>) -> Self
Creates a new RethNewPayloadInput from big-block execution data.
Sourcepub fn block_rlp(bytes: impl Into<Bytes>) -> Self
pub fn block_rlp(bytes: impl Into<Bytes>) -> Self
Creates a new RethNewPayloadInput from raw RLP-encoded block bytes.
Sourcepub fn block_rlp_with_bal(
block: impl Into<Bytes>,
bal: impl Into<Bytes>,
) -> Self
pub fn block_rlp_with_bal( block: impl Into<Bytes>, bal: impl Into<Bytes>, ) -> Self
Creates a new RethNewPayloadInput from raw RLP bytes and a block access list.
Trait Implementations§
Source§impl<ExecutionData: Clone> Clone for RethNewPayloadInput<ExecutionData>
impl<ExecutionData: Clone> Clone for RethNewPayloadInput<ExecutionData>
Source§fn clone(&self) -> RethNewPayloadInput<ExecutionData>
fn clone(&self) -> RethNewPayloadInput<ExecutionData>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<ExecutionData: Debug> Debug for RethNewPayloadInput<ExecutionData>
impl<ExecutionData: Debug> Debug for RethNewPayloadInput<ExecutionData>
Source§impl<'de, E> Deserialize<'de> for RethNewPayloadInput<E>where
E: Deserialize<'de>,
impl<'de, E> Deserialize<'de> for RethNewPayloadInput<E>where
E: Deserialize<'de>,
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Source§impl<E> From<RethNewPayloadInput<E>> for RethNewPayloadParams<E>
impl<E> From<RethNewPayloadInput<E>> for RethNewPayloadParams<E>
Source§fn from(payload: RethNewPayloadInput<E>) -> Self
fn from(payload: RethNewPayloadInput<E>) -> Self
Auto Trait Implementations§
impl<ExecutionData> !Freeze for RethNewPayloadInput<ExecutionData>
impl<ExecutionData> RefUnwindSafe for RethNewPayloadInput<ExecutionData>where
ExecutionData: RefUnwindSafe,
impl<ExecutionData> Send for RethNewPayloadInput<ExecutionData>where
ExecutionData: Send,
impl<ExecutionData> Sync for RethNewPayloadInput<ExecutionData>where
ExecutionData: Sync,
impl<ExecutionData> Unpin for RethNewPayloadInput<ExecutionData>where
ExecutionData: Unpin,
impl<ExecutionData> UnsafeUnpin for RethNewPayloadInput<ExecutionData>where
ExecutionData: UnsafeUnpin,
impl<ExecutionData> UnwindSafe for RethNewPayloadInput<ExecutionData>where
ExecutionData: UnwindSafe,
Blanket Implementations§
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 T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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 moreimpl<'de, T> RpcBorrow<'de> for T
impl<T> RpcObject for T
impl<T> RpcRecv for T
impl<T> RpcSend for T
Source§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
Source§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
Source§fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ
fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ
Layout§
Note: Unable to compute type layout, possibly due to this type having generic parameters. Layout can only be computed for concrete, fully-instantiated types.