mirror of
https://github.com/paradigmxyz/reth.git
synced 2026-01-26 07:38:59 -05:00
chore: replace reth-provider with reth-storage-api (#15344)
This commit is contained in:
3
Cargo.lock
generated
3
Cargo.lock
generated
@@ -9373,6 +9373,7 @@ dependencies = [
|
||||
"parking_lot",
|
||||
"pin-project",
|
||||
"rand 0.8.5",
|
||||
"reth-chain-state",
|
||||
"reth-chainspec",
|
||||
"reth-consensus",
|
||||
"reth-engine-primitives",
|
||||
@@ -9380,6 +9381,7 @@ dependencies = [
|
||||
"reth-ethereum-primitives",
|
||||
"reth-evm",
|
||||
"reth-evm-ethereum",
|
||||
"reth-execution-types",
|
||||
"reth-metrics",
|
||||
"reth-network-api",
|
||||
"reth-network-peers",
|
||||
@@ -9394,6 +9396,7 @@ dependencies = [
|
||||
"reth-rpc-eth-types",
|
||||
"reth-rpc-server-types",
|
||||
"reth-rpc-types-compat",
|
||||
"reth-storage-api",
|
||||
"reth-tasks",
|
||||
"reth-testing-utils",
|
||||
"reth-transaction-pool",
|
||||
|
||||
@@ -21,7 +21,9 @@ reth-engine-primitives.workspace = true
|
||||
reth-ethereum-primitives.workspace = true
|
||||
reth-errors.workspace = true
|
||||
reth-metrics.workspace = true
|
||||
reth-provider.workspace = true
|
||||
reth-storage-api.workspace = true
|
||||
reth-execution-types.workspace = true
|
||||
reth-chain-state.workspace = true
|
||||
reth-transaction-pool.workspace = true
|
||||
reth-network-api.workspace = true
|
||||
reth-rpc-engine-api.workspace = true
|
||||
|
||||
@@ -15,7 +15,7 @@ use alloy_rpc_types_trace::geth::{
|
||||
};
|
||||
use async_trait::async_trait;
|
||||
use jsonrpsee::core::RpcResult;
|
||||
use reth_chainspec::{EthChainSpec, EthereumHardforks};
|
||||
use reth_chainspec::{ChainSpecProvider, EthChainSpec, EthereumHardforks};
|
||||
use reth_evm::{
|
||||
execute::{BlockExecutorProvider, Executor},
|
||||
ConfigureEvm, EvmEnvFor, TxEnvFor,
|
||||
@@ -23,11 +23,6 @@ use reth_evm::{
|
||||
use reth_primitives_traits::{
|
||||
Block as _, BlockBody, NodePrimitives, ReceiptWithBloom, RecoveredBlock, SignedTransaction,
|
||||
};
|
||||
use reth_provider::{
|
||||
BlockIdReader, BlockReaderIdExt, ChainSpecProvider, HeaderProvider, ProviderBlock,
|
||||
ReceiptProviderIdExt, StateProofProvider, StateProvider, StateProviderFactory,
|
||||
TransactionVariant,
|
||||
};
|
||||
use reth_revm::{
|
||||
database::StateProviderDatabase,
|
||||
db::{CacheDB, State},
|
||||
@@ -40,6 +35,10 @@ use reth_rpc_eth_api::{
|
||||
};
|
||||
use reth_rpc_eth_types::{EthApiError, StateCacheDb};
|
||||
use reth_rpc_server_types::{result::internal_rpc_err, ToRpcResult};
|
||||
use reth_storage_api::{
|
||||
BlockIdReader, BlockReaderIdExt, HeaderProvider, ProviderBlock, ReceiptProviderIdExt,
|
||||
StateProofProvider, StateProvider, StateProviderFactory, TransactionVariant,
|
||||
};
|
||||
use reth_tasks::pool::BlockingTaskGuard;
|
||||
use revm::{context_interface::Transaction, state::EvmState, DatabaseCommit};
|
||||
use revm_inspectors::tracing::{
|
||||
|
||||
@@ -4,10 +4,9 @@ use crate::{
|
||||
eth::{core::EthApiInner, EthTxBuilder},
|
||||
EthApi,
|
||||
};
|
||||
use reth_chain_state::CanonStateSubscriptions;
|
||||
use reth_chainspec::ChainSpecProvider;
|
||||
use reth_node_api::NodePrimitives;
|
||||
use reth_provider::{
|
||||
BlockReaderIdExt, CanonStateSubscriptions, ChainSpecProvider, StateProviderFactory,
|
||||
};
|
||||
use reth_rpc_eth_types::{
|
||||
fee_history::fee_history_cache_new_blocks_task, EthStateCache, FeeHistoryCache,
|
||||
FeeHistoryCacheConfig, GasCap, GasPriceOracle,
|
||||
@@ -15,6 +14,7 @@ use reth_rpc_eth_types::{
|
||||
use reth_rpc_server_types::constants::{
|
||||
DEFAULT_ETH_PROOF_WINDOW, DEFAULT_MAX_SIMULATE_BLOCKS, DEFAULT_PROOF_PERMITS,
|
||||
};
|
||||
use reth_storage_api::{BlockReaderIdExt, StateProviderFactory};
|
||||
use reth_tasks::{pool::BlockingTaskPool, TaskSpawner, TokioTaskExecutor};
|
||||
use std::sync::Arc;
|
||||
|
||||
|
||||
@@ -10,9 +10,6 @@ use alloy_network::Ethereum;
|
||||
use alloy_primitives::{Bytes, U256};
|
||||
use derive_more::Deref;
|
||||
use reth_node_api::{FullNodeComponents, FullNodeTypes};
|
||||
use reth_provider::{
|
||||
BlockReader, BlockReaderIdExt, NodePrimitivesProvider, ProviderBlock, ProviderReceipt,
|
||||
};
|
||||
use reth_rpc_eth_api::{
|
||||
helpers::{EthSigner, SpawnBlocking},
|
||||
node::RpcNodeCoreExt,
|
||||
@@ -21,6 +18,9 @@ use reth_rpc_eth_api::{
|
||||
use reth_rpc_eth_types::{
|
||||
EthApiError, EthStateCache, FeeHistoryCache, GasCap, GasPriceOracle, PendingBlock,
|
||||
};
|
||||
use reth_storage_api::{
|
||||
BlockReader, BlockReaderIdExt, NodePrimitivesProvider, ProviderBlock, ProviderReceipt,
|
||||
};
|
||||
use reth_tasks::{
|
||||
pool::{BlockingTaskGuard, BlockingTaskPool},
|
||||
TaskSpawner, TokioTaskExecutor,
|
||||
@@ -468,16 +468,14 @@ mod tests {
|
||||
use alloy_primitives::{PrimitiveSignature as Signature, B256, U64};
|
||||
use alloy_rpc_types::FeeHistory;
|
||||
use jsonrpsee_types::error::INVALID_PARAMS_CODE;
|
||||
use reth_chainspec::{BaseFeeParams, ChainSpec};
|
||||
use reth_chain_state::CanonStateSubscriptions;
|
||||
use reth_chainspec::{BaseFeeParams, ChainSpec, ChainSpecProvider};
|
||||
use reth_ethereum_primitives::TransactionSigned;
|
||||
use reth_evm_ethereum::EthEvmConfig;
|
||||
use reth_network_api::noop::NoopNetwork;
|
||||
use reth_provider::{
|
||||
test_utils::{MockEthProvider, NoopProvider},
|
||||
BlockReader, BlockReaderIdExt, CanonStateSubscriptions, ChainSpecProvider,
|
||||
StateProviderFactory,
|
||||
};
|
||||
use reth_provider::test_utils::{MockEthProvider, NoopProvider};
|
||||
use reth_rpc_eth_api::EthApiServer;
|
||||
use reth_storage_api::{BlockReader, BlockReaderIdExt, StateProviderFactory};
|
||||
use reth_testing_utils::{generators, generators::Rng};
|
||||
use reth_transaction_pool::test_utils::{testing_pool, TestPool};
|
||||
|
||||
|
||||
@@ -10,11 +10,8 @@ use async_trait::async_trait;
|
||||
use futures::future::TryFutureExt;
|
||||
use jsonrpsee::{core::RpcResult, server::IdProvider};
|
||||
use reth_chainspec::ChainInfo;
|
||||
use reth_errors::ProviderError;
|
||||
use reth_primitives_traits::RecoveredBlock;
|
||||
use reth_provider::{
|
||||
BlockHashReader, BlockIdReader, BlockNumReader, BlockReader, HeaderProvider, ProviderBlock,
|
||||
ProviderError, ProviderReceipt,
|
||||
};
|
||||
use reth_rpc_eth_api::{
|
||||
EngineEthFilter, EthApiTypes, EthFilterApiServer, FullEthApiTypes, QueryLimits, RpcNodeCoreExt,
|
||||
RpcTransaction, TransactionCompat,
|
||||
@@ -24,6 +21,10 @@ use reth_rpc_eth_types::{
|
||||
EthApiError, EthFilterConfig, EthStateCache, EthSubscriptionIdProvider,
|
||||
};
|
||||
use reth_rpc_server_types::{result::rpc_error_with_code, ToRpcResult};
|
||||
use reth_storage_api::{
|
||||
BlockHashReader, BlockIdReader, BlockNumReader, BlockReader, HeaderProvider, ProviderBlock,
|
||||
ProviderReceipt,
|
||||
};
|
||||
use reth_tasks::TaskSpawner;
|
||||
use reth_transaction_pool::{NewSubpoolTransactionStream, PoolTransaction, TransactionPool};
|
||||
use std::{
|
||||
|
||||
@@ -2,15 +2,15 @@
|
||||
|
||||
use alloy_consensus::{transaction::TransactionMeta, BlockHeader};
|
||||
use alloy_rpc_types_eth::{BlockId, TransactionReceipt};
|
||||
use reth_chainspec::EthChainSpec;
|
||||
use reth_chainspec::{ChainSpecProvider, EthChainSpec};
|
||||
use reth_primitives_traits::{BlockBody, SignedTransaction};
|
||||
use reth_provider::{BlockReader, ChainSpecProvider};
|
||||
use reth_rpc_eth_api::{
|
||||
helpers::{EthBlocks, LoadBlock, LoadPendingBlock, LoadReceipt, SpawnBlocking},
|
||||
types::RpcTypes,
|
||||
RpcNodeCoreExt, RpcReceipt,
|
||||
};
|
||||
use reth_rpc_eth_types::{EthApiError, EthReceiptBuilder};
|
||||
use reth_storage_api::BlockReader;
|
||||
|
||||
use crate::EthApi;
|
||||
|
||||
|
||||
@@ -7,12 +7,12 @@ use alloy_primitives::{TxKind, U256};
|
||||
use alloy_rpc_types::TransactionRequest;
|
||||
use reth_evm::{ConfigureEvm, EvmEnv, EvmFactory, SpecFor};
|
||||
use reth_node_api::NodePrimitives;
|
||||
use reth_provider::{BlockReader, ProviderHeader, ProviderTx};
|
||||
use reth_rpc_eth_api::{
|
||||
helpers::{estimate::EstimateCall, Call, EthCall, LoadPendingBlock, LoadState, SpawnBlocking},
|
||||
FromEthApiError, FromEvmError, FullEthApiTypes, IntoEthApiError,
|
||||
};
|
||||
use reth_rpc_eth_types::{revm_utils::CallFees, EthApiError, RpcInvalidTransactionError};
|
||||
use reth_storage_api::{BlockReader, ProviderHeader, ProviderTx};
|
||||
use revm::{context::TxEnv, context_interface::Block, Database};
|
||||
|
||||
impl<Provider, Pool, Network, EvmConfig> EthCall for EthApi<Provider, Pool, Network, EvmConfig>
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
//! Contains RPC handler implementations for fee history.
|
||||
|
||||
use reth_chainspec::{EthChainSpec, EthereumHardforks};
|
||||
use reth_provider::{BlockReader, BlockReaderIdExt, ChainSpecProvider, StateProviderFactory};
|
||||
use reth_chainspec::{ChainSpecProvider, EthChainSpec, EthereumHardforks};
|
||||
use reth_rpc_eth_api::helpers::{EthFees, LoadBlock, LoadFee};
|
||||
use reth_rpc_eth_types::{FeeHistoryCache, GasPriceOracle};
|
||||
use reth_storage_api::{BlockReader, BlockReaderIdExt, StateProviderFactory};
|
||||
|
||||
use crate::EthApi;
|
||||
|
||||
|
||||
@@ -1,20 +1,20 @@
|
||||
//! Support for building a pending block with transactions from local view of mempool.
|
||||
|
||||
use alloy_consensus::BlockHeader;
|
||||
use reth_chainspec::{EthChainSpec, EthereumHardforks};
|
||||
use reth_chainspec::{ChainSpecProvider, EthChainSpec, EthereumHardforks};
|
||||
use reth_evm::{ConfigureEvm, NextBlockEnvAttributes};
|
||||
use reth_node_api::NodePrimitives;
|
||||
use reth_primitives_traits::SealedHeader;
|
||||
use reth_provider::{
|
||||
BlockReader, BlockReaderIdExt, ChainSpecProvider, ProviderBlock, ProviderHeader,
|
||||
ProviderReceipt, ProviderTx, StateProviderFactory,
|
||||
};
|
||||
use reth_rpc_eth_api::{
|
||||
helpers::{LoadPendingBlock, SpawnBlocking},
|
||||
types::RpcTypes,
|
||||
FromEvmError, RpcNodeCore,
|
||||
};
|
||||
use reth_rpc_eth_types::PendingBlock;
|
||||
use reth_storage_api::{
|
||||
BlockReader, BlockReaderIdExt, ProviderBlock, ProviderHeader, ProviderReceipt, ProviderTx,
|
||||
StateProviderFactory,
|
||||
};
|
||||
use reth_transaction_pool::{PoolTransaction, TransactionPool};
|
||||
use revm_primitives::B256;
|
||||
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
//! Builds an RPC receipt response w.r.t. data layout of network.
|
||||
|
||||
use alloy_consensus::transaction::TransactionMeta;
|
||||
use reth_chainspec::EthChainSpec;
|
||||
use reth_chainspec::{ChainSpecProvider, EthChainSpec};
|
||||
use reth_ethereum_primitives::{Receipt, TransactionSigned};
|
||||
use reth_provider::{BlockReader, ChainSpecProvider, ReceiptProvider, TransactionsProvider};
|
||||
use reth_rpc_eth_api::{helpers::LoadReceipt, FromEthApiError, RpcNodeCoreExt, RpcReceipt};
|
||||
use reth_rpc_eth_types::{EthApiError, EthReceiptBuilder};
|
||||
use reth_storage_api::{BlockReader, ReceiptProvider, TransactionsProvider};
|
||||
|
||||
use crate::EthApi;
|
||||
|
||||
|
||||
@@ -10,9 +10,9 @@ use alloy_primitives::{eip191_hash_message, Address, PrimitiveSignature as Signa
|
||||
use alloy_rpc_types_eth::TransactionRequest;
|
||||
use alloy_signer::SignerSync;
|
||||
use alloy_signer_local::PrivateKeySigner;
|
||||
use reth_provider::BlockReader;
|
||||
use reth_rpc_eth_api::helpers::{signer::Result, AddDevSigners, EthSigner};
|
||||
use reth_rpc_eth_types::SignError;
|
||||
use reth_storage_api::BlockReader;
|
||||
|
||||
impl<Provider, Pool, Network, EvmConfig> AddDevSigners
|
||||
for EthApi<Provider, Pool, Network, EvmConfig>
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
use alloy_primitives::U256;
|
||||
use reth_chainspec::EthereumHardforks;
|
||||
use reth_chainspec::{ChainSpecProvider, EthereumHardforks};
|
||||
use reth_network_api::NetworkInfo;
|
||||
use reth_provider::{
|
||||
BlockNumReader, BlockReader, ChainSpecProvider, ProviderTx, StageCheckpointReader,
|
||||
};
|
||||
use reth_rpc_eth_api::{helpers::EthApiSpec, RpcNodeCore};
|
||||
use reth_storage_api::{BlockNumReader, BlockReader, ProviderTx, StageCheckpointReader};
|
||||
|
||||
use crate::EthApi;
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
//! Contains RPC handler implementations specific to state.
|
||||
|
||||
use reth_chainspec::EthereumHardforks;
|
||||
use reth_provider::{BlockReader, ChainSpecProvider, StateProviderFactory};
|
||||
use reth_chainspec::{ChainSpecProvider, EthereumHardforks};
|
||||
use reth_storage_api::{BlockReader, StateProviderFactory};
|
||||
use reth_transaction_pool::TransactionPool;
|
||||
|
||||
use reth_rpc_eth_api::{
|
||||
|
||||
@@ -2,11 +2,11 @@
|
||||
|
||||
use reth_evm::ConfigureEvm;
|
||||
use reth_node_api::NodePrimitives;
|
||||
use reth_provider::{BlockReader, ProviderHeader, ProviderTx};
|
||||
use reth_rpc_eth_api::{
|
||||
helpers::{LoadState, Trace},
|
||||
FromEvmError,
|
||||
};
|
||||
use reth_storage_api::{BlockReader, ProviderHeader, ProviderTx};
|
||||
|
||||
use crate::EthApi;
|
||||
|
||||
|
||||
@@ -2,12 +2,12 @@
|
||||
|
||||
use crate::EthApi;
|
||||
use alloy_primitives::{Bytes, B256};
|
||||
use reth_provider::{BlockReader, BlockReaderIdExt, ProviderTx, TransactionsProvider};
|
||||
use reth_rpc_eth_api::{
|
||||
helpers::{EthSigner, EthTransactions, LoadTransaction, SpawnBlocking},
|
||||
FromEthApiError, FullEthApiTypes, RpcNodeCore, RpcNodeCoreExt,
|
||||
};
|
||||
use reth_rpc_eth_types::utils::recover_raw_transaction;
|
||||
use reth_storage_api::{BlockReader, BlockReaderIdExt, ProviderTx, TransactionsProvider};
|
||||
use reth_transaction_pool::{PoolTransaction, TransactionOrigin, TransactionPool};
|
||||
|
||||
impl<Provider, Pool, Network, EvmConfig> EthTransactions
|
||||
|
||||
@@ -11,14 +11,15 @@ use futures::StreamExt;
|
||||
use jsonrpsee::{
|
||||
server::SubscriptionMessage, types::ErrorObject, PendingSubscriptionSink, SubscriptionSink,
|
||||
};
|
||||
use reth_chain_state::CanonStateSubscriptions;
|
||||
use reth_network_api::NetworkInfo;
|
||||
use reth_primitives_traits::NodePrimitives;
|
||||
use reth_provider::{BlockNumReader, CanonStateSubscriptions};
|
||||
use reth_rpc_eth_api::{
|
||||
pubsub::EthPubSubApiServer, EthApiTypes, RpcNodeCore, RpcTransaction, TransactionCompat,
|
||||
};
|
||||
use reth_rpc_eth_types::logs_utils;
|
||||
use reth_rpc_server_types::result::{internal_rpc_err, invalid_params_rpc_err};
|
||||
use reth_storage_api::BlockNumReader;
|
||||
use reth_tasks::{TaskSpawner, TokioTaskExecutor};
|
||||
use reth_transaction_pool::{NewTransactionEvent, PoolConsensusTx, TransactionPool};
|
||||
use serde::Serialize;
|
||||
|
||||
@@ -11,7 +11,6 @@ use alloy_rpc_types_mev::{
|
||||
use jsonrpsee::core::RpcResult;
|
||||
use reth_evm::{ConfigureEvm, Evm};
|
||||
use reth_primitives_traits::{Recovered, SignedTransaction};
|
||||
use reth_provider::ProviderTx;
|
||||
use reth_revm::{database::StateProviderDatabase, db::CacheDB};
|
||||
use reth_rpc_api::MevSimApiServer;
|
||||
use reth_rpc_eth_api::{
|
||||
@@ -21,6 +20,7 @@ use reth_rpc_eth_api::{
|
||||
use reth_rpc_eth_types::{
|
||||
revm_utils::apply_block_overrides, utils::recover_raw_transaction, EthApiError,
|
||||
};
|
||||
use reth_storage_api::ProviderTx;
|
||||
use reth_tasks::pool::BlockingTaskGuard;
|
||||
use reth_transaction_pool::{PoolPooledTx, PoolTransaction, TransactionPool};
|
||||
use revm::{context_interface::result::ResultAndState, DatabaseCommit, DatabaseRef};
|
||||
|
||||
@@ -5,9 +5,9 @@ use alloy_primitives::{Address, U256};
|
||||
use async_trait::async_trait;
|
||||
use jsonrpsee::core::RpcResult;
|
||||
use reth_errors::RethResult;
|
||||
use reth_provider::{BlockReaderIdExt, ChangeSetReader, StateProviderFactory};
|
||||
use reth_rpc_api::RethApiServer;
|
||||
use reth_rpc_eth_types::{EthApiError, EthResult};
|
||||
use reth_storage_api::{BlockReaderIdExt, ChangeSetReader, StateProviderFactory};
|
||||
use reth_tasks::TaskSpawner;
|
||||
use tokio::sync::oneshot;
|
||||
|
||||
|
||||
@@ -15,14 +15,14 @@ use alloy_rpc_types_trace::{
|
||||
};
|
||||
use async_trait::async_trait;
|
||||
use jsonrpsee::core::RpcResult;
|
||||
use reth_chainspec::{EthChainSpec, EthereumHardfork, MAINNET, SEPOLIA};
|
||||
use reth_chainspec::{ChainSpecProvider, EthChainSpec, EthereumHardfork, MAINNET, SEPOLIA};
|
||||
use reth_evm::ConfigureEvm;
|
||||
use reth_primitives_traits::{BlockBody, BlockHeader};
|
||||
use reth_provider::{BlockNumReader, BlockReader, ChainSpecProvider};
|
||||
use reth_revm::{database::StateProviderDatabase, db::CacheDB};
|
||||
use reth_rpc_api::TraceApiServer;
|
||||
use reth_rpc_eth_api::{helpers::TraceExt, FromEthApiError, RpcNodeCore};
|
||||
use reth_rpc_eth_types::{error::EthApiError, utils::recover_raw_transaction, EthConfig};
|
||||
use reth_storage_api::{BlockNumReader, BlockReader};
|
||||
use reth_tasks::pool::BlockingTaskGuard;
|
||||
use reth_transaction_pool::{PoolPooledTx, PoolTransaction, TransactionPool};
|
||||
use revm::DatabaseCommit;
|
||||
|
||||
@@ -18,16 +18,17 @@ use reth_consensus::{Consensus, FullConsensus};
|
||||
use reth_engine_primitives::PayloadValidator;
|
||||
use reth_errors::{BlockExecutionError, ConsensusError, ProviderError};
|
||||
use reth_evm::execute::{BlockExecutorProvider, Executor};
|
||||
use reth_execution_types::BlockExecutionOutput;
|
||||
use reth_metrics::{metrics, metrics::Gauge, Metrics};
|
||||
use reth_node_api::NewPayloadError;
|
||||
use reth_primitives_traits::{
|
||||
constants::GAS_LIMIT_BOUND_DIVISOR, BlockBody, GotExpected, NodePrimitives, RecoveredBlock,
|
||||
SealedBlock, SealedHeaderFor,
|
||||
};
|
||||
use reth_provider::{BlockExecutionOutput, BlockReaderIdExt, StateProviderFactory};
|
||||
use reth_revm::{cached::CachedReads, database::StateProviderDatabase};
|
||||
use reth_rpc_api::BlockSubmissionValidationApiServer;
|
||||
use reth_rpc_server_types::result::internal_rpc_err;
|
||||
use reth_storage_api::{BlockReaderIdExt, StateProviderFactory};
|
||||
use reth_tasks::TaskSpawner;
|
||||
use revm_primitives::{Address, B256, U256};
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
Reference in New Issue
Block a user