Skip to content

Commit d0b9ad0

Browse files
committed
fix(coprocessor): move high-cardinality ids from child spans to log events and fix span correlation gap
1 parent 7b0c3f2 commit d0b9ad0

File tree

3 files changed

+24
-16
lines changed

3 files changed

+24
-16
lines changed

coprocessor/fhevm-engine/sns-worker/src/aws_upload.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -537,10 +537,12 @@ async fn fetch_pending_uploads(
537537
"recovery_task",
538538
transaction_hash = transaction_id.as_deref().map(to_hex).unwrap_or_default(),
539539
);
540-
info!(
541-
handle = %to_hex(&handle),
542-
"recovery task for handle"
543-
);
540+
recovery_span.in_scope(|| {
541+
info!(
542+
handle = %to_hex(&handle),
543+
"recovery task for handle"
544+
);
545+
});
544546
let item = HandleItem {
545547
host_chain_id: ChainId::try_from(row.host_chain_id)
546548
.map_err(|e| ExecutionError::ConversionError(e.into()))?,

coprocessor/fhevm-engine/transaction-sender/src/ops/add_ciphertext.rs

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,7 @@ impl<P> AddCiphertextOperation<P>
4141
where
4242
P: Provider<Ethereum> + Clone + 'static,
4343
{
44-
#[tracing::instrument(
45-
name = "call_add_ciphertext",
46-
skip_all,
47-
fields(transaction_hash = src_transaction_id.as_deref().map(to_hex).unwrap_or_default())
48-
)]
44+
#[tracing::instrument(name = "call_add_ciphertext", skip_all)]
4945
async fn send_transaction(
5046
&self,
5147
handle: &[u8],
@@ -56,7 +52,14 @@ where
5652
) -> anyhow::Result<()> {
5753
let h = to_hex(handle);
5854

59-
info!(handle = h, "Processing transaction");
55+
info!(
56+
transaction_hash = src_transaction_id
57+
.as_deref()
58+
.map(to_hex)
59+
.unwrap_or_default(),
60+
handle = h,
61+
"Processing transaction"
62+
);
6063

6164
let receipt = match self
6265
.provider

coprocessor/fhevm-engine/transaction-sender/src/ops/verify_proof.rs

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -118,18 +118,21 @@ where
118118
Ok(())
119119
}
120120

121-
#[tracing::instrument(
122-
name = "call_verify_proof_resp",
123-
skip_all,
124-
fields(transaction_hash = src_transaction_id.as_deref().map(to_hex).unwrap_or_default())
125-
)]
121+
#[tracing::instrument(name = "call_verify_proof_resp", skip_all)]
126122
async fn process_proof(
127123
&self,
128124
txn_request: (i64, impl Into<TransactionRequest>),
129125
current_retry_count: i32,
130126
src_transaction_id: Option<Vec<u8>>,
131127
) -> anyhow::Result<()> {
132-
info!(zk_proof_id = txn_request.0, "Processing transaction");
128+
info!(
129+
transaction_hash = src_transaction_id
130+
.as_deref()
131+
.map(to_hex)
132+
.unwrap_or_default(),
133+
zk_proof_id = txn_request.0,
134+
"Processing transaction"
135+
);
133136

134137
let receipt = match self
135138
.provider

0 commit comments

Comments
 (0)