Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(rpc): remove redundant LoadFee::cache #12146

Merged
merged 1 commit into from
Oct 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions crates/optimism/rpc/src/eth/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -201,11 +201,6 @@ where
+ StateProviderFactory,
>,
{
#[inline]
fn cache(&self) -> &EthStateCache {
self.inner.cache()
}

#[inline]
fn gas_oracle(&self) -> &GasPriceOracle<Self::Provider> {
self.inner.gas_oracle()
Expand Down
11 changes: 3 additions & 8 deletions crates/rpc/rpc-eth-api/src/helpers/fee.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ use futures::Future;
use reth_chainspec::EthChainSpec;
use reth_provider::{BlockIdReader, ChainSpecProvider, HeaderProvider};
use reth_rpc_eth_types::{
fee_history::calculate_reward_percentiles_for_block, EthApiError, EthStateCache,
FeeHistoryCache, FeeHistoryEntry, GasPriceOracle, RpcInvalidTransactionError,
fee_history::calculate_reward_percentiles_for_block, EthApiError, FeeHistoryCache,
FeeHistoryEntry, GasPriceOracle, RpcInvalidTransactionError,
};
use tracing::debug;

Expand Down Expand Up @@ -172,7 +172,7 @@ pub trait EthFees: LoadFee {

// Percentiles were specified, so we need to collect reward percentile ino
if let Some(percentiles) = &reward_percentiles {
let (block, receipts) = LoadFee::cache(self)
let (block, receipts) = self.cache()
.get_block_and_receipts(header.hash())
.await
.map_err(Self::Error::from_eth_err)?
Expand Down Expand Up @@ -242,11 +242,6 @@ pub trait EthFees: LoadFee {
///
/// Behaviour shared by several `eth_` RPC methods, not exclusive to `eth_` fees RPC methods.
pub trait LoadFee: LoadBlock {
/// Returns a handle for reading data from memory.
///
/// Data access in default (L1) trait method implementations.
fn cache(&self) -> &EthStateCache;

/// Returns a handle for reading gas price.
///
/// Data access in default (L1) trait method implementations.
Expand Down
7 changes: 1 addition & 6 deletions crates/rpc/rpc/src/eth/helpers/fees.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
use reth_chainspec::{EthChainSpec, EthereumHardforks};
use reth_provider::{BlockReaderIdExt, ChainSpecProvider, EvmEnvProvider, StateProviderFactory};
use reth_rpc_eth_api::helpers::{EthFees, LoadBlock, LoadFee};
use reth_rpc_eth_types::{EthStateCache, FeeHistoryCache, GasPriceOracle};
use reth_rpc_eth_types::{FeeHistoryCache, GasPriceOracle};

use crate::EthApi;

Expand All @@ -20,11 +20,6 @@ where
+ ChainSpecProvider<ChainSpec: EthChainSpec + EthereumHardforks>
+ StateProviderFactory,
{
#[inline]
fn cache(&self) -> &EthStateCache {
self.inner.cache()
}

#[inline]
fn gas_oracle(&self) -> &GasPriceOracle<Self::Provider> {
self.inner.gas_oracle()
Expand Down
Loading