reth_payload_primitives

Trait PayloadBuilderAttributes

Source
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§

Source

type RpcPayloadAttributes

The payload attributes that can be used to construct this type. Used as the argument in PayloadBuilderAttributes::try_new.

Source

type Error: Error

The error type used in PayloadBuilderAttributes::try_new.

Required Methods§

Source

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.

Source

fn payload_id(&self) -> PayloadId

Returns the [PayloadId] for the running payload job.

Source

fn parent(&self) -> B256

Returns the parent block hash for the running payload job.

Source

fn timestamp(&self) -> u64

Returns the timestamp for the running payload job.

Source

fn parent_beacon_block_root(&self) -> Option<B256>

Returns the parent beacon block root for the running payload job, if it exists.

Source

fn suggested_fee_recipient(&self) -> Address

Returns the suggested fee recipient for the running payload job.

Source

fn prev_randao(&self) -> B256

Returns the prevrandao field for the running payload job.

Source

fn withdrawals(&self) -> &Withdrawals

Returns the withdrawals for the running payload job.

Implementors§