Skip to content

Commit

Permalink
primitives: rm alloy BlockNumHash reexport (#12304)
Browse files Browse the repository at this point in the history
  • Loading branch information
tcoratger authored Nov 4, 2024
1 parent 3fe2234 commit d5f0103
Show file tree
Hide file tree
Showing 14 changed files with 29 additions and 19 deletions.
2 changes: 2 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/blockchain-tree-api/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ reth-storage-errors.workspace = true

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

# misc
thiserror.workspace = true
3 changes: 2 additions & 1 deletion crates/blockchain-tree-api/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@

use self::error::CanonicalError;
use crate::error::InsertBlockError;
use alloy_eips::BlockNumHash;
use alloy_primitives::{BlockHash, BlockNumber};
use reth_primitives::{BlockNumHash, Receipt, SealedBlock, SealedBlockWithSenders, SealedHeader};
use reth_primitives::{Receipt, SealedBlock, SealedBlockWithSenders, SealedHeader};
use reth_storage_errors::provider::{ProviderError, ProviderResult};
use std::collections::BTreeMap;

Expand Down
4 changes: 2 additions & 2 deletions crates/consensus/beacon/src/engine/mod.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use alloy_eips::merge::EPOCH_SLOTS;
use alloy_eips::{merge::EPOCH_SLOTS, BlockNumHash};
use alloy_primitives::{BlockNumber, B256};
use alloy_rpc_types_engine::{
ExecutionPayload, ExecutionPayloadSidecar, ForkchoiceState, PayloadStatus, PayloadStatusEnum,
Expand All @@ -20,7 +20,7 @@ use reth_node_types::NodeTypesWithEngine;
use reth_payload_builder::PayloadBuilderHandle;
use reth_payload_primitives::{PayloadAttributes, PayloadBuilder, PayloadBuilderAttributes};
use reth_payload_validator::ExecutionPayloadValidator;
use reth_primitives::{BlockNumHash, Head, Header, SealedBlock, SealedHeader};
use reth_primitives::{Head, Header, SealedBlock, SealedHeader};
use reth_provider::{
providers::ProviderNodeTypes, BlockIdReader, BlockReader, BlockSource, CanonChainTracker,
ChainSpecProvider, ProviderError, StageCheckpointReader,
Expand Down
2 changes: 1 addition & 1 deletion crates/exex/exex/src/event.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use reth_primitives::BlockNumHash;
use alloy_eips::BlockNumHash;

/// Events emitted by an `ExEx`.
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
Expand Down
3 changes: 2 additions & 1 deletion crates/exex/exex/src/manager.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
use crate::{
wal::Wal, ExExEvent, ExExNotification, ExExNotifications, FinishedExExHeight, WalHandle,
};
use alloy_eips::BlockNumHash;
use futures::StreamExt;
use itertools::Itertools;
use metrics::Gauge;
use reth_chain_state::ForkChoiceStream;
use reth_chainspec::Head;
use reth_metrics::{metrics::Counter, Metrics};
use reth_primitives::{BlockNumHash, SealedHeader};
use reth_primitives::SealedHeader;
use reth_provider::HeaderProvider;
use reth_tracing::tracing::debug;
use std::{
Expand Down
3 changes: 3 additions & 0 deletions crates/exex/test-utils/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ reth-tasks.workspace = true
reth-transaction-pool = { workspace = true, features = ["test-utils"] }
reth-trie-db.workspace = true

## alloy
alloy-eips.workspace = true

## async
futures-util.workspace = true
tokio.workspace = true
Expand Down
3 changes: 2 additions & 1 deletion crates/exex/test-utils/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ use std::{
task::Poll,
};

use alloy_eips::BlockNumHash;
use futures_util::FutureExt;
use reth_blockchain_tree::noop::NoopBlockchainTree;
use reth_chainspec::{ChainSpec, MAINNET};
Expand Down Expand Up @@ -44,7 +45,7 @@ use reth_node_ethereum::{
EthEngineTypes, EthEvmConfig,
};
use reth_payload_builder::noop::NoopPayloadBuilderService;
use reth_primitives::{BlockNumHash, Head, SealedBlockWithSenders};
use reth_primitives::{Head, SealedBlockWithSenders};
use reth_provider::{
providers::{BlockchainProvider, StaticFileProvider},
BlockReader, ProviderFactory,
Expand Down
2 changes: 1 addition & 1 deletion crates/primitives/src/block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use crate::{
GotExpected, Header, SealedHeader, TransactionSigned, TransactionSignedEcRecovered, Withdrawals,
};
use alloc::vec::Vec;
pub use alloy_eips::eip1898::{BlockNumHash, BlockNumberOrTag, ForkBlock, RpcBlockHash};
pub use alloy_eips::eip1898::{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, BlockNumHash, BlockNumberOrTag, BlockWithSenders, ForkBlock, RpcBlockHash,
SealedBlock, SealedBlockWithSenders,
Block, BlockBody, BlockNumberOrTag, BlockWithSenders, ForkBlock, RpcBlockHash, SealedBlock,
SealedBlockWithSenders,
};
#[cfg(feature = "reth-codec")]
pub use compression::*;
Expand Down
3 changes: 2 additions & 1 deletion crates/rpc/rpc-eth-types/src/logs_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@
//!
//! Log parsing for building filter.
use alloy_eips::BlockNumHash;
use alloy_primitives::TxHash;
use alloy_rpc_types::{FilteredParams, Log};
use reth_chainspec::ChainInfo;
use reth_errors::ProviderError;
use reth_primitives::{BlockNumHash, Receipt, SealedBlockWithSenders};
use reth_primitives::{Receipt, SealedBlockWithSenders};
use reth_storage_api::BlockReader;
use std::sync::Arc;

Expand Down
6 changes: 3 additions & 3 deletions crates/storage/provider/src/test_utils/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -463,15 +463,15 @@ impl BlockNumReader for MockEthProvider {
}

impl BlockIdReader for MockEthProvider {
fn pending_block_num_hash(&self) -> ProviderResult<Option<reth_primitives::BlockNumHash>> {
fn pending_block_num_hash(&self) -> ProviderResult<Option<alloy_eips::BlockNumHash>> {
Ok(None)
}

fn safe_block_num_hash(&self) -> ProviderResult<Option<reth_primitives::BlockNumHash>> {
fn safe_block_num_hash(&self) -> ProviderResult<Option<alloy_eips::BlockNumHash>> {
Ok(None)
}

fn finalized_block_num_hash(&self) -> ProviderResult<Option<reth_primitives::BlockNumHash>> {
fn finalized_block_num_hash(&self) -> ProviderResult<Option<alloy_eips::BlockNumHash>> {
Ok(None)
}
}
Expand Down
6 changes: 3 additions & 3 deletions crates/storage/provider/src/test_utils/noop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -175,15 +175,15 @@ impl BlockReaderIdExt for NoopProvider {
}

impl BlockIdReader for NoopProvider {
fn pending_block_num_hash(&self) -> ProviderResult<Option<reth_primitives::BlockNumHash>> {
fn pending_block_num_hash(&self) -> ProviderResult<Option<alloy_eips::BlockNumHash>> {
Ok(None)
}

fn safe_block_num_hash(&self) -> ProviderResult<Option<reth_primitives::BlockNumHash>> {
fn safe_block_num_hash(&self) -> ProviderResult<Option<alloy_eips::BlockNumHash>> {
Ok(None)
}

fn finalized_block_num_hash(&self) -> ProviderResult<Option<reth_primitives::BlockNumHash>> {
fn finalized_block_num_hash(&self) -> ProviderResult<Option<alloy_eips::BlockNumHash>> {
Ok(None)
}
}
Expand Down
6 changes: 3 additions & 3 deletions crates/storage/storage-api/src/block_id.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,13 +99,13 @@ pub trait BlockIdReader: BlockNumReader + Send + Sync {
}

/// Get the current pending block number and hash.
fn pending_block_num_hash(&self) -> ProviderResult<Option<reth_primitives::BlockNumHash>>;
fn pending_block_num_hash(&self) -> ProviderResult<Option<alloy_eips::BlockNumHash>>;

/// Get the current safe block number and hash.
fn safe_block_num_hash(&self) -> ProviderResult<Option<reth_primitives::BlockNumHash>>;
fn safe_block_num_hash(&self) -> ProviderResult<Option<alloy_eips::BlockNumHash>>;

/// Get the current finalized block number and hash.
fn finalized_block_num_hash(&self) -> ProviderResult<Option<reth_primitives::BlockNumHash>>;
fn finalized_block_num_hash(&self) -> ProviderResult<Option<alloy_eips::BlockNumHash>>;

/// Get the safe block number.
fn safe_block_number(&self) -> ProviderResult<Option<BlockNumber>> {
Expand Down

0 comments on commit d5f0103

Please sign in to comment.