Skip to content

Commit f5923cd

Browse files
authored
chore(fortuna): Add log message for updating the commitment (#2644)
* add log message * fix typo
1 parent 735acc7 commit f5923cd

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

apps/fortuna/src/keeper/commitment.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,11 @@ pub async fn update_commitments_if_necessary(
4848
}
4949
let threshold =
5050
((provider_info.max_num_hashes as f64) * UPDATE_COMMITMENTS_THRESHOLD_FACTOR) as u64;
51-
if provider_info.sequence_number - provider_info.current_commitment_sequence_number > threshold
52-
{
51+
let outstanding_requests =
52+
provider_info.sequence_number - provider_info.current_commitment_sequence_number;
53+
if outstanding_requests > threshold {
54+
// NOTE: This log message triggers a grafana alert. If you want to change the text, please change the alert also.
55+
tracing::warn!("Update commitments threshold reached -- possible outage or DDOS attack. Number of outstanding requests: {:?} Threshold: {:?}", outstanding_requests, threshold);
5356
let seq_number = provider_info.sequence_number - 1;
5457
let provider_revelation = chain_state
5558
.state

apps/fortuna/src/keeper/fee.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ pub async fn withdraw_fees_if_necessary(
6464
let contract_call = contract.withdraw_as_fee_manager(provider_address, fees);
6565
send_and_confirm(contract_call).await?;
6666
} else if keeper_balance < min_balance {
67+
// NOTE: This log message triggers a grafana alert. If you want to change the text, please change the alert also.
6768
tracing::warn!("Keeper balance {:?} is too low (< {:?}) but provider fees are not sufficient to top-up.", keeper_balance, min_balance)
6869
}
6970

0 commit comments

Comments
 (0)