diff --git a/.cargo/audit.toml b/.cargo/audit.toml index 1ec2275..974a85d 100644 --- a/.cargo/audit.toml +++ b/.cargo/audit.toml @@ -6,5 +6,7 @@ ignore = [ "RUSTSEC-2025-0022", "RUSTSEC-2026-0104", "RUSTSEC-2026-0098", - "RUSTSEC-2026-0099" + "RUSTSEC-2026-0099", + "RUSTSEC-2026-0195", + "RUSTSEC-2026-0194" ] diff --git a/Cargo.lock b/Cargo.lock index e170d89..8ceded8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1336,9 +1336,9 @@ dependencies = [ [[package]] name = "crossbeam-epoch" -version = "0.9.18" +version = "0.9.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" +checksum = "2d6914041f254d6e9176c01941b21115dcfb7089e55135a35411081bd106ef3f" dependencies = [ "crossbeam-utils", ] @@ -4096,9 +4096,9 @@ dependencies = [ [[package]] name = "quinn-proto" -version = "0.11.14" +version = "0.11.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "434b42fec591c96ef50e21e886936e66d3cc3f737104fdb9b737c40ffb94c098" +checksum = "4fcb935c5bec503c2f0e306bdd3e58bb9029dcb14fa8d9ac76e3a5256ac0763e" dependencies = [ "bytes", "fastbloom", @@ -4641,7 +4641,7 @@ dependencies = [ "security-framework 3.7.0", "security-framework-sys", "webpki-root-certs", - "windows-sys 0.61.2", + "windows-sys 0.60.2", ] [[package]] @@ -9242,7 +9242,7 @@ version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" dependencies = [ - "windows-sys 0.59.0", + "windows-sys 0.48.0", ] [[package]] diff --git a/bam-writer-service/src/lib.rs b/bam-writer-service/src/lib.rs index 6c3b637..8798f09 100644 --- a/bam-writer-service/src/lib.rs +++ b/bam-writer-service/src/lib.rs @@ -106,7 +106,7 @@ impl BamWriterService { if let Some(ref overrides) = override_eligible_validators { log::info!( - "Using override eligible validators ({} pubkeys): {:?}", + "Using override eligible validators count={} validators={:?}", overrides.len(), overrides ); @@ -114,8 +114,7 @@ impl BamWriterService { if let Some(delegation) = override_delegation_lamports { log::info!( - "Using override delegation amount: {} lamports ({:.2} SOL)", - delegation, + "Using override delegation amount lamports={delegation} sol={:.2}", delegation as f64 / 1_000_000_000.0 ); } @@ -191,10 +190,9 @@ impl BamWriterService { Ok(vote_account) => vote_account, Err(err) => { log::warn!( - "Skipping historical BAM validator with invalid vote account {} at epoch {}: {}", + "Skipping historical BAM validator with invalid vote account vote_account={} epoch={}: {err:#}", validator.get_vote_account(), epoch, - err ); continue; } @@ -231,7 +229,7 @@ impl BamWriterService { { // Override mode: use hardcoded list of vote account pubkeys log::info!( - "Using override eligible validators ({} pubkeys)", + "Using override eligible validators count={}", override_validators.len() ); @@ -259,7 +257,7 @@ impl BamWriterService { validators.push(bam_validator); } else { log::warn!( - "Override validator {} not found in current vote accounts", + "Override validator not found in current vote accounts vote_pubkey={}", vote_pubkey ); } @@ -434,8 +432,7 @@ impl BamWriterService { { // Override mode: use hardcoded delegation amount log::info!( - "Using override delegation: {} lamports ({:.2} SOL)", - override_delegation, + "Using override delegation lamports={override_delegation} sol={:.2}", override_delegation as f64 / 1_000_000_000.0 ); diff --git a/bam-writer-service/src/main.rs b/bam-writer-service/src/main.rs index c2bbeee..28112ab 100644 --- a/bam-writer-service/src/main.rs +++ b/bam-writer-service/src/main.rs @@ -128,12 +128,12 @@ async fn main() -> anyhow::Result<()> { if progress >= threshold && !thresholds_hit.contains(&idx) { let threshold_pct = threshold * 100.0; - info!("Reached {threshold_pct:.0}% threshold for epoch {current_epoch}"); + info!("Reached epoch progress threshold_pct={threshold_pct:.0} epoch={current_epoch}"); match bam_writer_service.run().await { Ok(()) => { info!( - "Successfully processed at {threshold_pct:.0}% of epoch {current_epoch}" + "BAM writer run succeeded threshold_pct={threshold_pct:.0} epoch={current_epoch}" ); thresholds_hit.insert(idx); @@ -147,7 +147,7 @@ async fn main() -> anyhow::Result<()> { } Err(e) => { error!( - "Error processing at {threshold_pct:.0}% of epoch {current_epoch}: {e}" + "BAM writer run failed threshold_pct={threshold_pct:.0} epoch={current_epoch}: {e:#}" ); datapoint_info!( diff --git a/cranker/src/main.rs b/cranker/src/main.rs index ae4fbe5..fe29fa5 100644 --- a/cranker/src/main.rs +++ b/cranker/src/main.rs @@ -48,14 +48,14 @@ async fn update_stake_pool(config: &Config, epoch: Epoch) -> anyhow::Result<()> let slack_message = match &result { Ok(()) => "Cranker has successfully run Stake Pool Update", Err(e) => { - error!("Cranker failed to update, {e:?}"); + error!("Cranker failed to update: {e:#}"); "Cranker failed to update. Please manually run stake pool update" } }; // Fire-and-forget Slack notification (don't fail the function if Slack fails) if let Err(e) = post_slack_message(config.slack_api_token.clone(), slack_message) { - warn!("Slack message failed to post, {e:?}"); + warn!("Slack message failed to post: {e:#}"); } result @@ -80,7 +80,7 @@ async fn wait_for_epoch_rewards_completion(config: &Config) -> anyhow::Result<() tokio::time::sleep(POLL_INTERVAL).await; } Err(e) => { - warn!("Failed to check epoch rewards status: {e:?}, retrying..."); + warn!("Failed to check epoch rewards status, retrying: {e:#}"); tokio::time::sleep(POLL_INTERVAL).await; } } diff --git a/cranker/src/utils.rs b/cranker/src/utils.rs index 1e536ed..4fad6eb 100644 --- a/cranker/src/utils.rs +++ b/cranker/src/utils.rs @@ -161,7 +161,7 @@ pub async fn parallel_execute_transactions( } Some(_) | None => { // If the transaction failed for any other reason, log the error but don't try to resubmit - error!("Transaction failed preflight with err: {e:?}"); + error!("Transaction failed preflight: {e:#}"); } }, } @@ -196,7 +196,7 @@ pub async fn parallel_execute_transactions( } info!( - "{} transactions submitted, {} confirmed", + "transactions submitted={} confirmed={}", results.len(), results.len() - executed_signatures.len() ); @@ -263,10 +263,10 @@ pub async fn parallel_execute_stake_pool_update( ); info!( - "Update list instructions len: {}", + "update_list_instructions={}", update_list_instructions.len() ); - info!("Final instructions len: {}", final_instructions.len()); + info!("final_instructions={}", final_instructions.len()); // Priority fee constants const INITIAL_PRIORITY_FEE: u64 = 10_000; @@ -290,7 +290,7 @@ pub async fn parallel_execute_stake_pool_update( if let Err(e) = parallel_execute_transactions(update_list_transactions_prio_fee, config, 250).await { - error!("Failed to submit update list transactions with initial priority fee: {e:?}"); + error!("Failed to submit update list transactions with initial priority fee: {e:#}"); info!("Retrying with higher priority fee"); let update_list_transactions_prio_fee: Vec> = update_list_instructions @@ -322,7 +322,7 @@ pub async fn parallel_execute_stake_pool_update( .map_err(|e| anyhow!("{e}"))?; if let Err(e) = retry_send_transaction(config, &transaction, 250).await { - error!("Final transaction failed with initial priority fee: {e:?}"); + error!("Final transaction failed with initial priority fee: {e:#}"); info!("Retrying with high priority fee"); let mut final_instructions_prio_fee = vec![ @@ -372,7 +372,7 @@ pub async fn send_transaction( return Ok(()); } Ok(Some(Err(e))) => { - error!("Transaction failed: {signature} {e:?}"); + error!("Transaction failed signature={signature}: {e:#}"); return Err(e.into()); } Ok(None) => { @@ -401,10 +401,12 @@ pub async fn simulate_transaction( .await? .value; if result.err.is_some() { - error!("Err: {:?}", result.err); - error!("{:?}", result.logs); + error!( + "Simulation failed err={:?} logs={:?}", + result.err, result.logs + ); } else { - info!("Ok"); + info!("Simulation succeeded"); } Ok(()) } @@ -427,7 +429,7 @@ pub async fn retry_send_transaction( if result.is_ok() { return result; } else { - error!("Hit error {result:?}"); + error!("Transaction send failed: {result:#?}"); } } result diff --git a/steward-writer-service/src/main.rs b/steward-writer-service/src/main.rs index 1c8f3dc..846539b 100644 --- a/steward-writer-service/src/main.rs +++ b/steward-writer-service/src/main.rs @@ -12,7 +12,7 @@ use jito_steward::{ }; use kobe_core::db_models::steward_events::{StewardEvent, StewardEventsStore}; use kobe_core::rpc_utils::{retry_get_slot, retry_get_transactions}; -use log::{debug, error, info}; +use log::{debug, error, info, warn}; use mongodb::{Client, Collection}; use solana_client::{ nonblocking::rpc_client::RpcClient, rpc_client::GetConfirmedSignaturesForAddress2Config, @@ -99,7 +99,7 @@ async fn main() { match args.command { Commands::Listen => { - info!("Listening for new events"); + info!("Listening for new steward events"); let polling_duration = Duration::from_secs(300); // Configurable polling duration (5 mins) loop { if let Err(e) = listen( @@ -113,7 +113,7 @@ async fn main() { ) .await { - error!("Error in listen loop: {e:?}"); + error!("Listen loop failed: {e:#}"); } } } @@ -121,14 +121,14 @@ async fn main() { start_slot, end_slot, } => { - info!("Backfilling events from slot {start_slot} to {end_slot:?}"); + info!("Backfilling steward events start_slot={start_slot} end_slot={end_slot:?}"); let end_slot = if let Some(end_slot) = end_slot { end_slot } else { match client.get_epoch_info().await { Ok(epoch_info) => epoch_info.absolute_slot, Err(e) => { - info!("Error: {e:?}"); + error!("Failed to get current slot: {e:#}"); return; } } @@ -146,7 +146,7 @@ async fn main() { ) .await { - info!("Error: {e:?}"); + error!("Historical transaction fetch failed: {e:#}"); } } } @@ -182,7 +182,7 @@ async fn listen( "cluster" => cluster_name, ); - info!("Fetching new transactions since signature: {latest_signature}"); + info!("Fetching new transactions since_signature={latest_signature}"); let mut before = None; @@ -203,7 +203,7 @@ async fn listen( { Ok(signatures) => signatures, Err(e) => { - info!("Error fetching RPC signatures: {e}"); + warn!("Failed to fetch RPC signatures, retrying: {e:#}"); continue; } }; @@ -244,7 +244,7 @@ async fn fetch_and_process_transactions( let transactions = retry_get_transactions(rpc_client, &transaction_signatures).await?; - info!("Fetched {} transactions from rpc", transactions.len()); + info!("Fetched transactions count={}", transactions.len()); let mut transaction_data = vec![]; for tx in transactions.into_iter() { @@ -278,7 +278,7 @@ async fn process_transactions( for (status, tx) in transactions.iter() { if tx.slot != status.slot { error!( - "Slot mismatch for signature {}: {} != {}", + "Slot mismatch signature={} tx_slot={} status_slot={}", status.signature, tx.slot, status.slot ); } @@ -335,11 +335,9 @@ async fn process_transactions( { Ok(Some(event)) => events.push(event), Ok(None) => {} - Err(e) => error!( - "Error parsing log message for transaction {:?}: {:?}", - signature, - e.to_string() - ), + Err(e) => { + error!("Failed to parse log message signature={signature:?}: {e:#}") + } } } } @@ -348,11 +346,11 @@ async fn process_transactions( match dry_run { true => { - info!("upserting {events:#?}"); + info!("Dry run upserting events count={}", events.len()); } false => { if let Err(e) = store.bulk_upsert(events).await { - error!("Error inserting events: {e:?}"); + error!("Failed to insert events: {e:#}"); } } } @@ -371,7 +369,7 @@ async fn fetch_historical_program_transactions( end_slot: u64, dry_run: bool, ) -> Result<(), Box> { - info!("Backfilling transactions between slots {start_slot} and {end_slot}"); + info!("Backfilling transactions start_slot={start_slot} end_slot={end_slot}"); let mut before = None; let mut should_break = false; @@ -390,7 +388,7 @@ async fn fetch_historical_program_transactions( { Ok(signatures) => signatures, Err(e) => { - info!("Error fetching RPC signatures: {e}"); + warn!("Failed to fetch RPC signatures, retrying: {e:#}"); continue; } }; @@ -424,7 +422,7 @@ async fn fetch_historical_program_transactions( } info!( - "Processing {} transactions starting at slot {}", + "Processing transactions count={} start_slot={}", valid_signatures.len(), valid_signatures[0].slot ); diff --git a/writer-service/src/bam_boost_manager.rs b/writer-service/src/bam_boost_manager.rs index f10831e..626ee24 100644 --- a/writer-service/src/bam_boost_manager.rs +++ b/writer-service/src/bam_boost_manager.rs @@ -88,13 +88,13 @@ impl BamBoostManager { "https://storage.googleapis.com/jito-bam-boost/{network}/{epoch}/merkle_tree.json", ); - log::info!("Fetching merkle tree from: {url}"); + log::info!("Fetching bam boost merkle tree url={url}"); // Download the merkle tree JSON from GCS let response = match reqwest::get(&url).await { Ok(resp) => resp, Err(e) => { - log::error!("Failed to fetch merkle tree: {e}"); + log::error!("Failed to fetch bam boost merkle tree url={url}: {e:#}"); return Err(AppError::FileNotFound( "Failed to fetch merkle tree ({url}: {e}".to_string(), )); @@ -102,14 +102,17 @@ impl BamBoostManager { }; if !response.status().is_success() { - log::error!("Merkle tree not found: status {}", response.status()); + log::error!( + "Bam boost merkle tree not found url={url} status={}", + response.status() + ); return Err(AppError::InvalidOperation(format!( "Merkle tree not found for network {network} epoch {epoch}", ))); } let response_json: Vec = response.json().await.map_err(|e| { - log::error!("Failed to parse merkle tree JSON: {e}"); + log::error!("Failed to parse bam boost merkle tree JSON url={url}: {e:#}"); AppError::InvalidOperation(format!( "Failed to parse merkle tree JSON for network {network} epoch {epoch}: {e}", )) @@ -175,7 +178,7 @@ impl BamBoostManager { } } Err(e) => { - log::info!("Skip fetching bam boost merkle tree {epoch}: {e}"); + log::warn!("Skipping bam boost merkle tree fetch epoch={epoch}: {e:#}"); } } } diff --git a/writer-service/src/lib.rs b/writer-service/src/lib.rs index ce69134..ea4392b 100644 --- a/writer-service/src/lib.rs +++ b/writer-service/src/lib.rs @@ -182,7 +182,7 @@ impl KobeWriterService { datapoint_info!("bam_snapshot_written", ("success", 1, i64), "cluster" => self.cluster.to_string()); } Err(e) => { - error!("Writing BAM snapshot failed. Error: {e:?}"); + error!("Writing BAM snapshot failed: {e:#}"); datapoint_info!("bam_snapshot_written", ("success", 0, i64), "cluster" => self.cluster.to_string()); } } @@ -205,7 +205,7 @@ impl KobeWriterService { datapoint_info!("stake_pool_stats_written", ("success", 1, i64), "cluster" => self.cluster.to_string()); } Err(e) => { - error!("Writing stake pool stats failed. Error: {e:?}"); + error!("Writing stake pool stats failed: {e:#}"); datapoint_info!("stake_pool_stats_written", ("success", 0, i64), "cluster" => self.cluster.to_string()); } } @@ -216,7 +216,7 @@ impl KobeWriterService { datapoint_info!("bam_boost_stats_written", ("success", 1, i64), "cluster" => self.cluster.to_string()); } Err(e) => { - error!("Writing BAM Boost stats failed. Error: {e:?}"); + error!("Writing BAM Boost stats failed: {e:#}"); datapoint_info!("bam_boost_stats_written", ("success", 0, i64), "cluster" => self.cluster.to_string()); } } @@ -242,7 +242,7 @@ impl KobeWriterService { ) .await .map_err(|e| { - error!("Writing MEV claims failed. Error: {e:?}"); + error!("Writing MEV claims failed: {e:#}"); e })?; Ok(()) @@ -268,7 +268,7 @@ impl KobeWriterService { } Err(e) => { datapoint_info!("validator_stats_written", ("success", 0, i64), "cluster" => self.cluster.to_string()); - error!("Writing validator info failed: {e:?}"); + error!("Writing validator info failed: {e:#}"); } } @@ -287,7 +287,7 @@ impl KobeWriterService { } Err(e) => { datapoint_info!("mev_claims_written", ("success", 0, i64), "cluster" => self.cluster.to_string()); - error!("Writing MEV claims failed: {e:?}"); + error!("Writing MEV claims failed: {e:#}"); } } diff --git a/writer-service/src/main.rs b/writer-service/src/main.rs index ae554c2..36618fb 100644 --- a/writer-service/src/main.rs +++ b/writer-service/src/main.rs @@ -135,7 +135,7 @@ fn main() -> Result<()> { match mode { Commands::Live => { if let Err(e) = kobe_service.run_live_mode().await { - error!("Live mode failed. Error: {e:?}"); + error!("Live mode failed: {e:#}"); } } Commands::Backfill(backfill_args) => { @@ -144,7 +144,7 @@ fn main() -> Result<()> { } = backfill_args; if let Err(e) = kobe_service.run_backfill_mode(backfill_epoch).await { - error!("Backfill failed. Error: {e:?}"); + error!("Backfill failed: {e:#}"); } } } diff --git a/writer-service/src/stake_pool_manager.rs b/writer-service/src/stake_pool_manager.rs index 5a58282..5bb938d 100644 --- a/writer-service/src/stake_pool_manager.rs +++ b/writer-service/src/stake_pool_manager.rs @@ -171,7 +171,7 @@ impl StakePoolManager { total_network_staked_lamports: Some(fetch_total_staked_lamports(&vote_accounts)), }; - info!("Done writing stats: {stats:#?}"); + info!("Stake pool stats written epoch={}", stats.epoch); Ok(stats) }