Skip to content

Commit 149ed49

Browse files
Execute
1 parent 4e303b9 commit 149ed49

File tree

57 files changed

+211
-232
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+211
-232
lines changed

bin/network-monitor/src/commands/start.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ use crate::monitor::tasks::Tasks;
1313

1414
/// Start the network monitoring service.
1515
///
16-
/// This function initializes all monitoring tasks including RPC status checking,
17-
/// remote prover testing, faucet testing, and the web frontend.
16+
/// This function initializes all monitoring tasks including RPC status checking, remote prover
17+
/// testing, faucet testing, and the web frontend.
1818
#[instrument(target = COMPONENT, name = "start-monitor", skip_all, fields(port = %config.port))]
1919
pub async fn start_monitor(config: MonitorConfig) -> Result<()> {
2020
// Load configuration from command-line arguments and environment variables

bin/network-monitor/src/counter.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//! Counter increment task functionality.
22
//!
3-
//! This module contains the implementation for periodically incrementing the counter
4-
//! of the network account deployed at startup by creating and submitting network notes.
3+
//! This module contains the implementation for periodically incrementing the counter of the network
4+
//! account deployed at startup by creating and submitting network notes.
55
66
use std::path::Path;
77
use std::sync::Arc;
@@ -315,8 +315,8 @@ fn send_status(tx: &watch::Sender<ServiceStatus>, status: ServiceStatus) -> Resu
315315

316316
/// Run the counter tracking task.
317317
///
318-
/// This function periodically fetches the current counter value from the network
319-
/// and updates the tracking details.
318+
/// This function periodically fetches the current counter value from the network and updates the
319+
/// tracking details.
320320
///
321321
/// # Arguments
322322
///

bin/network-monitor/src/deploy/mod.rs

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,8 @@ use crate::deploy::wallet::{create_wallet_account, save_wallet_account};
4040
pub mod counter;
4141
pub mod wallet;
4242

43-
/// Create an RPC client configured with the correct genesis metadata in the
44-
/// `Accept` header so that write RPCs such as `SubmitProvenTransaction` are
45-
/// accepted by the node.
43+
/// Create an RPC client configured with the correct genesis metadata in the `Accept` header so that
44+
/// write RPCs such as `SubmitProvenTransaction` are accepted by the node.
4645
pub async fn create_genesis_aware_rpc_client(
4746
rpc_url: &Url,
4847
timeout: Duration,
@@ -98,9 +97,8 @@ pub async fn create_genesis_aware_rpc_client(
9897

9998
/// Ensure accounts exist, creating them if they don't.
10099
///
101-
/// This function checks if the wallet and counter account files exist.
102-
/// If they don't exist, it creates new accounts and saves them to the specified files.
103-
/// If they do exist, it does nothing.
100+
/// This function checks if the wallet and counter account files exist. If they don't exist, it
101+
/// creates new accounts and saves them to the specified files. If they do exist, it does nothing.
104102
///
105103
/// # Arguments
106104
///
@@ -141,8 +139,7 @@ pub async fn ensure_accounts_exist(
141139

142140
/// Deploy counter account to the network.
143141
///
144-
/// This function creates a counter program account,
145-
/// then saves it to the specified file.
142+
/// This function creates a counter program account, then saves it to the specified file.
146143
#[instrument(target = COMPONENT, name = "deploy-counter-account", skip_all, ret(level = "debug"))]
147144
pub async fn deploy_counter_account(counter_account: &Account, rpc_url: &Url) -> Result<()> {
148145
// Deploy counter account to the network using a genesis-aware RPC client.

bin/network-monitor/src/faucet.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//! Faucet testing functionality.
22
//!
3-
//! This module contains the logic for periodically testing faucet functionality
4-
//! by requesting proof-of-work challenges, solving them, and submitting token requests.
3+
//! This module contains the logic for periodically testing faucet functionality by requesting
4+
//! proof-of-work challenges, solving them, and submitting token requests.
55
66
use std::time::Duration;
77

bin/network-monitor/src/main.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//! Miden Network Monitor
22
//!
3-
//! A monitor application for Miden network infrastructure that provides real-time status
4-
//! monitoring and account deployment capabilities.
3+
//! A monitor application for Miden network infrastructure that provides real-time status monitoring
4+
//! and account deployment capabilities.
55
66
use anyhow::Result;
77
use clap::Parser;
@@ -28,8 +28,8 @@ pub const COMPONENT: &str = "miden-network-monitor";
2828

2929
/// Network Monitor main function.
3030
///
31-
/// This function parses command-line arguments and delegates to the appropriate
32-
/// command handler. The monitor supports two main commands:
31+
/// This function parses command-line arguments and delegates to the appropriate command handler.
32+
/// The monitor supports two main commands:
3333
/// - `start`: Runs the network monitoring service with web dashboard
3434
/// - `deploy-account`: Creates and deploys Miden accounts to the network
3535
#[tokio::main]

bin/network-monitor/src/monitor/tasks.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -355,8 +355,8 @@ impl Tasks {
355355

356356
/// Gets the current Unix timestamp in seconds.
357357
///
358-
/// This function is infallible - if the system time is somehow before Unix epoch
359-
/// (extremely unlikely), it returns 0.
358+
/// This function is infallible - if the system time is somehow before Unix epoch (extremely
359+
/// unlikely), it returns 0.
360360
pub fn current_unix_timestamp_secs() -> u64 {
361361
SystemTime::now()
362362
.duration_since(UNIX_EPOCH)

bin/network-monitor/src/remote_prover.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,8 @@ pub struct ProverTestDetails {
7373

7474
/// Runs a task that continuously tests remote prover functionality and updates a watch channel.
7575
///
76-
/// This function spawns a task that periodically sends mock request payloads to a remote prover
77-
/// and measures the success/failure rate and performance metrics for proof generation.
76+
/// This function spawns a task that periodically sends mock request payloads to a remote prover and
77+
/// measures the success/failure rate and performance metrics for proof generation.
7878
///
7979
/// # Arguments
8080
///
@@ -213,8 +213,8 @@ async fn test_remote_prover(
213213

214214
/// Converts a `tonic::Status` error to a JSON string with structured error information.
215215
///
216-
/// This function extracts the code, message, details, and metadata from a `tonic::Status`
217-
/// error and serializes them into a JSON string for structured error reporting.
216+
/// This function extracts the code, message, details, and metadata from a `tonic::Status` error and
217+
/// serializes them into a JSON string for structured error reporting.
218218
///
219219
/// # Arguments
220220
///
@@ -254,9 +254,9 @@ fn tonic_status_to_json(status: &tonic::Status) -> String {
254254

255255
/// Generates a mock transaction for testing remote prover functionality.
256256
///
257-
/// This function creates a mock transaction using `MockChainBuilder` similar to what's done
258-
/// in the remote prover tests. The transaction is generated once and can be reused for
259-
/// multiple proof test calls.
257+
/// This function creates a mock transaction using `MockChainBuilder` similar to what's done in the
258+
/// remote prover tests. The transaction is generated once and can be reused for multiple proof test
259+
/// calls.
260260
pub async fn generate_mock_transaction() -> anyhow::Result<TransactionInputs> {
261261
let mut mock_chain_builder = MockChainBuilder::new();
262262

bin/network-monitor/src/status.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//! Network monitor status checker.
22
//!
3-
//! This module contains the logic for checking the status of network services.
4-
//! Individual status checker tasks send updates via watch channels to the web server.
3+
//! This module contains the logic for checking the status of network services. Individual status
4+
//! checker tasks send updates via watch channels to the web server.
55
66
use std::time::Duration;
77

@@ -132,8 +132,8 @@ pub struct StoreStatusDetails {
132132

133133
/// Details of a block producer service.
134134
///
135-
/// This struct contains the details of a block producer service, which is a union of the details
136-
/// of the block producer service.
135+
/// This struct contains the details of a block producer service, which is a union of the details of
136+
/// the block producer service.
137137
#[derive(Debug, Clone, Serialize, Deserialize)]
138138
pub struct BlockProducerStatusDetails {
139139
pub version: String,
@@ -155,8 +155,8 @@ pub struct MempoolStatusDetails {
155155

156156
/// Details of a remote prover service.
157157
///
158-
/// This struct contains the details of a remote prover service, which is a union of the details
159-
/// of the remote prover service.
158+
/// This struct contains the details of a remote prover service, which is a union of the details of
159+
/// the remote prover service.
160160
#[derive(Debug, Clone, Serialize, Deserialize)]
161161
pub struct RemoteProverStatusDetails {
162162
pub url: String,
@@ -267,8 +267,8 @@ impl From<RpcStatus> for RpcStatusDetails {
267267

268268
/// Runs a task that continuously checks RPC status and updates a watch channel.
269269
///
270-
/// This function spawns a task that periodically checks the RPC service status
271-
/// and sends updates through a watch channel.
270+
/// This function spawns a task that periodically checks the RPC service status and sends updates
271+
/// through a watch channel.
272272
///
273273
/// # Arguments
274274
///
@@ -357,8 +357,8 @@ pub(crate) async fn check_rpc_status(
357357

358358
/// Runs a task that continuously checks remote prover status and updates a watch channel.
359359
///
360-
/// This function spawns a task that periodically checks a remote prover service status
361-
/// and sends updates through a watch channel.
360+
/// This function spawns a task that periodically checks a remote prover service status and sends
361+
/// updates through a watch channel.
362362
///
363363
/// # Arguments
364364
///

bin/remote-prover/src/api/prover.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ impl std::str::FromStr for ProofType {
5050

5151
/// The prover for the remote prover.
5252
///
53-
/// This enum is used to store the prover for the remote prover.
54-
/// Only one prover is enabled at a time.
53+
/// This enum is used to store the prover for the remote prover. Only one prover is enabled at a
54+
/// time.
5555
enum Prover {
5656
Transaction(Mutex<LocalTransactionProver>),
5757
Batch(Mutex<LocalBatchProver>),

bin/remote-prover/src/proxy/mod.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -243,9 +243,9 @@ static RATE_LIMITER: LazyLock<Rate> = LazyLock::new(|| Rate::new(Duration::from_
243243
// REQUEST QUEUE
244244
// ================================================================================================
245245

246-
/// Request queue holds the list of requests that are waiting to be processed by the workers and
247-
/// the time they were enqueued.
248-
/// It is used to keep track of the order of the requests to then assign them to the workers.
246+
/// Request queue holds the list of requests that are waiting to be processed by the workers and the
247+
/// time they were enqueued. It is used to keep track of the order of the requests to then assign
248+
/// them to the workers.
249249
pub struct RequestQueue {
250250
queue: RwLock<VecDeque<(Uuid, Instant)>>,
251251
}
@@ -299,8 +299,8 @@ static QUEUE: LazyLock<RequestQueue> = LazyLock::new(RequestQueue::new);
299299

300300
/// Pingora `RequestHeader` injector for OpenTelemetry trace context propagation.
301301
///
302-
/// This allows the proxy to inject trace context into headers that will be forwarded
303-
/// to worker nodes, enabling proper parent-child trace relationships.
302+
/// This allows the proxy to inject trace context into headers that will be forwarded to worker
303+
/// nodes, enabling proper parent-child trace relationships.
304304
struct PingoraHeaderInjector<'a>(&'a mut pingora::http::RequestHeader);
305305

306306
impl opentelemetry::propagation::Injector for PingoraHeaderInjector<'_> {
@@ -321,8 +321,8 @@ impl opentelemetry::propagation::Injector for PingoraHeaderInjector<'_> {
321321
/// Custom context for the request/response lifecycle
322322
///
323323
/// We use this context to keep track of the number of tries for a request, the unique ID for the
324-
/// request, the worker that will process the request, a span that will be used for traces along
325-
/// the transaction execution, and a timer to track how long the request took.
324+
/// request, the worker that will process the request, a span that will be used for traces along the
325+
/// transaction execution, and a timer to track how long the request took.
326326
#[derive(Debug)]
327327
pub struct RequestContext {
328328
/// Number of tries for the request
@@ -362,9 +362,9 @@ impl RequestContext {
362362

363363
/// Wrapper around the load balancer that implements the [`ProxyHttp`] trait
364364
///
365-
/// This wrapper is used to implement the [`ProxyHttp`] trait for [`Arc<LoadBalancer>`].
366-
/// This is necessary because we want to share the load balancer between the proxy server and the
367-
/// health check background service.
365+
/// This wrapper is used to implement the [`ProxyHttp`] trait for [`Arc<LoadBalancer>`]. This is
366+
/// necessary because we want to share the load balancer between the proxy server and the health
367+
/// check background service.
368368
#[derive(Debug)]
369369
pub struct LoadBalancer(pub Arc<LoadBalancerState>);
370370

0 commit comments

Comments
 (0)