feat: add OptimismNode type (#6610)

Co-authored-by: Emilia Hane <elsaemiliaevahane@gmail.com>
This commit is contained in:
Matthias Seitz
2024-02-15 14:59:53 +01:00
committed by GitHub
parent 7ef570fc17
commit db158f29f4
10 changed files with 268 additions and 9 deletions

View File

@@ -10,6 +10,13 @@ pub struct NodeHandle<Node: FullNodeComponents> {
pub node_exit_future: NodeExitFuture,
}
impl<Node: FullNodeComponents> NodeHandle<Node> {
/// Waits for the node to exit, if it was configured to exit.
pub async fn wait_for_node_exit(self) -> eyre::Result<()> {
self.node_exit_future.await
}
}
impl<Node: FullNodeComponents> fmt::Debug for NodeHandle<Node> {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.debug_struct("NodeHandle")

View File

@@ -1,4 +1,7 @@
use crate::{components::FullNodeComponents, rpc::RethRpcServerHandles};
use crate::{
components::FullNodeComponents,
rpc::{RethRpcServerHandles, RpcRegistry},
};
use reth_db::database::Database;
use reth_network::NetworkHandle;
use reth_node_api::{evm::EvmConfig, primitives::NodePrimitives, EngineTypes};
@@ -9,11 +12,8 @@ use reth_node_core::{
};
use reth_payload_builder::PayloadBuilderHandle;
use reth_tasks::TaskExecutor;
use std::marker::PhantomData;
use crate::rpc::RpcRegistry;
/// The type that configures stateless node types, the node's primitive types.
pub trait NodeTypes: Send + Sync + 'static {
/// The node's primitive types.