Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement build_block for EthApi using the PayloadBuilder #12535

Open
mattsse opened this issue Nov 14, 2024 · 1 comment
Open

Implement build_block for EthApi using the PayloadBuilder #12535

mattsse opened this issue Nov 14, 2024 · 1 comment
Assignees
Labels
C-enhancement New feature or request D-complex Quite challenging from either a design or technical perspective Ask for help! D-good-first-issue Nice and easy! A great choice to get started

Comments

@mattsse
Copy link
Collaborator

mattsse commented Nov 14, 2024

Describe the feature

we currently have a default impl for

this uses redundant block building code, we can instead leverage the PayloadBuilder for this by

  1. remove the default impl of build_block
  2. impl it here
    for EthApi<Provider, Pool, Network, EvmConfig>
    where
    Self: SpawnBlocking
    + RpcNodeCore<
  3. and also restrict the RpcNodeCore::PayloadBuilder type

this is similar to

EthPayloadAttributes {
timestamp,
prev_randao: B256::random(),
suggested_fee_recipient: Address::random(),
withdrawals: self
.chain_spec
.is_shanghai_active_at_timestamp(timestamp)
.then(Default::default),
parent_beacon_block_root: self
.chain_spec
.is_cancun_active_at_timestamp(timestamp)
.then(B256::random),
}

where we create attributes and leverage the payload builder API to resolve the payload

fn send_new_payload(

/// Resolves the payload job and returns the best payload that has been built so far.
async fn resolve_kind(
&self,
id: PayloadId,
kind: PayloadKind,

Additional context

No response

@mattsse mattsse added C-enhancement New feature or request D-complex Quite challenging from either a design or technical perspective Ask for help! D-good-first-issue Nice and easy! A great choice to get started labels Nov 14, 2024
@SkandaBhat
Copy link
Contributor

@mattsse can I work on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-enhancement New feature or request D-complex Quite challenging from either a design or technical perspective Ask for help! D-good-first-issue Nice and easy! A great choice to get started
Projects
Status: Todo
Development

No branches or pull requests

2 participants