Skip to content

Commit

Permalink
rename
Browse files Browse the repository at this point in the history
  • Loading branch information
joshieDo committed Oct 18, 2024
1 parent 1673817 commit d7d43e3
Show file tree
Hide file tree
Showing 14 changed files with 234 additions and 226 deletions.
4 changes: 2 additions & 2 deletions bin/reth/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use reth_node_builder::{
EngineNodeLauncher,
};
use reth_node_ethereum::{node::EthereumAddOns, EthereumNode};
use reth_provider::providers::BlockchainProviderFactory;
use reth_provider::providers::BlockchainProvider2;
use reth_tracing::tracing::warn;
use tracing::info;

Expand Down Expand Up @@ -73,7 +73,7 @@ fn main() {
.with_persistence_threshold(engine_args.persistence_threshold)
.with_memory_block_buffer_target(engine_args.memory_block_buffer_target);
let handle = builder
.with_types_and_provider::<EthereumNode, BlockchainProviderFactory<_>>()
.with_types_and_provider::<EthereumNode, BlockchainProvider2<_>>()
.with_components(EthereumNode::components())
.with_add_ons(EthereumAddOns::default())
.launch_with_fn(|builder| {
Expand Down
4 changes: 2 additions & 2 deletions crates/engine/local/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ use reth_evm::execute::BlockExecutorProvider;
use reth_payload_builder::PayloadBuilderHandle;
use reth_payload_primitives::{PayloadAttributesBuilder, PayloadTypes};
use reth_payload_validator::ExecutionPayloadValidator;
use reth_provider::{providers::BlockchainProviderFactory, ChainSpecProvider, ProviderFactory};
use reth_provider::{providers::BlockchainProvider2, ChainSpecProvider, ProviderFactory};
use reth_prune::PrunerWithFactory;
use reth_stages_api::MetricEventsSender;
use tokio::sync::mpsc::UnboundedSender;
Expand Down Expand Up @@ -66,7 +66,7 @@ where
consensus: Arc<dyn Consensus>,
executor_factory: impl BlockExecutorProvider,
provider: ProviderFactory<N>,
blockchain_db: BlockchainProviderFactory<N>,
blockchain_db: BlockchainProvider2<N>,
pruner: PrunerWithFactory<ProviderFactory<N>>,
payload_builder: PayloadBuilderHandle<N::Engine>,
tree_config: TreeConfig,
Expand Down
15 changes: 6 additions & 9 deletions crates/engine/service/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ use reth_network_p2p::BlockClient;
use reth_node_types::NodeTypesWithEngine;
use reth_payload_builder::PayloadBuilderHandle;
use reth_payload_validator::ExecutionPayloadValidator;
use reth_provider::{providers::BlockchainProviderFactory, ProviderFactory};
use reth_provider::{providers::BlockchainProvider2, ProviderFactory};
use reth_prune::PrunerWithFactory;
use reth_stages_api::{MetricEventsSender, Pipeline};
use reth_tasks::TaskSpawner;
Expand Down Expand Up @@ -73,7 +73,7 @@ where
pipeline: Pipeline<N>,
pipeline_task_spawner: Box<dyn TaskSpawner>,
provider: ProviderFactory<N>,
blockchain_db: BlockchainProviderFactory<N>,
blockchain_db: BlockchainProvider2<N>,
pruner: PrunerWithFactory<ProviderFactory<N>>,
payload_builder: PayloadBuilderHandle<N::Engine>,
tree_config: TreeConfig,
Expand Down Expand Up @@ -152,8 +152,7 @@ mod tests {
use reth_network_p2p::test_utils::TestFullBlockClient;
use reth_primitives::SealedHeader;
use reth_provider::{
providers::BlockchainProviderFactory,
test_utils::create_test_provider_factory_with_chain_spec,
providers::BlockchainProvider2, test_utils::create_test_provider_factory_with_chain_spec,
};
use reth_prune::Pruner;
use reth_tasks::TokioTaskExecutor;
Expand Down Expand Up @@ -182,11 +181,9 @@ mod tests {
let provider_factory = create_test_provider_factory_with_chain_spec(chain_spec.clone());

let executor_factory = EthExecutorProvider::ethereum(chain_spec.clone());
let blockchain_db = BlockchainProviderFactory::with_latest(
provider_factory.clone(),
SealedHeader::default(),
)
.unwrap();
let blockchain_db =
BlockchainProvider2::with_latest(provider_factory.clone(), SealedHeader::default())
.unwrap();

let (_tx, rx) = watch::channel(FinishedExExHeight::NoExExs);
let pruner = Pruner::new_with_factory(provider_factory.clone(), vec![], 0, 0, None, rx);
Expand Down
4 changes: 2 additions & 2 deletions crates/ethereum/node/tests/e2e/dev.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use reth_node_builder::{
rpc::RethRpcAddOns, EngineNodeLauncher, FullNode, NodeBuilder, NodeConfig, NodeHandle,
};
use reth_node_ethereum::{node::EthereumAddOns, EthereumNode};
use reth_provider::{providers::BlockchainProviderFactory, CanonStateSubscriptions};
use reth_provider::{providers::BlockchainProvider2, CanonStateSubscriptions};
use reth_tasks::TaskManager;

#[tokio::test]
Expand All @@ -34,7 +34,7 @@ async fn can_run_dev_node_new_engine() -> eyre::Result<()> {
.with_dev(DevArgs { dev: true, ..Default::default() });
let NodeHandle { node, .. } = NodeBuilder::new(node_config.clone())
.testing_node(exec.clone())
.with_types_and_provider::<EthereumNode, BlockchainProviderFactory<_>>()
.with_types_and_provider::<EthereumNode, BlockchainProvider2<_>>()
.with_components(EthereumNode::components())
.with_add_ons(EthereumAddOns::default())
.launch_with_fn(|builder| {
Expand Down
33 changes: 17 additions & 16 deletions crates/ethereum/node/tests/it/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use reth_db::{
use reth_node_api::NodeTypesWithDBAdapter;
use reth_node_builder::{EngineNodeLauncher, FullNodeComponents, NodeBuilder, NodeConfig};
use reth_node_ethereum::node::{EthereumAddOns, EthereumNode};
use reth_provider::providers::BlockchainProviderFactory;
use reth_provider::providers::BlockchainProvider2;
use reth_tasks::TaskManager;

#[test]
Expand Down Expand Up @@ -47,21 +47,22 @@ async fn test_eth_launcher() {
let tasks = TaskManager::current();
let config = NodeConfig::test();
let db = create_test_rw_db();
let _builder = NodeBuilder::new(config)
.with_database(db)
.with_types_and_provider::<EthereumNode, BlockchainProviderFactory<
NodeTypesWithDBAdapter<EthereumNode, Arc<TempDatabase<DatabaseEnv>>>,
>>()
.with_components(EthereumNode::components())
.with_add_ons(EthereumAddOns::default())
.launch_with_fn(|builder| {
let launcher = EngineNodeLauncher::new(
tasks.executor(),
builder.config.datadir(),
Default::default(),
);
builder.launch_with(launcher)
});
let _builder =
NodeBuilder::new(config)
.with_database(db)
.with_types_and_provider::<EthereumNode, BlockchainProvider2<
NodeTypesWithDBAdapter<EthereumNode, Arc<TempDatabase<DatabaseEnv>>>,
>>()
.with_components(EthereumNode::components())
.with_add_ons(EthereumAddOns::default())
.launch_with_fn(|builder| {
let launcher = EngineNodeLauncher::new(
tasks.executor(),
builder.config.datadir(),
Default::default(),
);
builder.launch_with(launcher)
});
}

#[test]
Expand Down
14 changes: 7 additions & 7 deletions crates/exex/exex/src/manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -642,8 +642,8 @@ mod tests {
use reth_evm_ethereum::execute::EthExecutorProvider;
use reth_primitives::SealedBlockWithSenders;
use reth_provider::{
providers::BlockchainProviderFactory, test_utils::create_test_provider_factory,
BlockReader, BlockWriter, Chain, DatabaseProviderFactory, TransactionVariant,
providers::BlockchainProvider2, test_utils::create_test_provider_factory, BlockReader,
BlockWriter, Chain, DatabaseProviderFactory, TransactionVariant,
};
use reth_testing_utils::generators::{self, random_block, BlockParams};

Expand Down Expand Up @@ -1019,7 +1019,7 @@ mod tests {
async fn exex_handle_new() {
let provider_factory = create_test_provider_factory();
init_genesis(&provider_factory).unwrap();
let provider = BlockchainProviderFactory::new(provider_factory).unwrap();
let provider = BlockchainProvider2::new(provider_factory).unwrap();

let temp_dir = tempfile::tempdir().unwrap();
let wal = Wal::new(temp_dir.path()).unwrap();
Expand Down Expand Up @@ -1074,7 +1074,7 @@ mod tests {
async fn test_notification_if_finished_height_gt_chain_tip() {
let provider_factory = create_test_provider_factory();
init_genesis(&provider_factory).unwrap();
let provider = BlockchainProviderFactory::new(provider_factory).unwrap();
let provider = BlockchainProvider2::new(provider_factory).unwrap();

let temp_dir = tempfile::tempdir().unwrap();
let wal = Wal::new(temp_dir.path()).unwrap();
Expand Down Expand Up @@ -1124,7 +1124,7 @@ mod tests {
async fn test_sends_chain_reorged_notification() {
let provider_factory = create_test_provider_factory();
init_genesis(&provider_factory).unwrap();
let provider = BlockchainProviderFactory::new(provider_factory).unwrap();
let provider = BlockchainProvider2::new(provider_factory).unwrap();

let temp_dir = tempfile::tempdir().unwrap();
let wal = Wal::new(temp_dir.path()).unwrap();
Expand Down Expand Up @@ -1167,7 +1167,7 @@ mod tests {
async fn test_sends_chain_reverted_notification() {
let provider_factory = create_test_provider_factory();
init_genesis(&provider_factory).unwrap();
let provider = BlockchainProviderFactory::new(provider_factory).unwrap();
let provider = BlockchainProvider2::new(provider_factory).unwrap();

let temp_dir = tempfile::tempdir().unwrap();
let wal = Wal::new(temp_dir.path()).unwrap();
Expand Down Expand Up @@ -1227,7 +1227,7 @@ mod tests {
provider_rw.insert_block(block.clone()).unwrap();
provider_rw.commit().unwrap();

let provider = BlockchainProviderFactory::new(provider_factory).unwrap();
let provider = BlockchainProvider2::new(provider_factory).unwrap();

let temp_dir = tempfile::tempdir().unwrap();
let wal = Wal::new(temp_dir.path()).unwrap();
Expand Down
12 changes: 6 additions & 6 deletions crates/exex/exex/src/notifications.rs
Original file line number Diff line number Diff line change
Expand Up @@ -378,8 +378,8 @@ mod tests {
use reth_evm_ethereum::execute::EthExecutorProvider;
use reth_primitives::Block;
use reth_provider::{
providers::BlockchainProviderFactory, test_utils::create_test_provider_factory,
BlockWriter, Chain, DatabaseProviderFactory,
providers::BlockchainProvider2, test_utils::create_test_provider_factory, BlockWriter,
Chain, DatabaseProviderFactory,
};
use reth_testing_utils::generators::{self, random_block, BlockParams};
use tokio::sync::mpsc;
Expand All @@ -397,7 +397,7 @@ mod tests {
.block(genesis_hash.into())?
.ok_or_else(|| eyre::eyre!("genesis block not found"))?;

let provider = BlockchainProviderFactory::new(provider_factory.clone())?;
let provider = BlockchainProvider2::new(provider_factory.clone())?;

let node_head_block = random_block(
&mut rng,
Expand Down Expand Up @@ -478,7 +478,7 @@ mod tests {
.block(genesis_hash.into())?
.ok_or_else(|| eyre::eyre!("genesis block not found"))?;

let provider = BlockchainProviderFactory::new(provider_factory)?;
let provider = BlockchainProvider2::new(provider_factory)?;

let node_head =
Head { number: genesis_block.number, hash: genesis_hash, ..Default::default() };
Expand Down Expand Up @@ -535,7 +535,7 @@ mod tests {
.block(genesis_hash.into())?
.ok_or_else(|| eyre::eyre!("genesis block not found"))?;

let provider = BlockchainProviderFactory::new(provider_factory)?;
let provider = BlockchainProvider2::new(provider_factory)?;

let node_head_block = random_block(
&mut rng,
Expand Down Expand Up @@ -635,7 +635,7 @@ mod tests {
.block(genesis_hash.into())?
.ok_or_else(|| eyre::eyre!("genesis block not found"))?;

let provider = BlockchainProviderFactory::new(provider_factory)?;
let provider = BlockchainProvider2::new(provider_factory)?;

let exex_head_block = random_block(
&mut rng,
Expand Down
6 changes: 2 additions & 4 deletions crates/node/builder/src/launch/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,7 @@ use reth_node_metrics::{
};
use reth_primitives::Head;
use reth_provider::{
providers::{
BlockchainProvider, BlockchainProviderFactory, ProviderNodeTypes, StaticFileProvider,
},
providers::{BlockchainProvider, BlockchainProvider2, ProviderNodeTypes, StaticFileProvider},
BlockHashReader, CanonStateNotificationSender, ChainSpecProvider, ProviderFactory,
ProviderResult, StageCheckpointReader, StateProviderFactory, StaticFileProviderFactory,
TreeViewer,
Expand Down Expand Up @@ -80,7 +78,7 @@ impl<N: NodeTypesWithDB> WithTree for BlockchainProvider<N> {
}
}

impl<N: NodeTypesWithDB> WithTree for BlockchainProviderFactory<N> {
impl<N: NodeTypesWithDB> WithTree for BlockchainProvider2<N> {
fn set_tree(self, _tree: Arc<dyn TreeViewer>) -> Self {
self
}
Expand Down
6 changes: 3 additions & 3 deletions crates/node/builder/src/launch/engine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ use reth_node_core::{
use reth_node_events::{cl::ConsensusLayerHealthEvents, node};
use reth_payload_primitives::PayloadBuilder;
use reth_primitives::EthereumHardforks;
use reth_provider::providers::{BlockchainProviderFactory, ProviderNodeTypes};
use reth_provider::providers::{BlockchainProvider2, ProviderNodeTypes};
use reth_tasks::TaskExecutor;
use reth_tokio_util::EventSender;
use reth_tracing::tracing::{debug, error, info};
Expand Down Expand Up @@ -71,7 +71,7 @@ impl EngineNodeLauncher {
impl<Types, T, CB, AO> LaunchNode<NodeBuilderWithComponents<T, CB, AO>> for EngineNodeLauncher
where
Types: ProviderNodeTypes + NodeTypesWithEngine,
T: FullNodeTypes<Types = Types, Provider = BlockchainProviderFactory<Types>>,
T: FullNodeTypes<Types = Types, Provider = BlockchainProvider2<Types>>,
CB: NodeComponentsBuilder<T>,
AO: RethRpcAddOns<NodeAdapter<T, CB::Components>>,
LocalPayloadAttributesBuilder<Types::ChainSpec>: PayloadAttributesBuilder<
Expand Down Expand Up @@ -130,7 +130,7 @@ where
// passing FullNodeTypes as type parameter here so that we can build
// later the components.
.with_blockchain_db::<T, _>(move |provider_factory| {
Ok(BlockchainProviderFactory::new(provider_factory)?)
Ok(BlockchainProvider2::new(provider_factory)?)
}, tree_config, canon_state_notification_sender)?
.with_components(components_builder, on_component_initialized).await?;

Expand Down
4 changes: 2 additions & 2 deletions crates/optimism/bin/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use clap::Parser;
use reth_node_builder::{engine_tree_config::TreeConfig, EngineNodeLauncher};
use reth_optimism_cli::{chainspec::OpChainSpecParser, Cli};
use reth_optimism_node::{args::RollupArgs, node::OptimismAddOns, OptimismNode};
use reth_provider::providers::BlockchainProviderFactory;
use reth_provider::providers::BlockchainProvider2;

use tracing as _;

Expand All @@ -31,7 +31,7 @@ fn main() {
.with_persistence_threshold(rollup_args.persistence_threshold)
.with_memory_block_buffer_target(rollup_args.memory_block_buffer_target);
let handle = builder
.with_types_and_provider::<OptimismNode, BlockchainProviderFactory<_>>()
.with_types_and_provider::<OptimismNode, BlockchainProvider2<_>>()
.with_components(OptimismNode::components(rollup_args))
.with_add_ons(OptimismAddOns::new(sequencer_http_arg))
.launch_with_fn(|builder| {
Expand Down
Loading

0 comments on commit d7d43e3

Please sign in to comment.