Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bin/network-monitor/src/commands/start.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ use crate::{COMPONENT, LOG_TARGET};
name = "network_monitor.start_monitor",
level = "info",
fields(
port = %config.port,
port = config.port,
),
ret(level = "debug"),
err,
Expand Down
2 changes: 1 addition & 1 deletion bin/network-monitor/src/counter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ impl IncrementService {
target = COMPONENT,
name = "network_monitor.counter.try_resync_wallet_account",
fields(
account.id = %self.tx.wallet_account.id(),
account.id = self.tx.wallet_account.id(),
),
level = "warn",
err,
Expand Down
4 changes: 2 additions & 2 deletions bin/network-monitor/src/remote_prover.rs
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ impl Service for ProverStatusService {
level = "info",
ret(level = "debug"),
fields(
prover = %self.name,
prover = self.name,
),
)]
async fn check(&mut self) -> ServiceStatus {
Expand Down Expand Up @@ -357,7 +357,7 @@ const PAYLOAD_RETRY_DELAY: Duration = Duration::from_secs(30);
name = "network_monitor.prover.run_test",
level = "info",
fields(
prover = %name,
prover = name,
),
)]
async fn run_prover_test(
Expand Down
8 changes: 4 additions & 4 deletions bin/ntx-builder/src/actor/execute.rs
Original file line number Diff line number Diff line change
Expand Up @@ -269,10 +269,10 @@ impl NtxContext {
chain_mmr,
} = tx;
miden_span_record!(
account.id = %account.id(),
account.id.network_prefix = %account.id().prefix(),
notes.count = num_notes,
reference_block.number = %chain_tip_header.block_num(),
account.id = account.id(),
account.id.network_prefix = account.id().prefix(),
note.count = num_notes,
reference_block.number = chain_tip_header.block_num()
);

async move {
Expand Down
2 changes: 1 addition & 1 deletion bin/ntx-builder/src/actor/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -638,7 +638,7 @@ impl AccountActor {
/// re-declaring the stale commitment.
#[miden_instrument(
name = "ntx.actor.execute_transactions",
fields(account.id = %account_id),
fields(account.id = account_id),
)]
async fn execute_transactions(
&self,
Expand Down
4 changes: 2 additions & 2 deletions bin/ntx-builder/src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -242,8 +242,8 @@ impl NetworkTransactionBuilder {
#[miden_instrument(
name = "ntx.builder.apply_committed_block",
fields(
block.number = %block.header().block_num(),
tip.number = %committed_tip,
block.number = block.header().block_num(),
tip.number = committed_tip,
),
)]
async fn apply_committed_block_with_effects(
Expand Down
2 changes: 1 addition & 1 deletion bin/ntx-builder/src/clients/rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ impl RpcClient {
target = COMPONENT,
name = "rpc.client.block_subscription_with_retry",
fields(
block.from = %block_from,
block.from = block_from,
),
err,
)]
Expand Down
2 changes: 1 addition & 1 deletion bin/ntx-builder/src/coordinator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ impl Coordinator {
/// processing transactions and managing state for the network account.
#[miden_instrument(
name = "ntx.builder.spawn_actor",
fields(account.id = %account_id),
fields(account.id = account_id),
)]
pub fn spawn_actor(&mut self, account_id: AccountId) {
if let Some(&count) = self.crash_counts.get(&account_id)
Expand Down
6 changes: 3 additions & 3 deletions bin/ntx-builder/src/db/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ impl NtxDbWriter {
#[miden_instrument(
target = COMPONENT,
name = "ntx_builder.database.load",
fields(path=%database_filepath.display()),
fields(path = database_filepath),
err,
)]
pub async fn load(database_filepath: PathBuf) -> anyhow::Result<NtxDbWriter> {
Expand All @@ -287,7 +287,7 @@ pub async fn load(database_filepath: PathBuf) -> anyhow::Result<NtxDbWriter> {
#[miden_instrument(
target = COMPONENT,
name = "ntx_builder.database.load",
fields(path=%database_filepath.display()),
fields(path = database_filepath),
err,
)]
pub async fn load_with_pool_size(
Expand Down Expand Up @@ -335,7 +335,7 @@ fn open_with_pool_size(
#[miden_instrument(
target = COMPONENT,
name = "ntx_builder.database.bootstrap",
fields(path=%database_filepath.display()),
fields(path = database_filepath),
err,
)]
pub async fn bootstrap(database_filepath: PathBuf, genesis: &SignedBlock) -> anyhow::Result<()> {
Expand Down
2 changes: 1 addition & 1 deletion bin/ntx-builder/src/server/get_network_note_status.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ impl grpc::server::ntx_builder_api::GetNetworkNoteStatus for NtxBuilderRpcServer
target = COMPONENT,
name = "get_network_note_status",
fields (
note.id = %note_id,
note.id = note_id,
),
err,
)]
Expand Down
9 changes: 9 additions & 0 deletions bin/remote-prover/src/server/proof_kind.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use miden_node_proto::generated::remote_prover as proto;
use miden_node_utils::tracing::RecordAttribute;

/// Specifies the type of proof supported by the remote prover.
#[derive(Debug, Clone, Copy, PartialEq, clap::ValueEnum)]
Expand Down Expand Up @@ -33,3 +34,11 @@ impl std::fmt::Display for ProofKind {
f.write_str(self.as_str())
}
}

impl RecordAttribute for ProofKind {
const FIELD_NAMES: &'static [&'static str] = &["prover.kind", "request.kind"];

fn record_attribute(&self) -> impl tracing::Value + '_ {
self.as_str()
}
}
Comment thread
Mirko-von-Leipzig marked this conversation as resolved.
4 changes: 1 addition & 3 deletions bin/remote-prover/src/server/prove.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,7 @@ impl grpc::server::remote_prover_api::Prove for ProverService {
_metadata: &tonic::metadata::MetadataMap,
_extensions: &tonic::codegen::http::Extensions,
) -> tonic::Result<Self::Output> {
miden_span_record!(
request.kind = %proof_kind,
);
miden_span_record!(request.kind = proof_kind);

// Reject unsupported proof types early so they don't clog the queue.
if !self.is_supported(proof_kind) {
Expand Down
2 changes: 1 addition & 1 deletion bin/validator/src/db/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ async fn setup_with_pool_size(
/// Returns an error if the database has already been bootstrapped.
#[miden_instrument(
target = COMPONENT,
fields(path = %database_filepath.display()),
fields(path = database_filepath),
err,
)]
pub async fn bootstrap(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ impl grpc::server::validator_api::BlockSubscription for ValidatorService {
_metadata: &tonic::metadata::MetadataMap,
_extensions: &tonic::codegen::http::Extensions,
) -> tonic::Result<Self::ItemStream> {
miden_span_record!(block.from = request.block_from,);
miden_span_record!(block.from = request.block_from);

let committed_tip = *self.committed_tip.borrow();
if request.block_from > committed_tip.as_u32() {
Expand All @@ -74,7 +74,7 @@ impl grpc::server::validator_api::BlockSubscription for ValidatorService {
let from = BlockNumber::from(request.block_from);
// The tip should never move since we are in recovery mode and therefore there is no active
// sequencer.
miden_span_record!(tip.number = %committed_tip);
miden_span_record!(tip.number = committed_tip);

let (tx, rx) = tokio::sync::mpsc::channel(32);

Expand Down
8 changes: 4 additions & 4 deletions bin/validator/src/server/validator_service/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ impl ValidatorService {
proposed_block: ProposedBlock,
chain_tip: BlockHeader,
) -> Result<(Signature, BlockHeader), ValidatorError> {
miden_span_record!(tip.number = chain_tip.block_num().as_u32(),);
miden_span_record!(tip.number = chain_tip.block_num());

// Search for any proposed transactions that have not previously been validated.
let proposed_tx_ids =
Expand All @@ -230,8 +230,8 @@ impl ValidatorService {
.map_err(ValidatorError::BlockBuildingFailed)?;

miden_span_record!(
block.number = proposed_header.block_num().as_u32(),
block.commitment = %proposed_header.commitment(),
block.number = proposed_header.block_num(),
block.commitment = proposed_header.commitment()
);

// If the proposed block has the same block number as the current chain tip, this is a
Expand Down Expand Up @@ -308,7 +308,7 @@ impl ValidatorService {
name = "sign_block",
err,
fields(
block.number = header.block_num().as_u32(),
block.number = header.block_num(),
),
)]
async fn sign_header(&self, header: &BlockHeader) -> Result<Signature, ValidatorError> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,7 @@ impl grpc::server::validator_api::SubmitProvenTransaction for ValidatorService {
) -> tonic::Result<Self::Output> {
let Input { tx, sealed } = input;
let tx_id = tx.id();
miden_span_record!(
transaction.id = %tx_id,
);
miden_span_record!(transaction.id = tx_id);

let inputs = self.unseal_transaction_inputs(&sealed, tx_id).await?;

Expand Down
25 changes: 12 additions & 13 deletions crates/block-producer/src/batch_builder/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ use std::time::Duration;
use futures::TryFutureExt;
use miden_node_proto::domain::batch::BatchInputs;
use miden_node_store::state::State;
use miden_node_utils::formatting::format_array;
use miden_node_utils::shutdown::CancellationToken;
use miden_node_utils::spawn::spawn_blocking_in_current_span;
use miden_node_utils::tracing::{ErrorSpanExt, miden_instrument, miden_span_record};
Expand Down Expand Up @@ -147,17 +146,17 @@ impl BatchBuilder {
fn build_batch(&mut self, mempool: SharedMempool, batch: SelectedBatch) {
miden_span_record!(
workers.active = self.active_jobs.len(),
workers.capacity = self.num_workers.get(),
workers.capacity = self.num_workers.get()
);

let telemetry = batch.telemetry();
miden_span_record!(
batch.id = %telemetry.batch_id,
transactions.count = telemetry.transactions_count,
transactions.ids = %format_array(&telemetry.transaction_ids),
transactions.input_notes.count = telemetry.input_notes_count,
transactions.output_notes.count = telemetry.output_notes_count,
transactions.unauthenticated_notes.count = telemetry.unauthenticated_notes_count,
batch.id = telemetry.batch_id,
transaction.count = telemetry.transactions_count,
transaction.ids = telemetry.transaction_ids,
transaction.input_note.count = telemetry.input_notes_count,
transaction.output_note.count = telemetry.output_notes_count,
transaction.unauthenticated_note.count = telemetry.unauthenticated_notes_count
);
let job = BatchJob {
state: self.state.clone(),
Expand Down Expand Up @@ -258,10 +257,10 @@ impl BatchJob {
.inspect_ok(|proposed| {
let telemetry = proposed_batch_telemetry(proposed);
miden_span_record!(
batch.expiration_height = %telemetry.expiration_height,
batch.account_updates.count = telemetry.account_updates_count,
batch.input_notes.count = telemetry.input_notes_count,
batch.output_notes.count = telemetry.output_notes_count,
batch.expiration_height = telemetry.expiration_height,
batch.account_update.count = telemetry.account_updates_count,
batch.input_note.count = telemetry.input_notes_count,
batch.output_note.count = telemetry.output_notes_count
);
})
.and_then(|proposed| self.prove_batch(proposed))
Expand Down Expand Up @@ -347,7 +346,7 @@ impl BatchJob {
&self,
proposed_batch: ProposedBatch,
) -> Result<Arc<ProvenBatch>, BuildBatchError> {
miden_span_record!(prover.kind = self.batch_prover.kind(),);
miden_span_record!(prover.kind = self.batch_prover.kind());

let proven_batch = match &self.batch_prover {
BatchProver::Remote(prover) => prover
Expand Down
28 changes: 14 additions & 14 deletions crates/block-producer/src/block_builder/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -125,11 +125,11 @@ impl BlockBuilder {
let selected = Self::select_block(mempool)?;
let telemetry = selected.telemetry();
miden_span_record!(
block.number = %telemetry.block_number,
block.batches.count = telemetry.batches_count,
block.batch.ids = %format_array(telemetry.batch_ids),
block.transactions.ids = %format_array(&telemetry.transaction_ids),
block.transactions.count = telemetry.transactions_count,
block.number = telemetry.block_number,
block.batch.count = telemetry.batches_count,
block.batch.ids = telemetry.batch_ids,
block.transaction.ids = telemetry.transaction_ids,
block.transaction.count = telemetry.transactions_count
);
let block_num = selected.block_number;

Expand All @@ -143,18 +143,18 @@ impl BlockBuilder {
.inspect_ok(|inputs| {
let telemetry = inputs.telemetry();
miden_span_record!(
block.updated_accounts.count = telemetry.updated_accounts_count,
block.erased_note_proofs.count = telemetry.erased_note_proofs_count,
block.updated_account.count = telemetry.updated_accounts_count,
block.erased_note_proof.count = telemetry.erased_note_proofs_count
);
})
.and_then(|inputs| self.propose_block(inputs))
.inspect_ok(|proposed_block| {
let telemetry = proposed_block_telemetry(&proposed_block.proposed_block);
miden_span_record!(
block.nullifiers.count = telemetry.nullifiers_count,
block.output_notes.count = telemetry.output_notes_count,
block.batches.output_notes.count = telemetry.batch_output_notes_count,
block.erased_notes.count = telemetry.erased_notes_count,
block.nullifier.count = telemetry.nullifiers_count,
block.output_note.count = telemetry.output_notes_count,
block.batch.output_note.count = telemetry.batch_output_notes_count,
block.erased_note.count = telemetry.erased_notes_count
);
})
.and_then(|proposed_block| self.build_and_validate_block(proposed_block))
Expand Down Expand Up @@ -374,9 +374,9 @@ impl BlockBuilder {
let num_transactions = signed_block.body().transactions().as_slice().len();

miden_span_record!(
block.number = %header.block_num(),
block.commitment = %header.commitment(),
block.transactions.count = num_transactions,
block.number = header.block_num(),
block.commitment = header.commitment(),
block.transaction.count = num_transactions
);

if num_transactions > 0 {
Expand Down
Loading
Loading