Skip to content

Commit

Permalink
comments
Browse files Browse the repository at this point in the history
  • Loading branch information
dinhani-cw committed Jun 3, 2024
1 parent b85aff7 commit 6fad4ed
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 16 deletions.
8 changes: 0 additions & 8 deletions src/eth/executor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,9 @@ impl Executor {
#[cfg(feature = "metrics")]
let (start, mut block_metrics) = (metrics::now(), ExecutionMetrics::default());

// fill span
Span::with(|s| {
s.rec("number", &block.number());
});

tracing::info!(number = %block.number(), "reexecuting external block");

// track active block number
Expand Down Expand Up @@ -168,12 +166,10 @@ impl Executor {
receipt: &'b ExternalReceipt,
block: &ExternalBlock,
) -> Result<ExternalTransactionExecution, (&'b ExternalTransaction, &'b ExternalReceipt, anyhow::Error)> {
// fill span
Span::with(|s| {
s.rec("hash", &tx.hash);
});

// execute
self.reexecute_external_tx_inner(tx, receipt, block).await.map_err(|e| (tx, receipt, e))
}

Expand Down Expand Up @@ -250,13 +246,11 @@ impl Executor {
#[cfg(feature = "metrics")]
let (start, function) = (metrics::now(), tx_input.extract_function());

// fill span
Span::with(|s| {
s.rec("hash", &tx_input.hash);
s.rec("from", &tx_input.signer);
s.rec_opt("to", &tx_input.to);
});

tracing::info!(
hash = %tx_input.hash,
nonce = %tx_input.nonce,
Expand Down Expand Up @@ -311,12 +305,10 @@ impl Executor {
#[cfg(feature = "metrics")]
let (start, function) = (metrics::now(), input.extract_function());

// fill span
Span::with(|s| {
s.rec_opt("from", &input.from);
s.rec_opt("to", &input.to);
});

tracing::info!(
from = ?input.from,
to = ?input.to,
Expand Down
7 changes: 0 additions & 7 deletions src/eth/rpc/rpc_server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -294,11 +294,9 @@ async fn eth_get_block_by_number(params: Params<'_>, ctx: Arc<RpcContext>) -> an

#[inline(always)]
async fn eth_get_block_by_selector(params: Params<'_>, ctx: Arc<RpcContext>) -> anyhow::Result<JsonValue, RpcError> {
// parse params
let (params, block_selection) = next_rpc_param::<BlockSelection>(params.sequence())?;
let (_, full_transactions) = next_rpc_param::<bool>(params)?;

// fill span
Span::with(|s| match block_selection {
BlockSelection::Hash(hash) => s.rec("hash", &hash),
BlockSelection::Latest => s.rec("number", &"latest"),
Expand Down Expand Up @@ -365,17 +363,14 @@ async fn eth_estimate_gas(params: Params<'_>, ctx: Arc<RpcContext>) -> anyhow::R

#[tracing::instrument(name = "rpc::eth_call", parent = None, skip_all, fields(from, to))]
async fn eth_call(params: Params<'_>, ctx: Arc<RpcContext>) -> anyhow::Result<String, RpcError> {
// parse params
let (params, call) = next_rpc_param::<CallInput>(params.sequence())?;
let (_, block_selection) = next_rpc_param_or_default::<BlockSelection>(params)?;

// fill span
Span::with(|s| {
s.rec_opt("from", &call.from);
s.rec_opt("to", &call.to);
});

// execute
let point_in_time = ctx.storage.translate_to_point_in_time(&block_selection).await?;
match ctx.executor.call(call, point_in_time).await {
// success or failure, does not matter
Expand All @@ -391,11 +386,9 @@ async fn eth_call(params: Params<'_>, ctx: Arc<RpcContext>) -> anyhow::Result<St

#[tracing::instrument(name = "rpc::eth_sendRawTransaction", parent = None, skip_all, fields(hash, from, to))]
async fn eth_send_raw_transaction(params: Params<'_>, ctx: Arc<RpcContext>) -> anyhow::Result<String, RpcError> {
// parse params
let (_, data) = next_rpc_param::<Bytes>(params.sequence())?;
let tx = parse_rpc_rlp::<TransactionInput>(&data)?;

// fill span
Span::with(|s| {
s.rec("hash", &tx.hash);
s.rec("from", &tx.signer);
Expand Down
1 change: 0 additions & 1 deletion src/eth/storage/stratus_storage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,6 @@ impl StratusStorage {
#[cfg(feature = "metrics")]
let start = metrics::now();

// fill span
Span::with(|s| {
s.rec("address", address);
s.rec("point_in_time", point_in_time);
Expand Down

0 comments on commit 6fad4ed

Please sign in to comment.