-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Add logic to calculate gas deviation based on fitted curve #15977
base: develop
Are you sure you want to change the base?
Add logic to calculate gas deviation based on fitted curve #15977
Conversation
5353774
to
492db0a
Compare
AER Report: CI Core ran successfully ✅AER Report: Operator UI CI ran successfully ✅ |
if ppb != EthereumThresholdGatePPB { | ||
return Deviates(xOld, xNew, ppb) | ||
} |
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.
Even though this is technically product-specific logic, I decided to keep this check here in calc.go since it's acting as a gate for this deviation curve feature. Having the gate in a single location seemed safer than to have it implemented in several locations higher up in the multiple gas estimators we have.
d9d81b0
to
b3b3a86
Compare
8ee0986
to
7590c20
Compare
@@ -134,7 +141,7 @@ func (g DAGasPriceEstimator) Deviates(ctx context.Context, p1, p2 *big.Int) (boo | |||
return execDeviates, nil | |||
} | |||
|
|||
return ccipcalc.Deviates(p1DAGasPrice, p2DAGasPrice, g.daDeviationPPB), nil | |||
return ccipcalc.DeviatesOnCurve(p1DAGasPrice, p2DAGasPrice, big.NewInt(DANoDeviationThresholdUSD), g.daDeviationPPB), nil |
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.
we discussed scaling DA deviation by 2x on the curve, is that something still worthwhile to have? If so maybe add a multiplier
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.
Given how aggressive this new curve is and with the existing complexity of DA vs exec "no deviation thresholds", I have a slight preference to keeping things as-is and more simple for this first iteration. After launch, using portions of Abhishek's sim script we should be able to relatively easily query percentage of deviations triggered by exec vs DA. If DA heavily outweighs exec then 2x-ing the DA side of things could be a fast-follow.
7590c20
to
f07e559
Compare
f07e559
to
7df13ab
Compare
7df13ab
to
f340a87
Compare
Quality Gate passedIssues Measures |
Description
DeviatesOnCurve()
to CCIP calc to have a more flexible gas deviation threshold based on a sliding log scaleMotivation