-
Notifications
You must be signed in to change notification settings - Fork 49
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
[CCIP-3376] Add component into CCIP price estimators to account for c… #1446
[CCIP-3376] Add component into CCIP price estimators to account for c… #1446
Conversation
…hain specific logic for Mantle
core/services/ocr2/plugins/ccip/estimatorconfig/interceptors/mantle/interceptor.go
Outdated
Show resolved
Hide resolved
core/services/ocr2/plugins/ccip/estimatorconfig/interceptors/mantle/interceptor.go
Outdated
Show resolved
Hide resolved
core/services/ocr2/plugins/ccip/estimatorconfig/interceptors/mantle/interceptor.go
Outdated
Show resolved
Hide resolved
core/services/ocr2/plugins/ccip/estimatorconfig/interceptors/mantle/interceptor.go
Outdated
Show resolved
Hide resolved
core/services/ocr2/plugins/ccip/estimatorconfig/interceptors/mantle/interceptor.go
Outdated
Show resolved
Hide resolved
// ModifyGasPriceComponents returns modified gasPrice. | ||
func (i *Interceptor) ModifyGasPriceComponents(ctx context.Context, execGasPrice, daGasPrice *big.Int) (*big.Int, *big.Int, error) { | ||
if time.Since(i.tokenRatioLastUpdate) > tokenRatioUpdateInterval { | ||
mantleTokenRatio, err := i.getMantleTokenRatio(ctx) |
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.
I guess we can't just call contracts directly from the plugin logic, can we @dimkouv . I think it should belong to some reader to stay compliant with loops
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.
Since this logic is hidden behind the custom provider interface it should still be compliant with loops.
core/services/ocr2/plugins/ccip/estimatorconfig/interceptors/mantle/interceptor.go
Show resolved
Hide resolved
core/services/ocr2/plugins/ccip/estimatorconfig/interceptors/mantle/interceptor.go
Show resolved
Hide resolved
core/services/ocr2/plugins/ccip/estimatorconfig/interceptors/mantle/interceptor.go
Show resolved
Hide resolved
Quality Gate failedFailed conditions |
#1446) [https://smartcontract-it.atlassian.net/browse/CCIP-3376](https://smartcontract-it.atlassian.net/browse/CCIP-3376) The CCIP gas limit is set by customers. This cannot be changed because this limit is directly used within the contracts (which expect limits in terms of ETH). Also, the L2 gas price returned from our current estimators for Mantle is in MNT. Therefore, the final formula needed for CCIP to calculate L2 transaction fees is the following: gasLimit_EVM * (gasPrice_Mantle * TokenRatio) Therefore, we need to multiply the gas price returned from our gas estimators by tokenRatio for CCIP. This should happen in the CCIP price estimator. Currently, we have no component here for chain-specific logic, so we will need to add this functionality. --------- Co-authored-by: Matt Yang <[email protected]>
https://smartcontract-it.atlassian.net/browse/CCIP-3376
The CCIP gas limit is set by customers. This cannot be changed because this limit is directly used within the contracts (which expect limits in terms of ETH). Also, the L2 gas price returned from our current estimators for Mantle is in MNT. Therefore, the final formula needed for CCIP to calculate L2 transaction fees is the following:
gasLimit_EVM * (gasPrice_Mantle * TokenRatio)
Therefore, we need to multiply the gas price returned from our gas estimators by tokenRatio for CCIP. This should happen in the CCIP price estimator. Currently, we have no component here for chain-specific logic, so we will need to add this functionality.