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

feat(rpc): relax VaidationApi and EngineApi #13241

Merged
merged 5 commits into from
Dec 9, 2024
Merged

Conversation

klkvr
Copy link
Member

@klkvr klkvr commented Dec 9, 2024

Based on #13232

Relaxes bounds for ValidationApi and EngineApi, migrating all of the RPC setup off the concrete primitives.

Changes:

  • Block AT and ensure_well_formed_payload method are extracted from EngineValidator into a separate PayloadValidator which can be used to validate ExecutionPayloads without the need to know entire EngineTypes
  • Arc<dyn PayloadValidator> is stored on rpc builder and rpc registry, and passed to ValidationApi to abastract the ExecutionPayload -> Block conversion. I didn't make it a generic because this would require adding an additional generic to RpcRegistry and all types that hold it including user-facing RpcHandle
    /// Helper wrapper type to encapsulate the [`RpcRegistryInner`] over components trait.
    #[derive(Debug, Clone)]
    #[allow(clippy::type_complexity)]
    pub struct RpcRegistry<Node: FullNodeComponents, EthApi: EthApiTypes> {
    pub(crate) registry: RpcRegistryInner<
    Node::Provider,
    Node::Pool,
    Node::Network,
    TaskExecutor,
    Node::Provider,
    EthApi,
    Node::Executor,
    Node::Consensus,
    >,
    }

    A one way we could consider simplifying this is require users to implement engine validation traits directly on Consensus. This feels semantically right and should also allow make it easier to support nodes without engine

Base automatically changed from klkvr/relax-simulate-v1 to main December 9, 2024 19:23
@github-actions github-actions bot requested a review from joshieDo as a code owner December 9, 2024 19:23
@klkvr klkvr force-pushed the klkvr/relax-validation-api branch from 8f98b0f to c1a6c12 Compare December 9, 2024 19:25
@klkvr klkvr added A-rpc Related to the RPC implementation A-sdk Related to reth's use as a library labels Dec 9, 2024
Copy link
Collaborator

@mattsse mattsse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

makes sense, lgtm!

@klkvr klkvr added this pull request to the merge queue Dec 9, 2024
Merged via the queue into main with commit eb60808 Dec 9, 2024
42 checks passed
@klkvr klkvr deleted the klkvr/relax-validation-api branch December 9, 2024 22:03
lean-apple pushed a commit to lean-apple/reth that referenced this pull request Dec 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-rpc Related to the RPC implementation A-sdk Related to reth's use as a library
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants