Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

storage: clean up reth-primitives import #10761

Merged
merged 4 commits into from
Sep 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 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/storage/db-common/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ reth-node-types.workspace = true

# eth
alloy-genesis.workspace = true
alloy-primitives.workspace = true

# misc
eyre.workspace = true
Expand Down
5 changes: 2 additions & 3 deletions crates/storage/db-common/src/init.rs
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
//! Reth genesis initialization utility functions.

use alloy_genesis::GenesisAccount;
use alloy_primitives::{Address, B256, U256};
use reth_chainspec::ChainSpec;
use reth_codecs::Compact;
use reth_config::config::EtlConfig;
use reth_db::tables;
use reth_db_api::{database::Database, transaction::DbTxMut, DatabaseError};
use reth_etl::Collector;
use reth_node_types::NodeTypesWithDB;
use reth_primitives::{
Account, Address, Bytecode, Receipts, StaticFileSegment, StorageEntry, B256, U256,
};
use reth_primitives::{Account, Bytecode, Receipts, StaticFileSegment, StorageEntry};
use reth_provider::{
errors::provider::ProviderResult,
providers::{StaticFileProvider, StaticFileWriter},
Expand Down
6 changes: 5 additions & 1 deletion crates/storage/errors/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,14 @@ repository.workspace = true
workspace = true

[dependencies]
alloy-rlp.workspace = true
# reth
reth-primitives.workspace = true
reth-fs-util.workspace = true

# alloy
alloy-primitives.workspace = true
alloy-rlp.workspace = true

# misc
derive_more.workspace = true

Expand Down
6 changes: 2 additions & 4 deletions crates/storage/errors/src/provider.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
use crate::{db::DatabaseError, lockfile::StorageLockError, writer::UnifiedStorageWriterError};
use alloy_primitives::{Address, BlockHash, BlockNumber, TxNumber, B256, U256};
use derive_more::Display;
use reth_primitives::{
Address, BlockHash, BlockHashOrNumber, BlockNumber, GotExpected, StaticFileSegment,
TxHashOrNumber, TxNumber, B256, U256,
};
use reth_primitives::{BlockHashOrNumber, GotExpected, StaticFileSegment, TxHashOrNumber};

#[cfg(feature = "std")]
use std::path::PathBuf;
Expand Down
3 changes: 3 additions & 0 deletions crates/storage/storage-api/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,7 @@ reth-stages-types.workspace = true
reth-storage-errors.workspace = true
reth-trie.workspace = true

# alloy
alloy-primitives.workspace = true

auto_impl.workspace = true
3 changes: 2 additions & 1 deletion crates/storage/storage-api/src/account.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use alloy_primitives::{Address, BlockNumber};
use auto_impl::auto_impl;
use reth_db_models::AccountBeforeTx;
use reth_primitives::{Account, Address, BlockNumber};
use reth_primitives::Account;
use reth_storage_errors::provider::ProviderResult;
use std::{
collections::{BTreeMap, BTreeSet},
Expand Down
5 changes: 3 additions & 2 deletions crates/storage/storage-api/src/block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@ use crate::{
BlockIdReader, BlockNumReader, HeaderProvider, ReceiptProvider, ReceiptProviderIdExt,
RequestsProvider, TransactionVariant, TransactionsProvider, WithdrawalsProvider,
};
use alloy_primitives::{BlockNumber, B256};
use reth_db_models::StoredBlockBodyIndices;
use reth_primitives::{
Block, BlockHashOrNumber, BlockId, BlockNumber, BlockNumberOrTag, BlockWithSenders, Header,
Receipt, SealedBlock, SealedBlockWithSenders, SealedHeader, B256,
Block, BlockHashOrNumber, BlockId, BlockNumberOrTag, BlockWithSenders, Header, Receipt,
SealedBlock, SealedBlockWithSenders, SealedHeader,
};
use reth_storage_errors::provider::ProviderResult;
use std::ops::RangeInclusive;
Expand Down
3 changes: 2 additions & 1 deletion crates/storage/storage-api/src/block_hash.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use reth_primitives::{BlockHashOrNumber, BlockNumber, B256};
use alloy_primitives::{BlockNumber, B256};
use reth_primitives::BlockHashOrNumber;
use reth_storage_errors::provider::ProviderResult;

/// Client trait for fetching block hashes by number.
Expand Down
3 changes: 2 additions & 1 deletion crates/storage/storage-api/src/block_id.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use crate::BlockHashReader;
use alloy_primitives::{BlockNumber, B256};
use reth_chainspec::ChainInfo;
use reth_primitives::{BlockHashOrNumber, BlockId, BlockNumber, BlockNumberOrTag, B256};
use reth_primitives::{BlockHashOrNumber, BlockId, BlockNumberOrTag};
use reth_storage_errors::provider::{ProviderError, ProviderResult};

/// Client trait for getting important block numbers (such as the latest block number), converting
Expand Down
3 changes: 2 additions & 1 deletion crates/storage/storage-api/src/header.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use reth_primitives::{BlockHash, BlockHashOrNumber, BlockNumber, Header, SealedHeader, U256};
use alloy_primitives::{BlockHash, BlockNumber, U256};
use reth_primitives::{BlockHashOrNumber, Header, SealedHeader};
use reth_storage_errors::provider::ProviderResult;
use std::ops::RangeBounds;

Expand Down
2 changes: 1 addition & 1 deletion crates/storage/storage-api/src/noop.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
//! Various noop implementations for traits.

use crate::{BlockHashReader, BlockNumReader};
use alloy_primitives::{BlockNumber, B256};
use reth_chainspec::ChainInfo;
use reth_primitives::{BlockNumber, B256};
use reth_storage_errors::provider::ProviderResult;

/// Supports various api interfaces for testing purposes.
Expand Down
5 changes: 2 additions & 3 deletions crates/storage/storage-api/src/receipts.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use crate::BlockIdReader;
use reth_primitives::{
BlockHashOrNumber, BlockId, BlockNumber, BlockNumberOrTag, Receipt, TxHash, TxNumber,
};
use alloy_primitives::{BlockNumber, TxHash, TxNumber};
use reth_primitives::{BlockHashOrNumber, BlockId, BlockNumberOrTag, Receipt};
use reth_storage_errors::provider::ProviderResult;
use std::ops::RangeBounds;

Expand Down
2 changes: 1 addition & 1 deletion crates/storage/storage-api/src/stage_checkpoint.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use reth_primitives::BlockNumber;
use alloy_primitives::BlockNumber;
use reth_stages_types::{StageCheckpoint, StageId};
use reth_storage_errors::provider::ProviderResult;

Expand Down
4 changes: 2 additions & 2 deletions crates/storage/storage-api/src/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ use super::{
AccountReader, BlockHashReader, BlockIdReader, StateProofProvider, StateRootProvider,
StorageRootProvider,
};
use alloy_primitives::{Address, BlockHash, BlockNumber, B256, U256};
use auto_impl::auto_impl;
use reth_execution_types::ExecutionOutcome;
use reth_primitives::{
Address, BlockHash, BlockId, BlockNumHash, BlockNumber, BlockNumberOrTag, Bytecode, StorageKey,
StorageValue, B256, KECCAK_EMPTY, U256,
BlockId, BlockNumHash, BlockNumberOrTag, Bytecode, StorageKey, StorageValue, KECCAK_EMPTY,
};
use reth_storage_errors::provider::{ProviderError, ProviderResult};

Expand Down
3 changes: 2 additions & 1 deletion crates/storage/storage-api/src/storage.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use reth_primitives::{Address, BlockNumber, StorageEntry, B256};
use alloy_primitives::{Address, BlockNumber, B256};
use reth_primitives::StorageEntry;
use reth_storage_errors::provider::ProviderResult;
use std::{
collections::{BTreeMap, BTreeSet},
Expand Down
4 changes: 2 additions & 2 deletions crates/storage/storage-api/src/transactions.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use crate::{BlockNumReader, BlockReader};
use alloy_primitives::{Address, BlockNumber, TxHash, TxNumber};
use reth_primitives::{
Address, BlockHashOrNumber, BlockNumber, TransactionMeta, TransactionSigned,
TransactionSignedNoHash, TxHash, TxNumber,
BlockHashOrNumber, TransactionMeta, TransactionSigned, TransactionSignedNoHash,
};
use reth_storage_errors::provider::{ProviderError, ProviderResult};
use std::ops::{Range, RangeBounds, RangeInclusive};
Expand Down
2 changes: 1 addition & 1 deletion crates/storage/storage-api/src/trie.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use reth_primitives::{Address, Bytes, B256};
use alloy_primitives::{Address, Bytes, B256};
use reth_storage_errors::provider::ProviderResult;
use reth_trie::{
prefix_set::TriePrefixSetsMut, updates::TrieUpdates, AccountProof, HashedPostState,
Expand Down
Loading