Skip to content

Commit

Permalink
chore(blockchain-tree): replace reth-primitives with alloy-eips
Browse files Browse the repository at this point in the history
Signed-off-by: Abhishekkochar <[email protected]>
  • Loading branch information
Abhishekkochar committed Sep 27, 2024
1 parent 37b0c56 commit 1a5148b
Show file tree
Hide file tree
Showing 10 changed files with 17 additions and 9 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions crates/blockchain-tree/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ reth-node-types.workspace = true

# ethereum
alloy-primitives.workspace = true
alloy-eips.workspace = true

# common
parking_lot.workspace = true
Expand Down
3 changes: 2 additions & 1 deletion crates/blockchain-tree/src/block_buffer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,9 @@ impl BlockBuffer {
#[cfg(test)]
mod tests {
use crate::BlockBuffer;
use alloy_eips::BlockNumHash;
use alloy_primitives::BlockHash;
use reth_primitives::{BlockNumHash, SealedBlockWithSenders};
use reth_primitives::SealedBlockWithSenders;
use reth_testing_utils::generators::{self, random_block, BlockParams, Rng};
use std::collections::HashMap;

Expand Down
3 changes: 2 additions & 1 deletion crates/blockchain-tree/src/block_indices.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@

use super::state::SidechainId;
use crate::canonical_chain::CanonicalChain;
use alloy_eips::BlockNumHash;
use alloy_primitives::{BlockHash, BlockNumber};
use linked_hash_set::LinkedHashSet;
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};

/// Internal indices of the blocks and chains.
Expand Down
5 changes: 3 additions & 2 deletions crates/blockchain-tree/src/blockchain_tree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ use crate::{
state::{SidechainId, TreeState},
AppendableChain, BlockIndices, BlockchainTreeConfig, ExecutionData, TreeExternals,
};
use alloy_eips::{BlockNumHash, ForkBlock};
use alloy_primitives::{BlockHash, BlockNumber, B256, U256};
use reth_blockchain_tree_api::{
error::{BlockchainTreeError, CanonicalError, InsertBlockError, InsertBlockErrorKind},
Expand All @@ -16,8 +17,8 @@ use reth_execution_errors::{BlockExecutionError, BlockValidationError};
use reth_execution_types::{Chain, ExecutionOutcome};
use reth_node_types::NodeTypesWithDB;
use reth_primitives::{
BlockNumHash, EthereumHardfork, ForkBlock, GotExpected, Hardforks, Receipt, SealedBlock,
SealedBlockWithSenders, SealedHeader, StaticFileSegment,
EthereumHardfork, GotExpected, Hardforks, Receipt, SealedBlock, SealedBlockWithSenders,
SealedHeader, StaticFileSegment,
};
use reth_provider::{
providers::ProviderNodeTypes, BlockExecutionWriter, BlockNumReader, BlockWriter,
Expand Down
2 changes: 1 addition & 1 deletion crates/blockchain-tree/src/bundle.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//! [`ExecutionDataProvider`] implementations used by the tree.

use alloy_eips::ForkBlock;
use alloy_primitives::{BlockHash, BlockNumber};
use reth_primitives::ForkBlock;
use reth_provider::{BlockExecutionForkProvider, ExecutionDataProvider, ExecutionOutcome};
use std::collections::BTreeMap;

Expand Down
2 changes: 1 addition & 1 deletion crates/blockchain-tree/src/canonical_chain.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use alloy_eips::BlockNumHash;
use alloy_primitives::{BlockHash, BlockNumber};
use reth_primitives::BlockNumHash;
use std::collections::BTreeMap;

/// This keeps track of (non-finalized) blocks of the canonical chain.
Expand Down
3 changes: 2 additions & 1 deletion crates/blockchain-tree/src/chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

use super::externals::TreeExternals;
use crate::BundleStateDataRef;
use alloy_eips::ForkBlock;
use alloy_primitives::{BlockHash, BlockNumber, U256};
use reth_blockchain_tree_api::{
error::{BlockchainTreeError, InsertBlockErrorKind},
Expand All @@ -14,7 +15,7 @@ use reth_consensus::{Consensus, ConsensusError, PostExecutionInput};
use reth_evm::execute::{BlockExecutorProvider, Executor};
use reth_execution_errors::BlockExecutionError;
use reth_execution_types::{Chain, ExecutionOutcome};
use reth_primitives::{ForkBlock, GotExpected, SealedBlockWithSenders, SealedHeader};
use reth_primitives::{GotExpected, SealedBlockWithSenders, SealedHeader};
use reth_provider::{
providers::{BundleStateProvider, ConsistentDbView, ProviderNodeTypes},
FullExecutionDataProvider, ProviderError, StateRootProvider, TryIntoHistoricalStateProvider,
Expand Down
3 changes: 2 additions & 1 deletion crates/blockchain-tree/src/noop.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
use alloy_eips::BlockNumHash;
use alloy_primitives::{BlockHash, BlockNumber};
use reth_blockchain_tree_api::{
self,
error::{BlockchainTreeError, CanonicalError, InsertBlockError, ProviderError},
BlockValidationKind, BlockchainTreeEngine, BlockchainTreeViewer, CanonicalOutcome,
InsertPayloadOk,
};
use reth_primitives::{BlockNumHash, Receipt, SealedBlock, SealedBlockWithSenders, SealedHeader};
use reth_primitives::{Receipt, SealedBlock, SealedBlockWithSenders, SealedHeader};
use reth_provider::{
BlockchainTreePendingStateProvider, CanonStateNotificationSender, CanonStateNotifications,
CanonStateSubscriptions, FullExecutionDataProvider,
Expand Down
3 changes: 2 additions & 1 deletion crates/blockchain-tree/src/shareable.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
//! Wrapper around `BlockchainTree` that allows for it to be shared.

use super::BlockchainTree;
use alloy_eips::BlockNumHash;
use alloy_primitives::{BlockHash, BlockNumber};
use parking_lot::RwLock;
use reth_blockchain_tree_api::{
Expand All @@ -10,7 +11,7 @@ use reth_blockchain_tree_api::{
};
use reth_evm::execute::BlockExecutorProvider;
use reth_node_types::NodeTypesWithDB;
use reth_primitives::{BlockNumHash, Receipt, SealedBlock, SealedBlockWithSenders, SealedHeader};
use reth_primitives::{Receipt, SealedBlock, SealedBlockWithSenders, SealedHeader};
use reth_provider::{
providers::ProviderNodeTypes, BlockchainTreePendingStateProvider, CanonStateSubscriptions,
FullExecutionDataProvider, ProviderError,
Expand Down

0 comments on commit 1a5148b

Please sign in to comment.