Skip to content

Commit 05b7928

Browse files
authored
fix(fortuna): fix too high fees (#2532)
1 parent 5cf22d9 commit 05b7928

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

apps/fortuna/Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apps/fortuna/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "fortuna"
3-
version = "7.4.9"
3+
version = "7.4.10"
44
edition = "2021"
55

66
[lib]

apps/fortuna/src/keeper/fee.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ pub async fn adjust_fee_wrapper(
107107
.in_current_span()
108108
.await
109109
{
110-
tracing::error!("Withdrawing fees. error: {:?}", e);
110+
tracing::error!("Fee adjustment failed: {:?}", e);
111111
}
112112
time::sleep(poll_interval).await;
113113
}
@@ -212,6 +212,9 @@ pub async fn adjust_fee_if_necessary(
212212
if is_chain_active
213213
&& ((provider_fee > target_fee_max && can_reduce_fees) || provider_fee < target_fee_min)
214214
{
215+
if min_fee_wei * 100 < target_fee {
216+
return Err(anyhow!("Cowardly refusing to set target fee more than 100x min_fee_wei. Target: {:?} Min: {:?}", target_fee, min_fee_wei));
217+
}
215218
tracing::info!(
216219
"Adjusting fees. Current: {:?} Target: {:?}",
217220
provider_fee,

0 commit comments

Comments
 (0)