diff --git a/Cargo.lock b/Cargo.lock index e5d3dc7ee2..b6a39f2f8f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3058,7 +3058,7 @@ dependencies = [ [[package]] name = "fortuna" -version = "8.2.0" +version = "8.2.1" dependencies = [ "anyhow", "axum 0.6.20", diff --git a/apps/fortuna/Cargo.toml b/apps/fortuna/Cargo.toml index 0c0b66fb65..0e61c0e7e1 100644 --- a/apps/fortuna/Cargo.toml +++ b/apps/fortuna/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "fortuna" -version = "8.2.0" +version = "8.2.1" edition = "2021" [lib] diff --git a/apps/fortuna/src/history.rs b/apps/fortuna/src/history.rs index cff9b5d40f..c3c381be92 100644 --- a/apps/fortuna/src/history.rs +++ b/apps/fortuna/src/history.rs @@ -357,7 +357,18 @@ impl History { } }; if let Err(e) = result { - tracing::error!("Failed to update request status: {}", e); + match e.as_database_error() { + Some(db_error) if db_error.is_unique_violation() => { + tracing::info!( + "Failed to insert request, request already exists: Chain ID: {}, Sequence: {}", + network_id, + sequence + ); + } + _ => { + tracing::error!("Failed to update request status: {}", e); + } + } } } diff --git a/apps/fortuna/src/keeper/fee.rs b/apps/fortuna/src/keeper/fee.rs index c28bc37fcf..380bb2239f 100644 --- a/apps/fortuna/src/keeper/fee.rs +++ b/apps/fortuna/src/keeper/fee.rs @@ -44,6 +44,13 @@ async fn calculate_fair_fee_withdrawal_amount( .await .map_err(|e| anyhow!("Error while getting current keeper balance. error: {:?}", e))?; + tracing::info!( + "Contract has available fees: {:?}, current keeper ({:?}) has balance: {:?}", + available_fees, + keeper_address, + current_balance + ); + // Calculate total funds across all keepers + available fees let mut total_funds = current_balance + available_fees; @@ -55,6 +62,7 @@ async fn calculate_fair_fee_withdrawal_amount( e ) })?; + tracing::info!("Keeper address {:?} has balance: {:?}", address, balance); total_funds += balance; } @@ -174,7 +182,7 @@ pub async fn withdraw_fees_if_necessary( if withdrawal_amount < min_withdrawal_amount { // We don't have enough to meaningfully top up the balance. // NOTE: This log message triggers a grafana alert. If you want to change the text, please change the alert also. - tracing::warn!("Keeper balance {:?} is too low (< {:?}) but provider fees are not sufficient to top-up.", keeper_balance, min_balance); + tracing::warn!("Keeper balance {:?} is too low (< {:?}) but provider fees are not sufficient to top-up. (withdrawal_amount={:?} < min_withdrawal_amount={:?})", keeper_balance, min_balance, withdrawal_amount, min_withdrawal_amount); return Ok(()); }