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

Add EthApiServer as GAT of NodeComponents extension trait #8781

Closed
Tracked by #8988
emhane opened this issue Jun 12, 2024 · 1 comment · Fixed by #9444
Closed
Tracked by #8988

Add EthApiServer as GAT of NodeComponents extension trait #8781

emhane opened this issue Jun 12, 2024 · 1 comment · Fixed by #9444
Labels
A-op-reth Related to Optimism and op-reth A-rpc Related to the RPC implementation C-debt Refactor of code section that is hard to understand or maintain S-blocked This cannot more forward until something else changes

Comments

@emhane
Copy link
Member

emhane commented Jun 12, 2024

Describe the feature

Build EthApi and EngineEthApi according to Reth's node builder pattern

/// An abstraction over the components of a node, consisting of:
/// - evm and executor
/// - transaction pool
/// - network
/// - payload builder.
pub trait NodeComponents<NodeTypes: FullNodeTypes>: Clone + Unpin + Send + Sync + 'static {
/// The transaction pool of the node.
type Pool: TransactionPool + Unpin;
/// The node's EVM configuration, defining settings for the Ethereum Virtual Machine.
type Evm: ConfigureEvm;
/// The type that knows how to execute blocks.
type Executor: BlockExecutorProvider;
/// The consensus type of the node.
type Consensus: Consensus + Clone + Unpin + 'static;
/// Returns the transaction pool of the node.
fn pool(&self) -> &Self::Pool;
/// Returns the node's evm config.
fn evm_config(&self) -> &Self::Evm;
/// Returns the node's executor type.
fn block_executor(&self) -> &Self::Executor;
/// Returns the node's consensus type.
fn consensus(&self) -> &Self::Consensus;
/// Returns the handle to the network
fn network(&self) -> &NetworkHandle;
/// Returns the handle to the payload builder service.
fn payload_builder(&self) -> &PayloadBuilderHandle<NodeTypes::Engine>;
}

Make type that impl EthApiServer configurable, by adding as GAT to extension trait of FullNodeComponents. EthHandlers needs to be generic over a type that implements this extension trait , and as a follow so does RpcRegistry.

Additional context

blocked by #8985

@emhane emhane added C-debt Refactor of code section that is hard to understand or maintain A-rpc Related to the RPC implementation A-op-reth Related to Optimism and op-reth labels Jun 12, 2024
@emhane emhane changed the title Add EthApi as GAT of NodeComponents Add EthHandlers as GAT of NodeComponents Jun 17, 2024
@emhane emhane changed the title Add EthHandlers as GAT of NodeComponents Add EthHandlers as GAT of ~~NodeComponents~~ NodeComponentsExt Jun 20, 2024
@emhane emhane changed the title Add EthHandlers as GAT of ~~NodeComponents~~ NodeComponentsExt Add EthHandlers as GAT of NodeComponents extension trait Jun 20, 2024
@emhane emhane changed the title Add EthHandlers as GAT of NodeComponents extension trait Add EthApiServer as GAT of NodeComponents extension trait Jun 20, 2024
@emhane emhane added the S-blocked This cannot more forward until something else changes label Jun 20, 2024
Copy link
Contributor

This issue is stale because it has been open for 21 days with no activity.

@github-actions github-actions bot added the S-stale This issue/PR is stale and will close with no further activity label Jul 12, 2024
@emhane emhane removed the S-stale This issue/PR is stale and will close with no further activity label Jul 12, 2024
@github-project-automation github-project-automation bot moved this from Todo to Done in Reth Tracker Jul 16, 2024
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 C-debt Refactor of code section that is hard to understand or maintain S-blocked This cannot more forward until something else changes
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

1 participant