chore(blockchain-tree): replace reth-primitives with alloy-eips (#11276)

Signed-off-by: Abhishekkochar <abhishekkochar2@gmail.com>
This commit is contained in:
Abhishek kochar
2024-09-28 18:48:17 +08:00
committed by GitHub
parent 50265b15db
commit 50461281e7
10 changed files with 17 additions and 9 deletions

1
Cargo.lock generated
View File

@ -6394,6 +6394,7 @@ name = "reth-blockchain-tree"
version = "1.0.7" version = "1.0.7"
dependencies = [ dependencies = [
"alloy-consensus", "alloy-consensus",
"alloy-eips",
"alloy-genesis", "alloy-genesis",
"alloy-primitives", "alloy-primitives",
"aquamarine", "aquamarine",

View File

@ -32,6 +32,7 @@ reth-node-types.workspace = true
# ethereum # ethereum
alloy-primitives.workspace = true alloy-primitives.workspace = true
alloy-eips.workspace = true
# common # common
parking_lot.workspace = true parking_lot.workspace = true

View File

@ -183,8 +183,9 @@ impl BlockBuffer {
#[cfg(test)] #[cfg(test)]
mod tests { mod tests {
use crate::BlockBuffer; use crate::BlockBuffer;
use alloy_eips::BlockNumHash;
use alloy_primitives::BlockHash; use alloy_primitives::BlockHash;
use reth_primitives::{BlockNumHash, SealedBlockWithSenders}; use reth_primitives::SealedBlockWithSenders;
use reth_testing_utils::generators::{self, random_block, BlockParams, Rng}; use reth_testing_utils::generators::{self, random_block, BlockParams, Rng};
use std::collections::HashMap; use std::collections::HashMap;

View File

@ -2,10 +2,11 @@
use super::state::SidechainId; use super::state::SidechainId;
use crate::canonical_chain::CanonicalChain; use crate::canonical_chain::CanonicalChain;
use alloy_eips::BlockNumHash;
use alloy_primitives::{BlockHash, BlockNumber}; use alloy_primitives::{BlockHash, BlockNumber};
use linked_hash_set::LinkedHashSet; use linked_hash_set::LinkedHashSet;
use reth_execution_types::Chain; use reth_execution_types::Chain;
use reth_primitives::{BlockNumHash, SealedBlockWithSenders}; use reth_primitives::SealedBlockWithSenders;
use std::collections::{btree_map, hash_map, BTreeMap, BTreeSet, HashMap, HashSet}; use std::collections::{btree_map, hash_map, BTreeMap, BTreeSet, HashMap, HashSet};
/// Internal indices of the blocks and chains. /// Internal indices of the blocks and chains.

View File

@ -5,6 +5,7 @@ use crate::{
state::{SidechainId, TreeState}, state::{SidechainId, TreeState},
AppendableChain, BlockIndices, BlockchainTreeConfig, ExecutionData, TreeExternals, AppendableChain, BlockIndices, BlockchainTreeConfig, ExecutionData, TreeExternals,
}; };
use alloy_eips::{BlockNumHash, ForkBlock};
use alloy_primitives::{BlockHash, BlockNumber, B256, U256}; use alloy_primitives::{BlockHash, BlockNumber, B256, U256};
use reth_blockchain_tree_api::{ use reth_blockchain_tree_api::{
error::{BlockchainTreeError, CanonicalError, InsertBlockError, InsertBlockErrorKind}, error::{BlockchainTreeError, CanonicalError, InsertBlockError, InsertBlockErrorKind},
@ -16,8 +17,8 @@ use reth_execution_errors::{BlockExecutionError, BlockValidationError};
use reth_execution_types::{Chain, ExecutionOutcome}; use reth_execution_types::{Chain, ExecutionOutcome};
use reth_node_types::NodeTypesWithDB; use reth_node_types::NodeTypesWithDB;
use reth_primitives::{ use reth_primitives::{
BlockNumHash, EthereumHardfork, ForkBlock, GotExpected, Hardforks, Receipt, SealedBlock, EthereumHardfork, GotExpected, Hardforks, Receipt, SealedBlock, SealedBlockWithSenders,
SealedBlockWithSenders, SealedHeader, StaticFileSegment, SealedHeader, StaticFileSegment,
}; };
use reth_provider::{ use reth_provider::{
providers::ProviderNodeTypes, BlockExecutionWriter, BlockNumReader, BlockWriter, providers::ProviderNodeTypes, BlockExecutionWriter, BlockNumReader, BlockWriter,

View File

@ -1,7 +1,7 @@
//! [`ExecutionDataProvider`] implementations used by the tree. //! [`ExecutionDataProvider`] implementations used by the tree.
use alloy_eips::ForkBlock;
use alloy_primitives::{BlockHash, BlockNumber}; use alloy_primitives::{BlockHash, BlockNumber};
use reth_primitives::ForkBlock;
use reth_provider::{BlockExecutionForkProvider, ExecutionDataProvider, ExecutionOutcome}; use reth_provider::{BlockExecutionForkProvider, ExecutionDataProvider, ExecutionOutcome};
use std::collections::BTreeMap; use std::collections::BTreeMap;

View File

@ -1,5 +1,5 @@
use alloy_eips::BlockNumHash;
use alloy_primitives::{BlockHash, BlockNumber}; use alloy_primitives::{BlockHash, BlockNumber};
use reth_primitives::BlockNumHash;
use std::collections::BTreeMap; use std::collections::BTreeMap;
/// This keeps track of (non-finalized) blocks of the canonical chain. /// This keeps track of (non-finalized) blocks of the canonical chain.

View File

@ -5,6 +5,7 @@
use super::externals::TreeExternals; use super::externals::TreeExternals;
use crate::BundleStateDataRef; use crate::BundleStateDataRef;
use alloy_eips::ForkBlock;
use alloy_primitives::{BlockHash, BlockNumber, U256}; use alloy_primitives::{BlockHash, BlockNumber, U256};
use reth_blockchain_tree_api::{ use reth_blockchain_tree_api::{
error::{BlockchainTreeError, InsertBlockErrorKind}, error::{BlockchainTreeError, InsertBlockErrorKind},
@ -14,7 +15,7 @@ use reth_consensus::{Consensus, ConsensusError, PostExecutionInput};
use reth_evm::execute::{BlockExecutorProvider, Executor}; use reth_evm::execute::{BlockExecutorProvider, Executor};
use reth_execution_errors::BlockExecutionError; use reth_execution_errors::BlockExecutionError;
use reth_execution_types::{Chain, ExecutionOutcome}; use reth_execution_types::{Chain, ExecutionOutcome};
use reth_primitives::{ForkBlock, GotExpected, SealedBlockWithSenders, SealedHeader}; use reth_primitives::{GotExpected, SealedBlockWithSenders, SealedHeader};
use reth_provider::{ use reth_provider::{
providers::{BundleStateProvider, ConsistentDbView, ProviderNodeTypes}, providers::{BundleStateProvider, ConsistentDbView, ProviderNodeTypes},
FullExecutionDataProvider, ProviderError, StateRootProvider, TryIntoHistoricalStateProvider, FullExecutionDataProvider, ProviderError, StateRootProvider, TryIntoHistoricalStateProvider,

View File

@ -1,3 +1,4 @@
use alloy_eips::BlockNumHash;
use alloy_primitives::{BlockHash, BlockNumber}; use alloy_primitives::{BlockHash, BlockNumber};
use reth_blockchain_tree_api::{ use reth_blockchain_tree_api::{
self, self,
@ -5,7 +6,7 @@ use reth_blockchain_tree_api::{
BlockValidationKind, BlockchainTreeEngine, BlockchainTreeViewer, CanonicalOutcome, BlockValidationKind, BlockchainTreeEngine, BlockchainTreeViewer, CanonicalOutcome,
InsertPayloadOk, InsertPayloadOk,
}; };
use reth_primitives::{BlockNumHash, Receipt, SealedBlock, SealedBlockWithSenders, SealedHeader}; use reth_primitives::{Receipt, SealedBlock, SealedBlockWithSenders, SealedHeader};
use reth_provider::{ use reth_provider::{
BlockchainTreePendingStateProvider, CanonStateNotificationSender, CanonStateNotifications, BlockchainTreePendingStateProvider, CanonStateNotificationSender, CanonStateNotifications,
CanonStateSubscriptions, FullExecutionDataProvider, CanonStateSubscriptions, FullExecutionDataProvider,

View File

@ -1,6 +1,7 @@
//! Wrapper around `BlockchainTree` that allows for it to be shared. //! Wrapper around `BlockchainTree` that allows for it to be shared.
use super::BlockchainTree; use super::BlockchainTree;
use alloy_eips::BlockNumHash;
use alloy_primitives::{BlockHash, BlockNumber}; use alloy_primitives::{BlockHash, BlockNumber};
use parking_lot::RwLock; use parking_lot::RwLock;
use reth_blockchain_tree_api::{ use reth_blockchain_tree_api::{
@ -10,7 +11,7 @@ use reth_blockchain_tree_api::{
}; };
use reth_evm::execute::BlockExecutorProvider; use reth_evm::execute::BlockExecutorProvider;
use reth_node_types::NodeTypesWithDB; use reth_node_types::NodeTypesWithDB;
use reth_primitives::{BlockNumHash, Receipt, SealedBlock, SealedBlockWithSenders, SealedHeader}; use reth_primitives::{Receipt, SealedBlock, SealedBlockWithSenders, SealedHeader};
use reth_provider::{ use reth_provider::{
providers::ProviderNodeTypes, BlockchainTreePendingStateProvider, CanonStateSubscriptions, providers::ProviderNodeTypes, BlockchainTreePendingStateProvider, CanonStateSubscriptions,
FullExecutionDataProvider, ProviderError, FullExecutionDataProvider, ProviderError,