Skip to content

Make EngineValidator more extensible #21280

@meyer9

Description

@meyer9

Describe the feature

Our goal is to reuse transaction validation work from flashblocks during engine validation.

Currently, the engine validator is an add-on that can be specified through the Reth Node API:

BasicEngineValidatorBuilder<OpEngineValidatorBuilder>,

However, there are private fields and structs, so it's not possible to implement the existing BasicEngineValidator externally.

Here are the changes we made to BasicEngineValidator to reuse execution results: https://github.com/base/base/pull/509/files#diff-d89f69cddd687427998ca98935d9568f4787fc1831f9cd032f8787fb720851d4

Our question is:

  • Should we submit a PR to make more fields public and slightly refactor BasicEngineValidator to make it easier to wrap? Maybe we can decompose it slightly so the executor is a trait that can be overridden...
    • Add trait to allow wrapping Executor?
    • Pass execute_block as a callback to allow overriding just that method?
    • Extract execute_block to a new trait like EngineExecutor that EngineValidator would call?
    • Or implement CachedExecutionProvider upstream so you can also reuse flashblock execution?
    • Something else?

We'd like to avoid copying the entire engine-tree crate into our repo and try to make as many methods just self.inner.whatever() to avoid duplicating validate_block_with_state logic as much as possible.

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-engineRelated to the engine implementationA-op-rethRelated to Optimism and op-rethA-sdkRelated to reth's use as a libraryC-enhancementNew feature or request

    Type

    No type

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions