Skip to content

Commit

Permalink
feat: clean up max fee per gas tracing instrument and add instrument …
Browse files Browse the repository at this point in the history
…for estimate uo gas
  • Loading branch information
alex-miao committed Feb 21, 2025
1 parent 32c3990 commit d9efab2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 12 deletions.
2 changes: 2 additions & 0 deletions crates/rpc/src/eth/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ use alloy_primitives::{Address, B256, U64};
use jsonrpsee::core::RpcResult;
use rundler_provider::StateOverride;
use rundler_types::{pool::Pool, UserOperationVariant};
use tracing::instrument;

use super::{api::EthApi, EthApiServer};
use crate::{
Expand Down Expand Up @@ -46,6 +47,7 @@ where
.await
}

#[instrument(name = "EthApiServer::estimate_user_operation_gas", skip(self))]
async fn estimate_user_operation_gas(
&self,
op: RpcUserOperationOptionalGas,
Expand Down
14 changes: 2 additions & 12 deletions crates/rpc/src/rundler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,7 @@ where
P: Pool + 'static,
F: FeeEstimator + 'static,
{
#[instrument(
name = "RundlerApiServer::max_priority_fee_per_gas",
skip(self),
fields(force_trace_sample = true)
)]
#[instrument(name = "RundlerApiServer::max_priority_fee_per_gas", skip(self))]
async fn max_priority_fee_per_gas(&self) -> RpcResult<U128> {
utils::safe_call_rpc_handler(
"rundler_maxPriorityFeePerGas",
Expand Down Expand Up @@ -115,8 +111,7 @@ where
}
}

#[instrument(skip(self))]
async fn simple_wrapper(&self) -> EthResult<U128> {
async fn max_priority_fee_per_gas(&self) -> EthResult<U128> {
let (bundle_fees, _) = self
.fee_estimator
.required_bundle_fees(None)
Expand All @@ -129,11 +124,6 @@ where
))
}

#[instrument(name = "RundlerApi::max_priority_fee_per_gas", skip(self))]
async fn max_priority_fee_per_gas(&self) -> EthResult<U128> {
self.simple_wrapper().await
}

async fn drop_local_user_operation(
&self,
user_op: RpcUserOperation,
Expand Down

0 comments on commit d9efab2

Please sign in to comment.