Skip to content

Commit

Permalink
chore: phase out reth-primitives from storage-api (paradigmxyz#14462)
Browse files Browse the repository at this point in the history
  • Loading branch information
mattsse authored and frankudoags committed Feb 13, 2025
1 parent c4b7b14 commit 741367b
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 12 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

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

4 changes: 2 additions & 2 deletions crates/storage/storage-api/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ reth-chainspec.workspace = true
reth-db-models.workspace = true
reth-db-api.workspace = true
reth-execution-types.workspace = true
reth-primitives.workspace = true
reth-primitives-traits.workspace = true
reth-prune-types.workspace = true
reth-stages-types.workspace = true
Expand All @@ -26,6 +25,7 @@ reth-trie.workspace = true
reth-trie-db.workspace = true
reth-db.workspace = true
revm.workspace = true
reth-ethereum-primitives.workspace = true

# ethereum
alloy-eips.workspace = true
Expand All @@ -43,7 +43,7 @@ std = [
"alloy-eips/std",
"alloy-primitives/std",
"alloy-rpc-types-engine/std",
"reth-primitives/std",
"reth-ethereum-primitives/std",
"reth-primitives-traits/std",
"revm/std",
"reth-stages-types/std",
Expand Down
2 changes: 1 addition & 1 deletion crates/storage/storage-api/src/block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use alloc::{sync::Arc, vec::Vec};
use alloy_eips::{BlockHashOrNumber, BlockId, BlockNumberOrTag};
use alloy_primitives::{BlockNumber, B256};
use core::ops::RangeInclusive;
use reth_primitives::{RecoveredBlock, SealedBlock, SealedHeader};
use reth_primitives_traits::{RecoveredBlock, SealedBlock, SealedHeader};
use reth_storage_errors::provider::ProviderResult;

/// A helper enum that represents the origin of the requested block.
Expand Down
10 changes: 5 additions & 5 deletions crates/storage/storage-api/src/chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use reth_db::{
transaction::{DbTx, DbTxMut},
DbTxUnwindExt,
};
use reth_primitives::TransactionSigned;
use reth_ethereum_primitives::TransactionSigned;
use reth_primitives_traits::{
Block, BlockBody, FullBlockHeader, FullNodePrimitives, SignedTransaction,
};
Expand Down Expand Up @@ -93,7 +93,7 @@ impl<T, H> Default for EthStorage<T, H> {
}
}

impl<Provider, T, H> BlockBodyWriter<Provider, reth_primitives::BlockBody<T, H>>
impl<Provider, T, H> BlockBodyWriter<Provider, alloy_consensus::BlockBody<T, H>>
for EthStorage<T, H>
where
Provider: DBProvider<Tx: DbTxMut>,
Expand All @@ -103,7 +103,7 @@ where
fn write_block_bodies(
&self,
provider: &Provider,
bodies: Vec<(u64, Option<reth_primitives::BlockBody<T, H>>)>,
bodies: Vec<(u64, Option<alloy_consensus::BlockBody<T, H>>)>,
_write_to: StorageLocation,
) -> ProviderResult<()> {
let mut ommers_cursor = provider.tx_ref().cursor_write::<tables::BlockOmmers<H>>()?;
Expand Down Expand Up @@ -150,7 +150,7 @@ where
T: SignedTransaction,
H: FullBlockHeader,
{
type Block = reth_primitives::Block<T, H>;
type Block = alloy_consensus::Block<T, H>;

fn read_block_bodies(
&self,
Expand Down Expand Up @@ -182,7 +182,7 @@ where
provider.ommers(header.number().into())?.unwrap_or_default()
};

bodies.push(reth_primitives::BlockBody { transactions, ommers, withdrawals });
bodies.push(alloy_consensus::BlockBody { transactions, ommers, withdrawals });
}

Ok(bodies)
Expand Down
2 changes: 1 addition & 1 deletion crates/storage/storage-api/src/hashing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use alloy_primitives::{map::HashMap, Address, BlockNumber, B256};
use auto_impl::auto_impl;
use core::ops::{RangeBounds, RangeInclusive};
use reth_db::models::{AccountBeforeTx, BlockNumberAddress};
use reth_primitives::{Account, StorageEntry};
use reth_primitives_traits::{Account, StorageEntry};
use reth_storage_errors::provider::ProviderResult;

/// Hashing Writer
Expand Down
6 changes: 4 additions & 2 deletions crates/storage/storage-api/src/noop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,10 @@ use core::{
};
use reth_chainspec::{ChainInfo, ChainSpecProvider, EthChainSpec, MAINNET};
use reth_db_models::{AccountBeforeTx, StoredBlockBodyIndices};
use reth_primitives::{EthPrimitives, RecoveredBlock, SealedBlock};
use reth_primitives_traits::{Account, Bytecode, NodePrimitives, SealedHeader};
use reth_ethereum_primitives::EthPrimitives;
use reth_primitives_traits::{
Account, Bytecode, NodePrimitives, RecoveredBlock, SealedBlock, SealedHeader,
};
use reth_prune_types::{PruneCheckpoint, PruneSegment};
use reth_stages_types::{StageCheckpoint, StageId};
use reth_storage_errors::provider::{ProviderError, ProviderResult};
Expand Down

0 comments on commit 741367b

Please sign in to comment.