-
Notifications
You must be signed in to change notification settings - Fork 262
feat(fortuna): configurable escalation policy for transactions. #2244
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
Conversation
Co-Authored-By: Jayant Krishnamurthy <jayant@dourolabs.xyz>
…event Co-Authored-By: Jayant Krishnamurthy <jayant@dourolabs.xyz>
Co-Authored-By: Jayant Krishnamurthy <jayant@dourolabs.xyz>
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
⚙️ Control Options:
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
2 Skipped Deployments
|
apps/fortuna/src/keeper.rs
Outdated
let gas_estimate = gas_estimate.min((gas_limit * DEFAULT_GAS_ESTIMATE_MULTIPLIER_PCT) / 100); | ||
// Apply the configurable cap from backoff_gas_multiplier_cap_pct | ||
let max_gas_estimate = gas_limit.saturating_mul(chain_config.backoff_gas_multiplier_cap_pct.into()) / 100; | ||
let gas_estimate = gas_estimate.min(max_gas_estimate); |
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.
the correct change is to delete this check and not replace it with another one -- this is a duplicate check now
Co-Authored-By: Jayant Krishnamurthy <jayant@dourolabs.xyz>
# Multiply successive callback transaction's fees by 10% until the cap is reached. | ||
# All numbers are expressed as percentages where 100 = no change. | ||
# (See also priority_fee_multiplier_pct above to generically adjust the priority fee estimates for the chain -- | ||
# adjusting that parameter will influence the fee of the first transaction, in addition to other things) |
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.
note there isn't an initial value here. Instead you adjust the priority_fee_multiplier_pct above. The reason for that is because the other parameter affects all gas estimates for the chain, including the one that is used to determine the keeper's fee
// While we could scale up this value based on the padding, that ends up overcharging users as most transactions cost nowhere | ||
// near the maximum gas limit. | ||
// 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. |
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.
reverted the change in the previous PR as it was making the fees aggressively high
@@ -540,7 +546,6 @@ pub async fn process_event( | |||
// Pad the gas estimate after checking it against the simulation gas limit, ensuring that | |||
// the padded gas estimate doesn't exceed the maximum amount of gas we are willing to use. | |||
let gas_estimate = gas_estimate.saturating_mul(gas_estimate_multiplier_pct.into()) / 100; | |||
let gas_estimate = gas_estimate.min((gas_limit * DEFAULT_GAS_ESTIMATE_MULTIPLIER_PCT) / 100); |
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.
removing the cap on the gas estimate here as it now lives in the escalation policy.
(Jayant: i stole this from devin and did a bunch of work on top, so ignore devin)
This PR adds a configurable escalation policy to fortuna that ramps up both the gas and priority fees on each successive retry. I moved the various escalation control parameters into a struct for tidyness.
I also made a couple of minor changes to other logic that are called out in comments. (some of this is subtle)
Link to Devin run: https://app.devin.ai/sessions/c37cdcd255e449cc97a5423c7b0beaf9