Skip to content
Open
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
39 changes: 39 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ members = [
"crates/rpc",
"crates/store",
"crates/test-macro",
"crates/tracing",
"crates/tracing-macro",
"crates/utils",
"crates/validator",
"proto",
Expand Down Expand Up @@ -54,12 +56,15 @@ miden-node-proto-build = { path = "proto", version = "0.14" }
miden-node-rpc = { path = "crates/rpc", version = "0.14" }
miden-node-store = { path = "crates/store", version = "0.14" }
miden-node-test-macro = { path = "crates/test-macro" }
miden-node-tracing = { path = "crates/tracing", version = "0.14" }
miden-node-utils = { path = "crates/utils", version = "0.14" }
miden-node-validator = { path = "crates/validator", version = "0.14" }
miden-remote-prover-client = { path = "crates/remote-prover-client", version = "0.14" }
# Temporary workaround until <https://github.com/rust-rocksdb/rust-rocksdb/pull/1029>
# is part of `rocksdb-rust` release
miden-node-rocksdb-cxx-linkage-fix = { path = "crates/rocksdb-cxx-linkage-fix", version = "0.14" }
miden-node-tracing-macro = { path = "crates/tracing-macro", version = "0.14" }
trybuild = { features = ["diff"], version = "1.0" }

# miden-protocol dependencies. These should be updated in sync.
miden-block-prover = { version = "0.14" }
Expand Down
45 changes: 23 additions & 22 deletions bin/network-monitor/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,25 +15,26 @@ version.workspace = true
workspace = true

[dependencies]
anyhow = { workspace = true }
axum = { version = "0.8" }
clap = { features = ["env"], workspace = true }
hex = { version = "0.4" }
humantime = { workspace = true }
miden-node-proto = { workspace = true }
miden-node-utils = { workspace = true }
miden-protocol = { features = ["std", "testing"], workspace = true }
miden-standards = { workspace = true }
miden-testing = { workspace = true }
miden-tx = { features = ["std"], workspace = true }
rand = { workspace = true }
rand_chacha = { workspace = true }
reqwest = { features = ["json", "query"], workspace = true }
serde = { features = ["derive"], version = "1.0" }
serde_json = { version = "1.0" }
sha2 = { version = "0.10" }
tokio = { features = ["full"], workspace = true }
tonic = { features = ["codegen", "tls-native-roots", "transport"], workspace = true }
tonic-health = { workspace = true }
tracing = { workspace = true }
url = { features = ["serde"], workspace = true }
anyhow = { workspace = true }
axum = { version = "0.8" }
clap = { features = ["env"], workspace = true }
hex = { version = "0.4" }
humantime = { workspace = true }
miden-node-proto = { workspace = true }
miden-node-tracing = { workspace = true }
miden-node-utils = { workspace = true }
miden-protocol = { features = ["std", "testing"], workspace = true }
miden-standards = { workspace = true }
miden-testing = { workspace = true }
miden-tx = { features = ["std"], workspace = true }
rand = { workspace = true }
rand_chacha = { workspace = true }
reqwest = { features = ["json", "query"], workspace = true }
serde = { features = ["derive"], version = "1.0" }
serde_json = { version = "1.0" }
sha2 = { version = "0.10" }
tokio = { features = ["full"], workspace = true }
tonic = { features = ["codegen", "tls-native-roots", "transport"], workspace = true }
tonic-health = { workspace = true }
tracing = { workspace = true }
url = { features = ["serde"], workspace = true }
3 changes: 2 additions & 1 deletion bin/network-monitor/src/commands/start.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
//! This module contains the implementation for starting the network monitoring service.

use anyhow::Result;
use miden_node_tracing::{debug, info, warn};
use miden_node_utils::logging::OpenTelemetry;
use tracing::{debug, info, instrument, warn};
use tracing::instrument;

use crate::COMPONENT;
use crate::config::MonitorConfig;
Expand Down
12 changes: 8 additions & 4 deletions bin/network-monitor/src/counter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ use anyhow::{Context, Result};
use miden_node_proto::clients::RpcClient;
use miden_node_proto::generated::rpc::BlockHeaderByNumberRequest;
use miden_node_proto::generated::transaction::ProvenTransaction;
use miden_node_tracing::{error, info, warn};
use miden_protocol::account::auth::AuthSecretKey;
use miden_protocol::account::{Account, AccountFile, AccountHeader, AccountId};
use miden_protocol::assembly::Library;
Expand All @@ -38,7 +39,7 @@ use miden_tx::{LocalTransactionProver, TransactionExecutor};
use rand::{Rng, SeedableRng};
use rand_chacha::ChaCha20Rng;
use tokio::sync::{Mutex, watch};
use tracing::{error, info, instrument, warn};
use tracing::instrument;

/// Number of consecutive increment failures before re-syncing the wallet account from the RPC.
const RESYNC_FAILURE_THRESHOLD: usize = 3;
Expand Down Expand Up @@ -184,7 +185,7 @@ async fn fetch_wallet_account(
let response = match rpc_client.get_account(request).await {
Ok(response) => response.into_inner(),
Err(e) => {
warn!(account.id = %account_id, err = %e, "failed to fetch wallet account via RPC");
warn!(account.id = %account_id, "failed to fetch wallet account via RPC: {e}");
return Ok(None);
},
};
Expand Down Expand Up @@ -519,11 +520,14 @@ async fn try_resync_wallet_account(
let fresh_account = fetch_wallet_account(rpc_client, wallet_account.id())
.await
.inspect_err(|e| {
error!(account.id = %wallet_account.id(), err = ?e, "failed to re-sync wallet account from RPC");
error!(account.id = %wallet_account.id(), "failed to re-sync wallet account from RPC: {e:?}");
})?
.context("wallet account not found on-chain during re-sync")
.inspect_err(|e| {
error!(account.id = %wallet_account.id(), err = ?e, "wallet account not found on-chain during re-sync");
error!(
account.id = %wallet_account.id(),
"wallet account not found on-chain during re-sync: {e:?}"
);
})?;

info!(account.id = %wallet_account.id(), "wallet account re-synced from RPC");
Expand Down
3 changes: 2 additions & 1 deletion bin/network-monitor/src/explorer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@
use std::fmt::{self, Display};
use std::time::Duration;

use miden_node_tracing::info;
use reqwest::Client;
use serde::Serialize;
use tokio::sync::watch;
use tokio::time::MissedTickBehavior;
use tracing::{info, instrument};
use tracing::instrument;
use url::Url;

use crate::status::{ExplorerStatusDetails, ServiceDetails, ServiceStatus, Status};
Expand Down
3 changes: 2 additions & 1 deletion bin/network-monitor/src/faucet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,15 @@ use std::time::Duration;

use anyhow::Context;
use hex;
use miden_node_tracing::{debug, info, warn};
use miden_protocol::account::AccountId;
use miden_protocol::testing::account_id::ACCOUNT_ID_SENDER;
use reqwest::Client;
use serde::{Deserialize, Serialize};
use sha2::{Digest, Sha256};
use tokio::sync::watch;
use tokio::time::MissedTickBehavior;
use tracing::{debug, info, instrument, warn};
use tracing::instrument;
use url::Url;

use crate::status::{ServiceDetails, ServiceStatus, Status};
Expand Down
3 changes: 2 additions & 1 deletion bin/network-monitor/src/frontend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ use axum::Router;
use axum::http::header;
use axum::response::{Html, IntoResponse, Response};
use axum::routing::get;
use miden_node_tracing::info;
use tokio::sync::watch;
use tracing::{info, instrument};
use tracing::instrument;

use crate::COMPONENT;
use crate::config::MonitorConfig;
Expand Down
3 changes: 2 additions & 1 deletion bin/network-monitor/src/monitor/tasks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,11 @@ use miden_node_proto::clients::{
RemoteProverProxyStatusClient,
RpcClient,
};
use miden_node_tracing::debug;
use tokio::sync::watch::Receiver;
use tokio::sync::{Mutex, watch};
use tokio::task::{Id, JoinSet};
use tracing::{debug, instrument};
use tracing::instrument;

use crate::COMPONENT;
use crate::config::MonitorConfig;
Expand Down
3 changes: 2 additions & 1 deletion bin/network-monitor/src/note_transport.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@

use std::time::Duration;

use miden_node_tracing::info;
use tokio::sync::watch;
use tokio::time::MissedTickBehavior;
use tonic::transport::{Channel, ClientTlsConfig};
use tonic_health::pb::health_client::HealthClient;
use tonic_health::pb::{HealthCheckRequest, health_check_response};
use tracing::{info, instrument};
use tracing::instrument;
use url::Url;

use crate::status::{NoteTransportStatusDetails, ServiceDetails, ServiceStatus, Status};
Expand Down
3 changes: 2 additions & 1 deletion bin/network-monitor/src/remote_prover.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ use std::time::Duration;
use anyhow::Context;
use miden_node_proto::clients::{Builder as ClientBuilder, RemoteProverClient};
use miden_node_proto::generated as proto;
use miden_node_tracing::info;
use miden_protocol::account::auth::AuthScheme;
use miden_protocol::asset::{Asset, FungibleAsset};
use miden_protocol::note::NoteType;
Expand All @@ -19,7 +20,7 @@ use serde::{Deserialize, Serialize};
use tokio::sync::watch;
use tokio::time::MissedTickBehavior;
use tonic::Request;
use tracing::{info, instrument};
use tracing::instrument;
use url::Url;

use crate::status::{ServiceDetails, ServiceStatus, Status};
Expand Down
3 changes: 2 additions & 1 deletion bin/network-monitor/src/status.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,11 @@ use miden_node_proto::clients::{
};
use miden_node_proto::generated as proto;
use miden_node_proto::generated::rpc::{BlockProducerStatus, RpcStatus, StoreStatus};
use miden_node_tracing::{debug, info};
use serde::{Deserialize, Serialize};
use tokio::sync::watch;
use tokio::time::MissedTickBehavior;
use tracing::{debug, info, instrument};
use tracing::instrument;
use url::Url;

use crate::faucet::FaucetTestDetails;
Expand Down
1 change: 1 addition & 0 deletions bin/remote-prover/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ humantime = { workspace = true }
miden-block-prover = { workspace = true }
miden-node-proto = { workspace = true }
miden-node-proto-build = { features = ["internal"], workspace = true }
miden-node-tracing = { workspace = true }
miden-node-utils = { workspace = true }
miden-protocol = { features = ["std"], workspace = true }
miden-tx = { features = ["concurrent", "std"], workspace = true }
Expand Down
2 changes: 1 addition & 1 deletion bin/remote-prover/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use anyhow::Context;
use clap::Parser;
use miden_node_tracing::info;
use miden_node_utils::logging::{OpenTelemetry, setup_tracing};
use tracing::info;

mod generated;
mod server;
Expand Down
1 change: 1 addition & 0 deletions crates/block-producer/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ futures = { workspace = true }
itertools = { workspace = true }
miden-node-proto = { workspace = true }
miden-node-proto-build = { features = ["internal"], workspace = true }
miden-node-tracing = { workspace = true }
miden-node-utils = { features = ["testing"], workspace = true }
miden-protocol = { default-features = true, workspace = true }
miden-remote-prover-client = { features = ["batch-prover", "block-prover"], workspace = true }
Expand Down
Loading