pub trait PayloadBuilderAttributes:
Send
+ Sync
+ Debug {
type RpcPayloadAttributes;
type Error: Error;
// Required methods
fn try_new(
parent: B256,
rpc_payload_attributes: Self::RpcPayloadAttributes,
version: u8,
) -> Result<Self, Self::Error>
where Self: Sized;
fn payload_id(&self) -> PayloadId;
fn parent(&self) -> B256;
fn timestamp(&self) -> u64;
fn parent_beacon_block_root(&self) -> Option<B256>;
fn suggested_fee_recipient(&self) -> Address;
fn prev_randao(&self) -> B256;
fn withdrawals(&self) -> &Withdrawals;
}
Expand description
This can be implemented by types that describe a currently running payload job.
This is used as a conversion type, transforming a payload attributes type that the engine API receives, into a type that the payload builder can use.
Required Associated Types§
Sourcetype RpcPayloadAttributes
type RpcPayloadAttributes
The payload attributes that can be used to construct this type. Used as the argument in
PayloadBuilderAttributes::try_new
.
Sourcetype Error: Error
type Error: Error
The error type used in PayloadBuilderAttributes::try_new
.
Required Methods§
Sourcefn try_new(
parent: B256,
rpc_payload_attributes: Self::RpcPayloadAttributes,
version: u8,
) -> Result<Self, Self::Error>where
Self: Sized,
fn try_new(
parent: B256,
rpc_payload_attributes: Self::RpcPayloadAttributes,
version: u8,
) -> Result<Self, Self::Error>where
Self: Sized,
Creates a new payload builder for the given parent block and the attributes.
Derives the unique [PayloadId
] for the given parent, attributes and version.
Sourcefn payload_id(&self) -> PayloadId
fn payload_id(&self) -> PayloadId
Returns the [PayloadId
] for the running payload job.
Sourcefn parent_beacon_block_root(&self) -> Option<B256>
fn parent_beacon_block_root(&self) -> Option<B256>
Returns the parent beacon block root for the running payload job, if it exists.
Sourcefn suggested_fee_recipient(&self) -> Address
fn suggested_fee_recipient(&self) -> Address
Returns the suggested fee recipient for the running payload job.
Sourcefn prev_randao(&self) -> B256
fn prev_randao(&self) -> B256
Returns the prevrandao field for the running payload job.
Sourcefn withdrawals(&self) -> &Withdrawals
fn withdrawals(&self) -> &Withdrawals
Returns the withdrawals for the running payload job.