Skip to content

Commit 812a29f

Browse files
starknet_os_runner: fix log`s prefix (#12529)
1 parent a5179f9 commit 812a29f

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

crates/starknet_os_runner/src/runner.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ use starknet_api::transaction::{
2323
use starknet_os::commitment_infos::CommitmentInfo;
2424
use starknet_os::io::os_input::{OsBlockInput, OsHints, OsHintsConfig, StarknetOsInput};
2525
use starknet_os::runner::run_virtual_os;
26-
use tracing::info;
26+
use tracing::field::display;
27+
use tracing::{info, Span};
2728
use url::Url;
2829

2930
use crate::classes_provider::ClassesProvider;
@@ -279,11 +280,10 @@ where
279280
let tx_hash = tx
280281
.calculate_transaction_hash(&chain_id, &version)
281282
.map_err(|e| RunnerError::TransactionHashError(e.to_string()))?;
282-
info!(
283-
block_id = ?block_id,
284-
tx_hash = %tx_hash,
285-
"Starting transaction proving"
286-
);
283+
// Record tx_hash on the parent span (`prove_transaction`) so all
284+
// subsequent logs carry it as a prefix.
285+
Span::current().record("tx_hash", display(&tx_hash));
286+
info!(transaction = ?tx, "Starting transaction proving");
287287
Ok((tx, tx_hash))
288288
})
289289
.collect::<Result<Vec<_>, RunnerError>>()?;

crates/starknet_os_runner/src/virtual_snos_prover.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ impl<R: VirtualSnosRunner> VirtualSnosProver<R> {
118118
/// 2. Calculates the transaction hash.
119119
/// 3. Runs the Starknet OS.
120120
/// 4. Generates a proof.
121-
#[instrument(skip(self), fields(block_id, tx_hash))]
121+
#[instrument(skip(self, transaction), fields(block_id = ?block_id, tx_hash))]
122122
pub async fn prove_transaction(
123123
&self,
124124
block_id: BlockId,

0 commit comments

Comments
 (0)