Skip to content
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 Test_GetChainFeePriceUpdates #15240

Merged
merged 10 commits into from
Nov 15, 2024
Merged

Conversation

asoliman92
Copy link
Contributor

No description provided.

@asoliman92 asoliman92 requested review from a team as code owners November 14, 2024 10:51
@asoliman92 asoliman92 requested review from winder, rstout, makramkd, dimkouv, mateusz-sekara, 0xAustinWang and 0xnogo and removed request for a team November 14, 2024 10:51
Copy link
Contributor

github-actions bot commented Nov 14, 2024

AER Report: CI Core ran successfully ✅

aer_workflow , commit

AER Report: Operator UI CI ran successfully ✅

aer_workflow , commit

Copy link
Contributor

Flaky Test Detector for ./go.mod project has failed ❌

Ran new or updated tests between ccipreader-tests and 1b586f7 (get-chain-fee-updates).

View Flaky Detector Details | Compare Changes

Failed Tests

Ran 7 tests in total for all affected test packages. Below are the tests identified as flaky, with a pass ratio lower than the 100% threshold:

TestPackage                                                                                        TestName                      PassRatio  RunCount   Skipped
---------                                                                                          ---------                     ---------  ---------  ---------
github.com/smartcontractkit/chainlink/v2/core/capabilities/ccip/ccip_integration_tests/ccipreader  Test_GetChainFeePriceUpdates  0%         1          false

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: not needed.

Comment on lines 6 to 8
evmconfig "github.com/smartcontractkit/chainlink/v2/core/capabilities/ccip/configs/evm"

"github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/fee_quoter"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

goimports

@@ -47,6 +51,10 @@ const (
chainD = cciptypes.ChainSelector(4)
)

var (
defaultGasPrice = big.NewInt(1e9)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use assets.GWei instead

[]fee_quoter.FeeQuoterTokenTransferFeeConfigArgs{},
[]fee_quoter.FeeQuoterPremiumMultiplierWeiPerEthArgs{
{
PremiumMultiplierWeiPerEth: 9e17, // 0.9 ETH
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this means 90% and not 0.9ETH cc @0xnogo

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i.e a 10% discount

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@makramkd I think you are referring to the gasMultiplierWeiPerEth. But here it's the PremiumMultiplierWeiPerEth

Copy link
Collaborator

@0xnogo 0xnogo Nov 15, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this one is set to pay 10% if you are paying with Link token. I think it needs to have 1e18 unit, so what we have here is correct:

    // Calculate number of fee tokens to charge.
    // Total USD fee is in 36 decimals, feeTokenPrice is in 18 decimals USD for 1e18 smallest token denominations.
    // Result of the division is the number of smallest token denominations.
    return ((premiumFee * s_premiumMultiplierWeiPerEth[message.feeToken]) + executionCost + dataAvailabilityCost)
      / feeTokenPrice;

executionCost + dataAvailabilityCost => e36
premium (e18) * s_premiumMultiplierWeiPerEth[message.feeToken] (e18) => e36

@@ -2,6 +2,7 @@ package ccipreader

import (
"context"

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Get rid of newline

@asoliman92 asoliman92 merged commit 6317dba into ccipreader-tests Nov 15, 2024
146 of 148 checks passed
@asoliman92 asoliman92 deleted the get-chain-fee-updates branch November 15, 2024 13:54
github-merge-queue bot pushed a commit that referenced this pull request Nov 20, 2024
* Add Test_GetChainFeePriceUpdates (#15240)

Add Test_GetChainFeePriceUpdates

* Bind real contracts per chain in CCIPReader test (#15282)

Add functionality to bind more contracts to different chains (using same simulated backend for simplicity) in ccipreader tester.

LinkPriceUSD test
GetMedianDataAvailabilityGasConfig

* Test_GetWrappedNativeTokenPriceUSD (#15316)

Test_GetWrappedNativeTokenPriceUSD

* comments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants