mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
feat: relax provider bounds (#12857)
This commit is contained in:
@ -7,6 +7,7 @@ use reth_db_api::{
|
||||
};
|
||||
use reth_db_common::DbTool;
|
||||
use reth_evm::{execute::BlockExecutorProvider, noop::NoopBlockExecutorProvider};
|
||||
use reth_node_api::NodePrimitives;
|
||||
use reth_node_builder::NodeTypesWithDB;
|
||||
use reth_node_core::dirs::{ChainPath, DataDirPath};
|
||||
use reth_provider::{
|
||||
@ -25,7 +26,10 @@ pub(crate) async fn dump_execution_stage<N, E>(
|
||||
executor: E,
|
||||
) -> eyre::Result<()>
|
||||
where
|
||||
N: ProviderNodeTypes<DB = Arc<DatabaseEnv>>,
|
||||
N: ProviderNodeTypes<
|
||||
DB = Arc<DatabaseEnv>,
|
||||
Primitives: NodePrimitives<Block = reth_primitives::Block>,
|
||||
>,
|
||||
E: BlockExecutorProvider,
|
||||
{
|
||||
let (output_db, tip_block_number) = setup(from, to, &output_datadir.db(), db_tool)?;
|
||||
@ -131,7 +135,9 @@ fn import_tables_with_range<N: NodeTypesWithDB>(
|
||||
/// Dry-run an unwind to FROM block, so we can get the `PlainStorageState` and
|
||||
/// `PlainAccountState` safely. There might be some state dependency from an address
|
||||
/// which hasn't been changed in the given range.
|
||||
fn unwind_and_copy<N: ProviderNodeTypes>(
|
||||
fn unwind_and_copy<
|
||||
N: ProviderNodeTypes<Primitives: NodePrimitives<Block = reth_primitives::Block>>,
|
||||
>(
|
||||
db_tool: &DbTool<N>,
|
||||
from: u64,
|
||||
tip_block_number: u64,
|
||||
@ -168,7 +174,7 @@ fn dry_run<N, E>(
|
||||
executor: E,
|
||||
) -> eyre::Result<()>
|
||||
where
|
||||
N: ProviderNodeTypes,
|
||||
N: ProviderNodeTypes<Primitives: NodePrimitives<Block = reth_primitives::Block>>,
|
||||
E: BlockExecutorProvider,
|
||||
{
|
||||
info!(target: "reth::cli", "Executing stage. [dry-run]");
|
||||
|
||||
@ -9,6 +9,7 @@ use reth_db_api::{database::Database, table::TableImporter};
|
||||
use reth_db_common::DbTool;
|
||||
use reth_evm::noop::NoopBlockExecutorProvider;
|
||||
use reth_exex::ExExManagerHandle;
|
||||
use reth_node_api::NodePrimitives;
|
||||
use reth_node_core::dirs::{ChainPath, DataDirPath};
|
||||
use reth_provider::{
|
||||
providers::{ProviderNodeTypes, StaticFileProvider},
|
||||
@ -24,7 +25,12 @@ use reth_stages::{
|
||||
};
|
||||
use tracing::info;
|
||||
|
||||
pub(crate) async fn dump_merkle_stage<N: ProviderNodeTypes<DB = Arc<DatabaseEnv>>>(
|
||||
pub(crate) async fn dump_merkle_stage<
|
||||
N: ProviderNodeTypes<
|
||||
DB = Arc<DatabaseEnv>,
|
||||
Primitives: NodePrimitives<Block = reth_primitives::Block>,
|
||||
>,
|
||||
>(
|
||||
db_tool: &DbTool<N>,
|
||||
from: BlockNumber,
|
||||
to: BlockNumber,
|
||||
@ -67,7 +73,9 @@ pub(crate) async fn dump_merkle_stage<N: ProviderNodeTypes<DB = Arc<DatabaseEnv>
|
||||
}
|
||||
|
||||
/// Dry-run an unwind to FROM block and copy the necessary table data to the new database.
|
||||
fn unwind_and_copy<N: ProviderNodeTypes>(
|
||||
fn unwind_and_copy<
|
||||
N: ProviderNodeTypes<Primitives: NodePrimitives<Block = reth_primitives::Block>>,
|
||||
>(
|
||||
db_tool: &DbTool<N>,
|
||||
range: (u64, u64),
|
||||
tip_block_number: u64,
|
||||
|
||||
Reference in New Issue
Block a user