Skip to content

Commit 22e9a17

Browse files
authored
chore: Replace reth-provider with reth-storage-api in reth-rpc-api (#16322)
1 parent 27bcf64 commit 22e9a17

File tree

14 files changed

+27
-28
lines changed

14 files changed

+27
-28
lines changed

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/rpc/rpc-eth-api/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ revm-inspectors.workspace = true
1818
reth-primitives-traits.workspace = true
1919
reth-errors.workspace = true
2020
reth-evm.workspace = true
21-
reth-provider.workspace = true
21+
reth-storage-api.workspace = true
2222
reth-revm.workspace = true
2323
reth-rpc-types-compat.workspace = true
2424
reth-tasks = { workspace = true, features = ["rayon"] }

crates/rpc/rpc-eth-api/src/helpers/block.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ use alloy_rpc_types_eth::{Block, BlockTransactions, Header, Index};
1212
use futures::Future;
1313
use reth_node_api::BlockBody;
1414
use reth_primitives_traits::{RecoveredBlock, SealedBlock};
15-
use reth_provider::{
15+
use reth_rpc_types_compat::block::from_block;
16+
use reth_storage_api::{
1617
BlockIdReader, BlockReader, BlockReaderIdExt, ProviderHeader, ProviderReceipt, ProviderTx,
1718
};
18-
use reth_rpc_types_compat::block::from_block;
1919
use reth_transaction_pool::{PoolTransaction, TransactionPool};
2020
use std::sync::Arc;
2121

crates/rpc/rpc-eth-api/src/helpers/call.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ use reth_evm::{
2222
};
2323
use reth_node_api::{BlockBody, NodePrimitives};
2424
use reth_primitives_traits::{Recovered, SealedHeader, SignedTransaction};
25-
use reth_provider::{BlockIdReader, ProviderHeader, ProviderTx};
2625
use reth_revm::{
2726
database::StateProviderDatabase,
2827
db::{CacheDB, State},
@@ -35,6 +34,7 @@ use reth_rpc_eth_types::{
3534
simulate::{self, EthSimulateError},
3635
EthApiError, RevertError, RpcInvalidTransactionError, StateCacheDb,
3736
};
37+
use reth_storage_api::{BlockIdReader, ProviderHeader, ProviderTx};
3838
use revm::{
3939
context_interface::{
4040
result::{ExecutionResult, ResultAndState},

crates/rpc/rpc-eth-api/src/helpers/estimate.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@ use futures::Future;
88
use reth_chainspec::MIN_TRANSACTION_GAS;
99
use reth_errors::ProviderError;
1010
use reth_evm::{Database, EvmEnvFor, TransactionEnv, TxEnvFor};
11-
use reth_provider::StateProvider;
1211
use reth_revm::{database::StateProviderDatabase, db::CacheDB};
1312
use reth_rpc_eth_types::{
1413
error::api::FromEvmHalt,
1514
revm_utils::{apply_state_overrides, caller_gas_allowance},
1615
EthApiError, RevertError, RpcInvalidTransactionError,
1716
};
1817
use reth_rpc_server_types::constants::gas_oracle::{CALL_STIPEND_GAS, ESTIMATE_GAS_ERROR_RATIO};
18+
use reth_storage_api::StateProvider;
1919
use revm::context_interface::{result::ExecutionResult, Transaction};
2020
use tracing::trace;
2121

crates/rpc/rpc-eth-api/src/helpers/fee.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@ use alloy_eips::eip7840::BlobParams;
77
use alloy_primitives::U256;
88
use alloy_rpc_types_eth::{BlockNumberOrTag, FeeHistory};
99
use futures::Future;
10-
use reth_chainspec::EthChainSpec;
10+
use reth_chainspec::{ChainSpecProvider, EthChainSpec};
1111
use reth_primitives_traits::BlockBody;
12-
use reth_provider::{BlockIdReader, ChainSpecProvider, HeaderProvider};
1312
use reth_rpc_eth_types::{
1413
fee_history::calculate_reward_percentiles_for_block, EthApiError, FeeHistoryCache,
1514
FeeHistoryEntry, GasPriceOracle, RpcInvalidTransactionError,
1615
};
16+
use reth_storage_api::{BlockIdReader, HeaderProvider};
1717
use tracing::debug;
1818

1919
/// Fee related functions for the [`EthApiServer`](crate::EthApiServer) trait in the

crates/rpc/rpc-eth-api/src/helpers/pending_block.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ use alloy_consensus::{BlockHeader, Transaction};
77
use alloy_eips::eip7840::BlobParams;
88
use alloy_rpc_types_eth::BlockNumberOrTag;
99
use futures::Future;
10-
use reth_chainspec::{EthChainSpec, EthereumHardforks};
11-
use reth_errors::{BlockExecutionError, BlockValidationError, RethError};
10+
use reth_chainspec::{ChainSpecProvider, EthChainSpec, EthereumHardforks};
11+
use reth_errors::{BlockExecutionError, BlockValidationError, ProviderError, RethError};
1212
use reth_evm::{
1313
execute::{BlockBuilder, BlockBuilderOutcome},
1414
ConfigureEvm, Evm, SpecFor,
@@ -17,12 +17,12 @@ use reth_node_api::NodePrimitives;
1717
use reth_primitives_traits::{
1818
transaction::error::InvalidTransactionError, Receipt, RecoveredBlock, SealedHeader,
1919
};
20-
use reth_provider::{
21-
BlockReader, BlockReaderIdExt, ChainSpecProvider, ProviderBlock, ProviderError, ProviderHeader,
22-
ProviderReceipt, ProviderTx, ReceiptProvider, StateProviderFactory,
23-
};
2420
use reth_revm::{database::StateProviderDatabase, db::State};
2521
use reth_rpc_eth_types::{EthApiError, PendingBlock, PendingBlockEnv, PendingBlockEnvOrigin};
22+
use reth_storage_api::{
23+
BlockReader, BlockReaderIdExt, ProviderBlock, ProviderHeader, ProviderReceipt, ProviderTx,
24+
ReceiptProvider, StateProviderFactory,
25+
};
2626
use reth_transaction_pool::{
2727
error::InvalidPoolTransactionError, BestTransactionsAttributes, PoolTransaction,
2828
TransactionPool,

crates/rpc/rpc-eth-api/src/helpers/receipt.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
44
use alloy_consensus::transaction::TransactionMeta;
55
use futures::Future;
6-
use reth_provider::{ProviderReceipt, ProviderTx, ReceiptProvider, TransactionsProvider};
6+
use reth_storage_api::{ProviderReceipt, ProviderTx, ReceiptProvider, TransactionsProvider};
77

88
use crate::{EthApiTypes, RpcNodeCoreExt, RpcReceipt};
99

crates/rpc/rpc-eth-api/src/helpers/spec.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
use alloy_primitives::{Address, U256, U64};
44
use alloy_rpc_types_eth::{Stage, SyncInfo, SyncStatus};
55
use futures::Future;
6-
use reth_chainspec::{ChainInfo, EthereumHardforks};
6+
use reth_chainspec::{ChainInfo, ChainSpecProvider, EthereumHardforks};
77
use reth_errors::{RethError, RethResult};
88
use reth_network_api::NetworkInfo;
9-
use reth_provider::{BlockNumReader, ChainSpecProvider, StageCheckpointReader};
9+
use reth_storage_api::{BlockNumReader, StageCheckpointReader};
1010

1111
use crate::{helpers::EthSigner, RpcNodeCore};
1212

crates/rpc/rpc-eth-api/src/helpers/state.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,13 @@ use alloy_primitives::{Address, Bytes, B256, U256};
88
use alloy_rpc_types_eth::{Account, AccountInfo, EIP1186AccountProofResponse};
99
use alloy_serde::JsonStorageKey;
1010
use futures::Future;
11-
use reth_chainspec::{EthChainSpec, EthereumHardforks};
11+
use reth_chainspec::{ChainSpecProvider, EthChainSpec, EthereumHardforks};
1212
use reth_errors::RethError;
1313
use reth_evm::{ConfigureEvm, EvmEnvFor};
14-
use reth_provider::{
15-
BlockIdReader, BlockNumReader, ChainSpecProvider, StateProvider, StateProviderBox,
16-
StateProviderFactory,
17-
};
1814
use reth_rpc_eth_types::{EthApiError, PendingBlockEnv, RpcInvalidTransactionError};
15+
use reth_storage_api::{
16+
BlockIdReader, BlockNumReader, StateProvider, StateProviderBox, StateProviderFactory,
17+
};
1918
use reth_transaction_pool::TransactionPool;
2019

2120
/// Helper methods for `eth_` methods relating to state (accounts).

0 commit comments

Comments
 (0)