Skip to content

Commit

Permalink
[json rpc] add temp logging to get_transaction_block
Browse files Browse the repository at this point in the history
  • Loading branch information
phoenix-o committed Sep 12, 2024
1 parent 3576d33 commit 5aa7711
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions crates/sui-json-rpc/src/read_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -715,6 +715,7 @@ impl ReadApiServer for ReadApi {
digest: TransactionDigest,
opts: Option<SuiTransactionBlockResponseOptions>,
) -> RpcResult<SuiTransactionBlockResponse> {
info!("get_transaction_block started for {:?}", digest);
with_tracing!(async move {
let opts = opts.unwrap_or_default();
let mut temp_response = IntermediateTransactionResponse::new(digest);
Expand All @@ -731,6 +732,8 @@ impl ReadApiServer for ReadApi {
})
.await
.map_err(Error::from)??;
info!("get_transaction_block fetched transaction for {:?}", digest);

let input_objects = transaction
.data()
.inner()
Expand Down Expand Up @@ -761,6 +764,7 @@ impl ReadApiServer for ReadApi {
.map_err(Error::from)??,
);
}
info!("get_transaction_block fetched effects for {:?}", digest);

temp_response.checkpoint_seq = self
.transaction_kv_store
Expand All @@ -771,6 +775,11 @@ impl ReadApiServer for ReadApi {
Error::from(e)
})?;

info!(
"get_transaction_block fetched checkpoint number for {:?}",
digest
);

if let Some(checkpoint_seq) = &temp_response.checkpoint_seq {
let kv_store = self.transaction_kv_store.clone();
let checkpoint_seq = *checkpoint_seq;
Expand All @@ -787,6 +796,10 @@ impl ReadApiServer for ReadApi {
// TODO(chris): we don't need to fetch the whole checkpoint summary
temp_response.timestamp = Some(checkpoint.timestamp_ms);
}
info!(
"get_transaction_block fetched checkpoint summary for {:?}",
digest
);

if opts.show_events && temp_response.effects.is_some() {
// safe to unwrap because we have checked is_some
Expand Down Expand Up @@ -815,6 +828,7 @@ impl ReadApiServer for ReadApi {
temp_response.events = Some(SuiTransactionBlockEvents::default());
}
}
info!("get_transaction_block fetched events for {:?}", digest);

let object_cache =
ObjectProviderCache::new((self.state.clone(), self.transaction_kv_store.clone()));
Expand Down Expand Up @@ -864,6 +878,7 @@ impl ReadApiServer for ReadApi {
}
}
let epoch_store = self.state.load_epoch_store_one_call_per_task();
info!("finished request for {:?}", digest);
convert_to_response(temp_response, &opts, epoch_store.module_cache())
})
}
Expand Down

0 comments on commit 5aa7711

Please sign in to comment.