mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
chore: phase out reth-primitives from storage-api (#14462)
This commit is contained in:
2
Cargo.lock
generated
2
Cargo.lock
generated
@ -9420,8 +9420,8 @@ dependencies = [
|
|||||||
"reth-db",
|
"reth-db",
|
||||||
"reth-db-api",
|
"reth-db-api",
|
||||||
"reth-db-models",
|
"reth-db-models",
|
||||||
|
"reth-ethereum-primitives",
|
||||||
"reth-execution-types",
|
"reth-execution-types",
|
||||||
"reth-primitives",
|
|
||||||
"reth-primitives-traits",
|
"reth-primitives-traits",
|
||||||
"reth-prune-types",
|
"reth-prune-types",
|
||||||
"reth-stages-types",
|
"reth-stages-types",
|
||||||
|
|||||||
@ -17,7 +17,6 @@ reth-chainspec.workspace = true
|
|||||||
reth-db-models.workspace = true
|
reth-db-models.workspace = true
|
||||||
reth-db-api.workspace = true
|
reth-db-api.workspace = true
|
||||||
reth-execution-types.workspace = true
|
reth-execution-types.workspace = true
|
||||||
reth-primitives.workspace = true
|
|
||||||
reth-primitives-traits.workspace = true
|
reth-primitives-traits.workspace = true
|
||||||
reth-prune-types.workspace = true
|
reth-prune-types.workspace = true
|
||||||
reth-stages-types.workspace = true
|
reth-stages-types.workspace = true
|
||||||
@ -26,6 +25,7 @@ reth-trie.workspace = true
|
|||||||
reth-trie-db.workspace = true
|
reth-trie-db.workspace = true
|
||||||
reth-db.workspace = true
|
reth-db.workspace = true
|
||||||
revm.workspace = true
|
revm.workspace = true
|
||||||
|
reth-ethereum-primitives.workspace = true
|
||||||
|
|
||||||
# ethereum
|
# ethereum
|
||||||
alloy-eips.workspace = true
|
alloy-eips.workspace = true
|
||||||
@ -43,7 +43,7 @@ std = [
|
|||||||
"alloy-eips/std",
|
"alloy-eips/std",
|
||||||
"alloy-primitives/std",
|
"alloy-primitives/std",
|
||||||
"alloy-rpc-types-engine/std",
|
"alloy-rpc-types-engine/std",
|
||||||
"reth-primitives/std",
|
"reth-ethereum-primitives/std",
|
||||||
"reth-primitives-traits/std",
|
"reth-primitives-traits/std",
|
||||||
"revm/std",
|
"revm/std",
|
||||||
"reth-stages-types/std",
|
"reth-stages-types/std",
|
||||||
|
|||||||
@ -6,7 +6,7 @@ use alloc::{sync::Arc, vec::Vec};
|
|||||||
use alloy_eips::{BlockHashOrNumber, BlockId, BlockNumberOrTag};
|
use alloy_eips::{BlockHashOrNumber, BlockId, BlockNumberOrTag};
|
||||||
use alloy_primitives::{BlockNumber, B256};
|
use alloy_primitives::{BlockNumber, B256};
|
||||||
use core::ops::RangeInclusive;
|
use core::ops::RangeInclusive;
|
||||||
use reth_primitives::{RecoveredBlock, SealedBlock, SealedHeader};
|
use reth_primitives_traits::{RecoveredBlock, SealedBlock, SealedHeader};
|
||||||
use reth_storage_errors::provider::ProviderResult;
|
use reth_storage_errors::provider::ProviderResult;
|
||||||
|
|
||||||
/// A helper enum that represents the origin of the requested block.
|
/// A helper enum that represents the origin of the requested block.
|
||||||
|
|||||||
@ -11,7 +11,7 @@ use reth_db::{
|
|||||||
transaction::{DbTx, DbTxMut},
|
transaction::{DbTx, DbTxMut},
|
||||||
DbTxUnwindExt,
|
DbTxUnwindExt,
|
||||||
};
|
};
|
||||||
use reth_primitives::TransactionSigned;
|
use reth_ethereum_primitives::TransactionSigned;
|
||||||
use reth_primitives_traits::{
|
use reth_primitives_traits::{
|
||||||
Block, BlockBody, FullBlockHeader, FullNodePrimitives, SignedTransaction,
|
Block, BlockBody, FullBlockHeader, FullNodePrimitives, SignedTransaction,
|
||||||
};
|
};
|
||||||
@ -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>
|
for EthStorage<T, H>
|
||||||
where
|
where
|
||||||
Provider: DBProvider<Tx: DbTxMut>,
|
Provider: DBProvider<Tx: DbTxMut>,
|
||||||
@ -103,7 +103,7 @@ where
|
|||||||
fn write_block_bodies(
|
fn write_block_bodies(
|
||||||
&self,
|
&self,
|
||||||
provider: &Provider,
|
provider: &Provider,
|
||||||
bodies: Vec<(u64, Option<reth_primitives::BlockBody<T, H>>)>,
|
bodies: Vec<(u64, Option<alloy_consensus::BlockBody<T, H>>)>,
|
||||||
_write_to: StorageLocation,
|
_write_to: StorageLocation,
|
||||||
) -> ProviderResult<()> {
|
) -> ProviderResult<()> {
|
||||||
let mut ommers_cursor = provider.tx_ref().cursor_write::<tables::BlockOmmers<H>>()?;
|
let mut ommers_cursor = provider.tx_ref().cursor_write::<tables::BlockOmmers<H>>()?;
|
||||||
@ -150,7 +150,7 @@ where
|
|||||||
T: SignedTransaction,
|
T: SignedTransaction,
|
||||||
H: FullBlockHeader,
|
H: FullBlockHeader,
|
||||||
{
|
{
|
||||||
type Block = reth_primitives::Block<T, H>;
|
type Block = alloy_consensus::Block<T, H>;
|
||||||
|
|
||||||
fn read_block_bodies(
|
fn read_block_bodies(
|
||||||
&self,
|
&self,
|
||||||
@ -182,7 +182,7 @@ where
|
|||||||
provider.ommers(header.number().into())?.unwrap_or_default()
|
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)
|
Ok(bodies)
|
||||||
|
|||||||
@ -3,7 +3,7 @@ use alloy_primitives::{map::HashMap, Address, BlockNumber, B256};
|
|||||||
use auto_impl::auto_impl;
|
use auto_impl::auto_impl;
|
||||||
use core::ops::{RangeBounds, RangeInclusive};
|
use core::ops::{RangeBounds, RangeInclusive};
|
||||||
use reth_db::models::{AccountBeforeTx, BlockNumberAddress};
|
use reth_db::models::{AccountBeforeTx, BlockNumberAddress};
|
||||||
use reth_primitives::{Account, StorageEntry};
|
use reth_primitives_traits::{Account, StorageEntry};
|
||||||
use reth_storage_errors::provider::ProviderResult;
|
use reth_storage_errors::provider::ProviderResult;
|
||||||
|
|
||||||
/// Hashing Writer
|
/// Hashing Writer
|
||||||
|
|||||||
@ -21,8 +21,10 @@ use core::{
|
|||||||
};
|
};
|
||||||
use reth_chainspec::{ChainInfo, ChainSpecProvider, EthChainSpec, MAINNET};
|
use reth_chainspec::{ChainInfo, ChainSpecProvider, EthChainSpec, MAINNET};
|
||||||
use reth_db_models::{AccountBeforeTx, StoredBlockBodyIndices};
|
use reth_db_models::{AccountBeforeTx, StoredBlockBodyIndices};
|
||||||
use reth_primitives::{EthPrimitives, RecoveredBlock, SealedBlock};
|
use reth_ethereum_primitives::EthPrimitives;
|
||||||
use reth_primitives_traits::{Account, Bytecode, NodePrimitives, SealedHeader};
|
use reth_primitives_traits::{
|
||||||
|
Account, Bytecode, NodePrimitives, RecoveredBlock, SealedBlock, SealedHeader,
|
||||||
|
};
|
||||||
use reth_prune_types::{PruneCheckpoint, PruneSegment};
|
use reth_prune_types::{PruneCheckpoint, PruneSegment};
|
||||||
use reth_stages_types::{StageCheckpoint, StageId};
|
use reth_stages_types::{StageCheckpoint, StageId};
|
||||||
use reth_storage_errors::provider::{ProviderError, ProviderResult};
|
use reth_storage_errors::provider::{ProviderError, ProviderResult};
|
||||||
|
|||||||
Reference in New Issue
Block a user