Trait PayloadBuilderAttributes

Source
pub trait PayloadBuilderAttributes:
    Send
    + Sync
    + Debug {
    type RpcPayloadAttributes;
    type Error: Error;

    // Required methods
    fn try_new(
        parent: FixedBytes<32>,
        rpc_payload_attributes: Self::RpcPayloadAttributes,
        version: u8,
    ) -> Result<Self, Self::Error>
       where Self: Sized;
    fn payload_id(&self) -> PayloadId;
    fn parent(&self) -> FixedBytes<32>;
    fn timestamp(&self) -> u64;
    fn parent_beacon_block_root(&self) -> Option<FixedBytes<32>>;
    fn suggested_fee_recipient(&self) -> Address;
    fn prev_randao(&self) -> FixedBytes<32>;
    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: FixedBytes<32>, 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) -> FixedBytes<32>

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<FixedBytes<32>>

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) -> FixedBytes<32>

Returns the prevrandao field for the running payload job.

Source

fn withdrawals(&self) -> &Withdrawals

Returns the withdrawals for the running payload job.

Implementations on Foreign Types§

Source§

impl PayloadBuilderAttributes for EthPayloadBuilderAttributes

Source§

fn try_new( parent: FixedBytes<32>, attributes: PayloadAttributes, _version: u8, ) -> Result<EthPayloadBuilderAttributes, Infallible>

Creates a new payload builder for the given parent block and the attributes.

Derives the unique [PayloadId] for the given parent and attributes

Source§

type RpcPayloadAttributes = PayloadAttributes

Source§

type Error = Infallible

Source§

fn payload_id(&self) -> PayloadId

Source§

fn parent(&self) -> FixedBytes<32>

Source§

fn timestamp(&self) -> u64

Source§

fn parent_beacon_block_root(&self) -> Option<FixedBytes<32>>

Source§

fn suggested_fee_recipient(&self) -> Address

Source§

fn prev_randao(&self) -> FixedBytes<32>

Source§

fn withdrawals(&self) -> &Withdrawals

Implementors§

impl<T: Decodable2718 + Send + Sync + Debug> PayloadBuilderAttributes for OpPayloadBuilderAttributes<T>