-
Notifications
You must be signed in to change notification settings - Fork 225
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(fortuna): Add a couple more config values #2251
Merged
Merged
Changes from 5 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[package] | ||
name = "fortuna" | ||
version = "7.1.0" | ||
version = "7.2.0" | ||
edition = "2021" | ||
|
||
[dependencies] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -338,9 +338,10 @@ pub async fn run_keeper_threads( | |
// In the unlikely event that the keeper fees aren't sufficient, the solution to this is to configure the target | ||
// fee percentage to be higher on that specific chain. | ||
chain_eth_config.gas_limit, | ||
chain_eth_config.min_profit_pct, | ||
chain_eth_config.target_profit_pct, | ||
chain_eth_config.max_profit_pct, | ||
// NOTE: unwrap() here so we panic early if someone configures these values below -100. | ||
u64::try_from(100 + chain_eth_config.min_profit_pct).unwrap(), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. maybe just switch to expect to give more context |
||
u64::try_from(100 + chain_eth_config.target_profit_pct).unwrap(), | ||
u64::try_from(100 + chain_eth_config.max_profit_pct).unwrap(), | ||
chain_eth_config.fee, | ||
) | ||
.in_current_span(), | ||
|
@@ -435,7 +436,7 @@ pub async fn process_event_with_backoff( | |
&event, | ||
&chain_state, | ||
&contract, | ||
gas_limit, | ||
gas_limit.saturating_mul(escalation_policy.gas_limit_tolerance_pct.into()) / 100, | ||
gas_multiplier_pct, | ||
fee_multiplier_pct, | ||
metrics.clone(), | ||
|
@@ -1253,15 +1254,15 @@ pub async fn adjust_fee_if_necessary( | |
.await | ||
.map_err(|e| anyhow!("Could not estimate transaction cost. error {:?}", e))?; | ||
let target_fee_min = std::cmp::max( | ||
(max_callback_cost * (100 + u128::from(min_profit_pct))) / 100, | ||
(max_callback_cost * u128::from(min_profit_pct)) / 100, | ||
min_fee_wei, | ||
); | ||
let target_fee = std::cmp::max( | ||
(max_callback_cost * (100 + u128::from(target_profit_pct))) / 100, | ||
(max_callback_cost * u128::from(target_profit_pct)) / 100, | ||
min_fee_wei, | ||
); | ||
let target_fee_max = std::cmp::max( | ||
(max_callback_cost * (100 + u128::from(max_profit_pct))) / 100, | ||
(max_callback_cost * u128::from(max_profit_pct)) / 100, | ||
min_fee_wei, | ||
); | ||
|
||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(In hindsight, I wish that i had specified these values as multipliers, so 0 would be the natural lower bound and you could just say "75" instead of "-25". That's how I did the other scalars and it would have been better here.
However, I'm choosing to support up to -100 now in order to maintain backward compatibility on the config format)