-
Notifications
You must be signed in to change notification settings - Fork 54
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
Do not return the error in case if onRamp not initialized #1487
Conversation
f514173
to
d6b78b8
Compare
Quality Gate passedIssues Measures |
@@ -42,7 +41,7 @@ func (c *FeeEstimatorConfigService) SetOnRampReader(reader ccip.OnRampReader) { | |||
// GetDynamicConfig should be cached in the onRamp reader to avoid unnecessary on-chain calls | |||
func (c *FeeEstimatorConfigService) GetDataAvailabilityConfig(ctx context.Context) (destDataAvailabilityOverheadGas, destGasPerDataAvailabilityByte, destDataAvailabilityMultiplierBps int64, err error) { | |||
if c.onRampReader == nil { | |||
return 0, 0, 0, errors.New("no OnRampReader has been configured") |
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.
Can you share some reasoning behind this decision? IIUC this will return 0s to daOverheadGas, gasPerDAByte, daMultiplier
. Does the calling function know how to handle that case? What would happen to estimateDACostUSD
when 0s are returned?
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.
@mateusz-sekara Calling this function will multiply gasPrice with 0 and return 0 DAGasPrice
https://github.com/smartcontractkit/ccip/blob/ccip-develop/core/services/ocr2/plugins/ccip/prices/da_price_estimator.go#L182
Then just added 0 gas price to the estimatedExecCost
https://github.com/smartcontractkit/ccip/blob/ccip-develop/core/services/ocr2/plugins/ccip/prices/da_price_estimator.go#L154
This is worked in the same way before this feature been implemented
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.
Okay, I would consider some warning log in this if
if that's something that should not happen
## Motivation For the exec provider, in some cases, the onRamp reader is not initialized. For immediate reaction, we need to allow execution without blocking in cases if onRamp is not initialized. It fails due the issue when onRampReader is not initialized for execProvider. This fix should fix this issue. In case the onRamp reader is not initialized, the module will return 0 values and DAGasEstimator will behave as it worked before this feature been implemented.
Motivation
For the exec provider, in some cases, the onRamp reader is not initialized. For immediate reaction, we need to allow execution without blocking in cases if onRamp is not initialized. It fails due the issue when onRampReader is not initialized for execProvider. This fix should fix this issue. In case the onRamp reader is not initialized, the module will return 0 values and DAGasEstimator will behave as it worked before this feature been implemented.