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

refactor: move ValidationApi setup to EthereumAddOns #14342

Merged
merged 4 commits into from
Feb 9, 2025

Conversation

klkvr
Copy link
Member

@klkvr klkvr commented Feb 9, 2025

flashbots_ namespace is Ethereum specific and locked to concrete input types making it incompatible with custom Engine API we are about to introduce

This PR moves setup of ValidationApi to eth-specific add-ons allowing us to get rid of payload_validator usage in RpcRegistry

// only relevant for Ethereum and configured in `EthereumAddOns`
// implementation
// TODO: can we get rid of this here?
RethRpcModule::Flashbots => Default::default(),
Copy link
Member Author

@klkvr klkvr Feb 9, 2025

Choose a reason for hiding this comment

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

don't like that we're doing this here now, I'm wondering if we should introduce generic for network-specific rpc namespaces?

Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm wondering if we should introduce generic for

yeah, I been thinking about this a bit.
we'd need to integrate this into cli abstraction.

for now this is okay

I expect that the addons and this registry type will converge eventually, like offload more and more rpc setup to rpcaddons

for OP we also do this already:

let miner_ext = OpMinerExtApi::new(da_config);

so we'd need to find a way to approach this entire cli -> builder -> launch from the CLI perspective.

we kinda started experimenting with this a while ago with

but it's not used anywhere yet

pub trait RethCli: Sized {

one approach could be to make NodeConfig entirely dependent on the RethCli, like the config is an output of the Cli which is then plugged into the builder

Comment on lines +120 to +123
#[derive(Debug)]
pub struct EthereumAddOns<N: FullNodeComponents> {
inner: RpcAddOns<N, EthApiFor<N>, EthereumEngineValidatorBuilder>,
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

so much better

@@ -859,6 +843,7 @@ impl RpcModuleConfigBuilder {

/// A Helper type the holds instances of the configured modules.
#[derive(Debug, Clone)]
#[expect(dead_code)] // Consensus generic, might be useful in the future
Copy link
Collaborator

Choose a reason for hiding this comment

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

this makes sense

// only relevant for Ethereum and configured in `EthereumAddOns`
// implementation
// TODO: can we get rid of this here?
RethRpcModule::Flashbots => Default::default(),
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm wondering if we should introduce generic for

yeah, I been thinking about this a bit.
we'd need to integrate this into cli abstraction.

for now this is okay

I expect that the addons and this registry type will converge eventually, like offload more and more rpc setup to rpcaddons

for OP we also do this already:

let miner_ext = OpMinerExtApi::new(da_config);

so we'd need to find a way to approach this entire cli -> builder -> launch from the CLI perspective.

we kinda started experimenting with this a while ago with

but it's not used anywhere yet

pub trait RethCli: Sized {

one approach could be to make NodeConfig entirely dependent on the RethCli, like the config is an output of the Cli which is then plugged into the builder

@klkvr klkvr added this pull request to the merge queue Feb 9, 2025
Merged via the queue into main with commit 104bd6e Feb 9, 2025
44 checks passed
@klkvr klkvr deleted the klkvr/move-validation-api-to-eth-addons branch February 9, 2025 14:27
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
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants