feat: add Consensus to ExecutionStage (#14447)

This commit is contained in:
Arsenii Kulikov
2025-02-12 18:48:14 +04:00
committed by GitHub
parent 3e07d65751
commit 172369afd5
31 changed files with 355 additions and 194 deletions

View File

@ -34,6 +34,7 @@ reth-node-metrics.workspace = true
## optimism
reth-optimism-primitives.workspace = true
reth-optimism-chainspec.workspace = true
reth-optimism-consensus.workspace = true
reth-chainspec.workspace = true
reth-node-events.workspace = true
@ -84,6 +85,7 @@ optimism = [
"reth-db-api/optimism",
"reth-optimism-primitives/optimism",
"reth-downloaders/optimism",
"reth-optimism-consensus/optimism",
]
asm-keccak = [
"alloy-primitives/asm-keccak",

View File

@ -51,6 +51,7 @@ use reth_node_core::{
args::LogArgs,
version::{LONG_VERSION, SHORT_VERSION},
};
use reth_optimism_consensus::OpBeaconConsensus;
use reth_optimism_evm::OpExecutorProvider;
use reth_optimism_node::{OpNetworkPrimitives, OpNode};
use reth_tracing::FileWorkerGuard;
@ -169,8 +170,9 @@ where
Commands::DumpGenesis(command) => runner.run_blocking_until_ctrl_c(command.execute()),
Commands::Db(command) => runner.run_blocking_until_ctrl_c(command.execute::<OpNode>()),
Commands::Stage(command) => runner.run_command_until_exit(|ctx| {
command
.execute::<OpNode, _, _, OpNetworkPrimitives>(ctx, OpExecutorProvider::optimism)
command.execute::<OpNode, _, _, OpNetworkPrimitives>(ctx, |spec| {
(OpExecutorProvider::optimism(spec.clone()), OpBeaconConsensus::new(spec))
})
}),
Commands::P2P(command) => {
runner.run_until_ctrl_c(command.execute::<OpNetworkPrimitives>())