Skip to content

Commit

Permalink
primitives: rm alloy BlockHashOrNumber reexport (paradigmxyz#12302)
Browse files Browse the repository at this point in the history
  • Loading branch information
tcoratger authored Nov 4, 2024
1 parent 56b7687 commit 566f2b4
Show file tree
Hide file tree
Showing 17 changed files with 30 additions and 30 deletions.
2 changes: 1 addition & 1 deletion bin/reth/src/commands/debug_cmd/execution.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
//! Command for debugging execution.
use crate::{args::NetworkArgs, utils::get_single_header};
use alloy_eips::BlockHashOrNumber;
use alloy_primitives::{BlockNumber, B256};
use clap::Parser;
use futures::{stream::select as stream_select, StreamExt};
Expand All @@ -23,7 +24,6 @@ use reth_network_api::NetworkInfo;
use reth_network_p2p::{headers::client::HeadersClient, BlockClient};
use reth_node_api::{NodeTypesWithDB, NodeTypesWithDBAdapter, NodeTypesWithEngine};
use reth_node_ethereum::EthExecutorProvider;
use reth_primitives::BlockHashOrNumber;
use reth_provider::{
BlockExecutionWriter, ChainSpecProvider, ProviderFactory, StageCheckpointReader,
};
Expand Down
2 changes: 1 addition & 1 deletion bin/reth/src/commands/debug_cmd/in_memory_merkle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ use crate::{
args::NetworkArgs,
utils::{get_single_body, get_single_header},
};
use alloy_eips::BlockHashOrNumber;
use backon::{ConstantBuilder, Retryable};
use clap::Parser;
use reth_chainspec::ChainSpec;
Expand All @@ -19,7 +20,6 @@ use reth_network::{BlockDownloaderProvider, NetworkHandle};
use reth_network_api::NetworkInfo;
use reth_node_api::{NodeTypesWithDB, NodeTypesWithEngine};
use reth_node_ethereum::EthExecutorProvider;
use reth_primitives::BlockHashOrNumber;
use reth_provider::{
writer::UnifiedStorageWriter, AccountExtReader, ChainSpecProvider, HashingWriter,
HeaderProvider, LatestStateProviderRef, OriginalValuesKnown, ProviderFactory,
Expand Down
2 changes: 1 addition & 1 deletion bin/reth/src/commands/debug_cmd/merkle.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
//! Command for debugging merkle trie calculation.
use crate::{args::NetworkArgs, utils::get_single_header};
use alloy_eips::BlockHashOrNumber;
use backon::{ConstantBuilder, Retryable};
use clap::Parser;
use reth_beacon_consensus::EthBeaconConsensus;
Expand All @@ -18,7 +19,6 @@ use reth_network_api::NetworkInfo;
use reth_network_p2p::full_block::FullBlockClient;
use reth_node_api::{NodeTypesWithDB, NodeTypesWithEngine};
use reth_node_ethereum::EthExecutorProvider;
use reth_primitives::BlockHashOrNumber;
use reth_provider::{
writer::UnifiedStorageWriter, BlockNumReader, BlockWriter, ChainSpecProvider,
DatabaseProviderFactory, HeaderProvider, LatestStateProviderRef, OriginalValuesKnown,
Expand Down
3 changes: 2 additions & 1 deletion crates/consensus/auto-seal/src/client.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
//! This includes download client implementations for auto sealing miners.
use crate::Storage;
use alloy_eips::BlockHashOrNumber;
use alloy_primitives::B256;
use reth_network_p2p::{
bodies::client::{BodiesClient, BodiesFut},
Expand All @@ -9,7 +10,7 @@ use reth_network_p2p::{
priority::Priority,
};
use reth_network_peers::{PeerId, WithPeerId};
use reth_primitives::{BlockBody, BlockHashOrNumber, Header};
use reth_primitives::{BlockBody, Header};
use std::fmt::Debug;
use tracing::{trace, warn};

Expand Down
6 changes: 3 additions & 3 deletions crates/consensus/auto-seal/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#![cfg_attr(not(test), warn(unused_crate_dependencies))]
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]

use alloy_eips::eip7685::Requests;
use alloy_eips::{eip1898::BlockHashOrNumber, eip7685::Requests};
use alloy_primitives::{BlockHash, BlockNumber, Bloom, B256, U256};
use reth_beacon_consensus::BeaconEngineMessage;
use reth_chainspec::{EthChainSpec, EthereumHardforks};
Expand All @@ -26,8 +26,8 @@ use reth_execution_errors::{
};
use reth_execution_types::ExecutionOutcome;
use reth_primitives::{
proofs, Block, BlockBody, BlockHashOrNumber, BlockWithSenders, Header, SealedBlock,
SealedHeader, TransactionSigned, Withdrawals,
proofs, Block, BlockBody, BlockWithSenders, Header, SealedBlock, SealedHeader,
TransactionSigned, Withdrawals,
};
use reth_provider::{BlockReaderIdExt, StateProviderFactory, StateRootProvider};
use reth_revm::database::StateProviderDatabase;
Expand Down
5 changes: 2 additions & 3 deletions crates/consensus/common/src/validation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -275,16 +275,15 @@ pub fn validate_against_parent_4844(
mod tests {
use super::*;
use alloy_consensus::{TxEip4844, EMPTY_OMMER_ROOT_HASH, EMPTY_ROOT_HASH};
use alloy_eips::eip4895::Withdrawal;
use alloy_eips::{eip4895::Withdrawal, BlockHashOrNumber};
use alloy_primitives::{
hex_literal::hex, Address, BlockHash, BlockNumber, Bytes, Parity, Sealable, U256,
};
use mockall::mock;
use rand::Rng;
use reth_chainspec::ChainSpecBuilder;
use reth_primitives::{
proofs, Account, BlockBody, BlockHashOrNumber, Signature, Transaction, TransactionSigned,
Withdrawals,
proofs, Account, BlockBody, Signature, Transaction, TransactionSigned, Withdrawals,
};
use reth_storage_api::{
errors::provider::ProviderResult, AccountReader, HeaderProvider, WithdrawalsProvider,
Expand Down
6 changes: 3 additions & 3 deletions crates/engine/local/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ workspace = true

[features]
optimism = [
"op-alloy-rpc-types-engine",
"reth-beacon-consensus/optimism",
"reth-provider/optimism"
"op-alloy-rpc-types-engine",
"reth-beacon-consensus/optimism",
"reth-provider/optimism",
]
2 changes: 1 addition & 1 deletion crates/evm/src/provider.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//! Provider trait for populating the EVM environment.
use crate::ConfigureEvmEnv;
use alloy_eips::eip1898::BlockHashOrNumber;
use alloy_eips::BlockHashOrNumber;
use reth_primitives::Header;
use reth_storage_errors::provider::ProviderResult;
use revm::primitives::{BlockEnv, CfgEnv, CfgEnvWithHandlerCfg, SpecId};
Expand Down
3 changes: 2 additions & 1 deletion crates/net/eth-wire-types/src/blocks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,10 @@ mod tests {
HeadersDirection,
};
use alloy_consensus::TxLegacy;
use alloy_eips::BlockHashOrNumber;
use alloy_primitives::{hex, Parity, TxKind, U256};
use alloy_rlp::{Decodable, Encodable};
use reth_primitives::{BlockHashOrNumber, Header, Signature, Transaction, TransactionSigned};
use reth_primitives::{Header, Signature, Transaction, TransactionSigned};
use std::str::FromStr;

use super::BlockBody;
Expand Down
3 changes: 2 additions & 1 deletion crates/node/core/src/node_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@ use reth_network_p2p::headers::client::HeadersClient;
use serde::{de::DeserializeOwned, Serialize};
use std::{fs, path::Path};

use alloy_eips::BlockHashOrNumber;
use alloy_primitives::{BlockNumber, B256};
use reth_primitives::{BlockHashOrNumber, Head, SealedHeader};
use reth_primitives::{Head, SealedHeader};
use reth_stages_types::StageId;
use reth_storage_api::{
BlockHashReader, DatabaseProviderFactory, HeaderProvider, StageCheckpointReader,
Expand Down
3 changes: 2 additions & 1 deletion crates/node/core/src/utils.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
//! Utility functions for node startup and shutdown, for example path parsing and retrieving single
//! blocks from the network.
use alloy_eips::BlockHashOrNumber;
use alloy_primitives::Sealable;
use alloy_rpc_types_engine::{JwtError, JwtSecret};
use eyre::Result;
Expand All @@ -11,7 +12,7 @@ use reth_network_p2p::{
headers::client::{HeadersClient, HeadersDirection, HeadersRequest},
priority::Priority,
};
use reth_primitives::{BlockHashOrNumber, SealedBlock, SealedHeader};
use reth_primitives::{SealedBlock, SealedHeader};
use std::{
env::VarError,
path::{Path, PathBuf},
Expand Down
4 changes: 1 addition & 3 deletions crates/primitives/src/block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@ use crate::{
GotExpected, Header, SealedHeader, TransactionSigned, TransactionSignedEcRecovered, Withdrawals,
};
use alloc::vec::Vec;
pub use alloy_eips::eip1898::{
BlockHashOrNumber, BlockId, BlockNumHash, BlockNumberOrTag, ForkBlock, RpcBlockHash,
};
pub use alloy_eips::eip1898::{BlockId, BlockNumHash, BlockNumberOrTag, ForkBlock, RpcBlockHash};
use alloy_eips::eip2718::Encodable2718;
use alloy_primitives::{Address, Bytes, Sealable, B256};
use alloy_rlp::{Decodable, Encodable, RlpDecodable, RlpEncodable};
Expand Down
4 changes: 2 additions & 2 deletions crates/primitives/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ pub mod transaction;
#[cfg(any(test, feature = "arbitrary"))]
pub use block::{generate_valid_header, valid_header_strategy};
pub use block::{
Block, BlockBody, BlockHashOrNumber, BlockId, BlockNumHash, BlockNumberOrTag, BlockWithSenders,
ForkBlock, RpcBlockHash, SealedBlock, SealedBlockWithSenders,
Block, BlockBody, BlockId, BlockNumHash, BlockNumberOrTag, BlockWithSenders, ForkBlock,
RpcBlockHash, SealedBlock, SealedBlockWithSenders,
};
#[cfg(feature = "reth-codec")]
pub use compression::*;
Expand Down
2 changes: 1 addition & 1 deletion crates/primitives/src/transaction/mod.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
//! Transaction types.
use crate::BlockHashOrNumber;
#[cfg(any(test, feature = "reth-codec"))]
use alloy_consensus::constants::{EIP4844_TX_TYPE_ID, EIP7702_TX_TYPE_ID};
use alloy_consensus::{
SignableTransaction, Transaction as _, TxEip1559, TxEip2930, TxEip4844, TxEip7702, TxLegacy,
};
use alloy_eips::{
eip1898::BlockHashOrNumber,
eip2718::{Decodable2718, Eip2718Error, Eip2718Result, Encodable2718},
eip2930::AccessList,
eip7702::SignedAuthorization,
Expand Down
4 changes: 2 additions & 2 deletions crates/rpc/rpc-engine-api/src/engine_api.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use crate::{
capabilities::EngineCapabilities, metrics::EngineApiMetrics, EngineApiError, EngineApiResult,
};
use alloy_eips::{eip4844::BlobAndProofV1, eip7685::Requests};
use alloy_eips::{eip1898::BlockHashOrNumber, eip4844::BlobAndProofV1, eip7685::Requests};
use alloy_primitives::{BlockHash, BlockNumber, B256, U64};
use alloy_rpc_types_engine::{
CancunPayloadFields, ClientVersionV1, ExecutionPayload, ExecutionPayloadBodiesV1,
Expand All @@ -19,7 +19,7 @@ use reth_payload_primitives::{
validate_payload_timestamp, EngineApiMessageVersion, PayloadBuilderAttributes,
PayloadOrAttributes,
};
use reth_primitives::{Block, BlockHashOrNumber, EthereumHardfork};
use reth_primitives::{Block, EthereumHardfork};
use reth_rpc_api::EngineApiServer;
use reth_rpc_types_compat::engine::payload::{
convert_payload_input_v2_to_payload, convert_to_payload_body_v1,
Expand Down
5 changes: 2 additions & 3 deletions crates/rpc/rpc-eth-types/src/cache/mod.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
//! Async caching support for eth RPC
use alloy_eips::BlockHashOrNumber;
use alloy_primitives::B256;
use futures::{future::Either, Stream, StreamExt};
use reth_chain_state::CanonStateNotification;
use reth_errors::{ProviderError, ProviderResult};
use reth_evm::{provider::EvmEnvProvider, ConfigureEvm};
use reth_execution_types::Chain;
use reth_primitives::{
BlockHashOrNumber, Header, Receipt, SealedBlockWithSenders, TransactionSigned,
};
use reth_primitives::{Header, Receipt, SealedBlockWithSenders, TransactionSigned};
use reth_storage_api::{BlockReader, StateProviderFactory, TransactionVariant};
use reth_tasks::{TaskSpawner, TokioTaskExecutor};
use revm::primitives::{BlockEnv, CfgEnv, CfgEnvWithHandlerCfg, SpecId};
Expand Down
4 changes: 2 additions & 2 deletions crates/storage/provider/src/providers/blockchain_provider.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1444,7 +1444,7 @@ mod tests {
assert_eq!(
provider
.withdrawals_by_block(
reth_primitives::BlockHashOrNumber::Number(15),
alloy_eips::BlockHashOrNumber::Number(15),
shainghai_timestamp
)
.expect("could not call withdrawals by block"),
Expand All @@ -1456,7 +1456,7 @@ mod tests {
assert_eq!(
provider
.withdrawals_by_block(
reth_primitives::BlockHashOrNumber::Number(block.number),
alloy_eips::BlockHashOrNumber::Number(block.number),
shainghai_timestamp
)?
.unwrap(),
Expand Down

0 comments on commit 566f2b4

Please sign in to comment.