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

Make PayloadOrAttributes generic over ExecutionData #14651

Open
mattsse opened this issue Feb 22, 2025 · 1 comment · May be fixed by #14666
Open

Make PayloadOrAttributes generic over ExecutionData #14651

mattsse opened this issue Feb 22, 2025 · 1 comment · May be fixed by #14666
Assignees
Labels
A-engine Related to the engine implementation A-rpc Related to the RPC implementation C-enhancement New feature or request D-good-first-issue Nice and easy! A great choice to get started

Comments

@mattsse
Copy link
Collaborator

mattsse commented Feb 22, 2025

/// Either an [`ExecutionPayload`] or a type that implements the [`PayloadAttributes`] trait.
///
/// This is a helper type to unify pre-validation of version specific fields of the engine API.
#[derive(Debug)]
pub enum PayloadOrAttributes<'a, Attributes> {
/// An [`ExecutionPayload`] and optional parent beacon block root.
ExecutionPayload {
/// The inner execution payload
payload: &'a ExecutionPayload,

currently used the concrete ethereum payload type ExecutionData

we can change this with a generic Payload

we can further simplify this enum variant to ExecutionPayload(&'a Payload) if we add a parent_beaconblock fn to

pub trait ExecutionPayload:

TODO

  • change ExecutionPayload variant
  • introduce fn withdrawals and fn parent_beacon_block to trait ExecutionPayload
  • update impl
    impl ExecutionPayload for ExecutionData {
  • update constructors calls, e.g.: moving this up

.new_payload(ExecutionData { payload, sidecar: ExecutionPayloadSidecar::none() })

to

let payload = ExecutionPayload::from(payload);

ref #14618

cc @yohkaz

FYI @emhane

@mattsse mattsse added C-enhancement New feature or request D-good-first-issue Nice and easy! A great choice to get started A-rpc Related to the RPC implementation A-engine Related to the engine implementation labels Feb 22, 2025
@yohkaz
Copy link
Contributor

yohkaz commented Feb 22, 2025

Hey, I can have a look as well :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-engine Related to the engine implementation A-rpc Related to the RPC implementation C-enhancement New feature or request D-good-first-issue Nice and easy! A great choice to get started
Projects
Status: Todo
Development

Successfully merging a pull request may close this issue.

2 participants