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: EngineApiBuilder #14354

Merged
merged 1 commit into from
Feb 10, 2025
Merged

feat: EngineApiBuilder #14354

merged 1 commit into from
Feb 10, 2025

Conversation

klkvr
Copy link
Member

@klkvr klkvr commented Feb 10, 2025

Towards #13831

Add EngineApiBuilder to RpcAddOns which uses default EngineApi impl by default but already can be customized to use any implementation.

Technically this is all we need for #13831 but I think we can keep it open until we have at least one usecase for custom engine API implemented (either OP or custom header example)

@emhane emhane added C-debt A clean up/refactor of existing code A-rpc Related to the RPC implementation A-op-reth Related to Optimism and op-reth A-sdk Related to reth's use as a library labels Feb 10, 2025
Copy link
Member

@emhane emhane left a comment

Choose a reason for hiding this comment

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

lgtm. makes sense imo to double this up in op-alloy and just change result type to RpcResult to derive jsonrpsee to close #14211

https://github.com/alloy-rs/op-alloy/blob/d1f9aa5b8111286b5340aa793315b6895e05b258/crates/provider/src/ext/engine.rs#L13-L179

Comment on lines +663 to +665
pub struct BasicEngineApiBuilder<EV> {
engine_validator_builder: EV,
}
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
pub struct BasicEngineApiBuilder<EV> {
engine_validator_builder: EV,
}
pub struct BasicEngineApiBuilder<EB> {
engine_api_builder: EB,
}

Copy link
Member Author

Choose a reason for hiding this comment

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

this is an engine_validator_builder as it provides EngineValidator to pass here

Copy link
Member

Choose a reason for hiding this comment

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

hm then can the struct name change to BasicEngineValidatorBuilder ?

Copy link
Member

Choose a reason for hiding this comment

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

ah I see this pr also aggregates the validator api and the regular api into one type. docs could be more helpful in reflecting this design choice.

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.

cool

@klkvr klkvr added this pull request to the merge queue Feb 10, 2025
Merged via the queue into main with commit 7e3b135 Feb 10, 2025
45 checks passed
@klkvr klkvr deleted the klkvr/engine-api-builder branch February 10, 2025 10:22
18aaddy pushed a commit to 18aaddy/reth that referenced this pull request Feb 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-op-reth Related to Optimism and op-reth A-rpc Related to the RPC implementation A-sdk Related to reth's use as a library C-debt A clean up/refactor of existing code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants