Skip to content

refactor(rpc): Replace RpcNodeCore with FullNodeComponents #15585

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

Draft
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

RomanHodulak
Copy link
Collaborator

@RomanHodulak RomanHodulak commented Apr 7, 2025

Closes #15349

@mattsse mattsse added the A-sdk Related to reth's use as a library label Apr 8, 2025
@RomanHodulak RomanHodulak changed the title WIP: Use full node components in RPC refactor(rpc): Replace RpcNodeCore with FullNodeComponents Apr 25, 2025
},
};

EthApiBuilder::new(components)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Currently figuring out how to fix this. Basically this won't compile due to various trait bound errors.

Tried previously to impl FullNodeComponents for RpcModuleBuilder which was proving to be difficult so I switched to this custom struct that I copied from exex tests instead.

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.

okay, all of the simplifications on the actual ethapi and related traits are very nice.

from what I can see is that this bubble up the complexity to builder level where this type must be composed.

which seems difficult if we want to support individual arguments, but I feel like the Components container type approach is useful here.

will play around with this a bit more

fyi @klkvr

Comment on lines +191 to +211
Pool: TransactionPool + Unpin,
EvmConfig: ConfigureEvm,
Consensus: Clone + Unpin + FullConsensus<N>,
Network: Clone,
Provider: Clone
+ DatabaseProviderFactory
+ ForkChoiceSubscriptions
+ reth_provider::StaticFileProviderFactory,
Tasks: Clone,
BlockExecutor: Clone,
N: NodePrimitives,
Provider: FullRpcProvider<Block = N::Block, Receipt = N::Receipt, Header = N::BlockHeader>
+ CanonStateSubscriptions<Primitives = N>
+ AccountReader
+ ChangeSetReader,
Pool: TransactionPool + 'static,
Network: NetworkInfo + Peers + Clone + 'static,
Tasks: TaskSpawner + Clone + 'static,
EvmConfig: ConfigureEvm<Primitives = N>,
BlockExecutor: BlockExecutorProvider<Primitives = N>,
Network: FullNetwork<Client: BlockClient<Block = <N as NodePrimitives>::Block>>,
Copy link
Collaborator

Choose a reason for hiding this comment

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

right, if we squash the individual generics in the rpc types then we need to merge them them some in the builder entrypoint 🤔

///
/// This provides access to all the components of the node.
#[derive(Debug)]
pub struct Components<Node: FullNodeTypes, Pool, EVM, Executor, Consensus, Network> {
Copy link
Collaborator

Choose a reason for hiding this comment

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

which is what this type here does

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-sdk Related to reth's use as a library
Projects
Status: Todo
Development

Successfully merging this pull request may close these issues.

Replace RpcNodeCore with FullNodeComponents
2 participants