-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
base: main
Are you sure you want to change the base?
Conversation
f6054f3
to
80f6f9a
Compare
RpcNodeCore
with FullNodeComponents
aa6569f
to
ea8c310
Compare
}, | ||
}; | ||
|
||
EthApiBuilder::new(components) |
There was a problem hiding this comment.
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.
ea8c310
to
6190784
Compare
There was a problem hiding this 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
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>>, |
There was a problem hiding this comment.
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> { |
There was a problem hiding this comment.
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
Closes #15349