From 182b3916e84c0860f3692ed4ac39b2ad8c9d246b Mon Sep 17 00:00:00 2001 From: Makram Date: Mon, 24 Feb 2025 22:22:36 +0200 Subject: [PATCH] integration-tests/smoke/ccip: rm feeboosting test & cfgs (#16538) * integration-tests/smoke/ccip: rm feeboosting test * deployment/ccip: remove references to boosting * bump cl-ccip to main --- core/scripts/go.mod | 2 +- core/scripts/go.sum | 4 +- deployment/ccip/changeset/globals/config.go | 1 - .../ccip/changeset/v1_6/cs_ccip_home.go | 1 - deployment/go.mod | 2 +- deployment/go.sum | 4 +- go.mod | 2 +- go.sum | 4 +- integration-tests/go.mod | 2 +- integration-tests/go.sum | 4 +- integration-tests/load/go.mod | 2 +- integration-tests/load/go.sum | 4 +- .../smoke/ccip/ccip_add_chain_test.go | 4 - .../smoke/ccip/ccip_fee_boosting_test.go | 287 ------------------ system-tests/lib/go.mod | 2 +- system-tests/lib/go.sum | 4 +- system-tests/tests/go.mod | 2 +- system-tests/tests/go.sum | 4 +- 18 files changed, 21 insertions(+), 314 deletions(-) delete mode 100644 integration-tests/smoke/ccip/ccip_fee_boosting_test.go diff --git a/core/scripts/go.mod b/core/scripts/go.mod index 7fb73eed291..1db0b021428 100644 --- a/core/scripts/go.mod +++ b/core/scripts/go.mod @@ -340,7 +340,7 @@ require ( github.com/sirupsen/logrus v1.9.3 // indirect github.com/smartcontractkit/ccip-owner-contracts v0.1.0 // indirect github.com/smartcontractkit/chain-selectors v1.0.40 // indirect - github.com/smartcontractkit/chainlink-ccip v0.0.0-20250224132459-c57ae4a97dcb // indirect + github.com/smartcontractkit/chainlink-ccip v0.0.0-20250224184104-b25011bb3512 // indirect github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250214202341-4190f2db1c01 // indirect github.com/smartcontractkit/chainlink-feeds v0.1.1 // indirect github.com/smartcontractkit/chainlink-framework/chains v0.0.0-20250207205350-420ccacab78a // indirect diff --git a/core/scripts/go.sum b/core/scripts/go.sum index fbe0b40ff8c..b4e4f8abb1a 100644 --- a/core/scripts/go.sum +++ b/core/scripts/go.sum @@ -1086,8 +1086,8 @@ github.com/smartcontractkit/chain-selectors v1.0.40 h1:iLvvoZeehVq6/7F+zzolQLF0D github.com/smartcontractkit/chain-selectors v1.0.40/go.mod h1:xsKM0aN3YGcQKTPRPDDtPx2l4mlTN1Djmg0VVXV40b8= github.com/smartcontractkit/chainlink-automation v0.8.1 h1:sTc9LKpBvcKPc1JDYAmgBc2xpDKBco/Q4h4ydl6+UUU= github.com/smartcontractkit/chainlink-automation v0.8.1/go.mod h1:Iij36PvWZ6blrdC5A/nrQUBuf3MH3JvsBB9sSyc9W08= -github.com/smartcontractkit/chainlink-ccip v0.0.0-20250224132459-c57ae4a97dcb h1:Z5QRY8DtXnxnPwbo+mR1mxwaL+OClza3ATUqcQ1Ynz8= -github.com/smartcontractkit/chainlink-ccip v0.0.0-20250224132459-c57ae4a97dcb/go.mod h1:Hht/OJq/PxC+gnBCIPyzHt4Otsw6mYwUVsmtOqIvlxo= +github.com/smartcontractkit/chainlink-ccip v0.0.0-20250224184104-b25011bb3512 h1:XUz6jj+pPIvRbmlalXyFf6O0hGicU8thQtjFvw7dPLo= +github.com/smartcontractkit/chainlink-ccip v0.0.0-20250224184104-b25011bb3512/go.mod h1:Hht/OJq/PxC+gnBCIPyzHt4Otsw6mYwUVsmtOqIvlxo= github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250214202341-4190f2db1c01 h1:R3OD6Phi0ULIQ2uvHiKVWYdgpi/O1Mt46CUK1UApcXU= github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250214202341-4190f2db1c01/go.mod h1:Bmwq4lNb5tE47sydN0TKetcLEGbgl+VxHEWp4S0LI60= github.com/smartcontractkit/chainlink-common v0.4.2-0.20250221174903-e1e47fdb11b0 h1:BTN2nQgFKBxgas6oqY3ym82O+wT++WlpP1+a6KzIfY0= diff --git a/deployment/ccip/changeset/globals/config.go b/deployment/ccip/changeset/globals/config.go index c93fdc2a97b..a0ca800f1d7 100644 --- a/deployment/ccip/changeset/globals/config.go +++ b/deployment/ccip/changeset/globals/config.go @@ -14,7 +14,6 @@ const ( RemoteGasPriceBatchWriteFrequency = 30 * time.Minute TokenPriceBatchWriteFrequency = 30 * time.Minute BatchGasLimit = 6_500_000 - RelativeBoostPerWaitHour = 0.5 InflightCacheExpiry = 10 * time.Minute RootSnoozeTime = 30 * time.Minute BatchingStrategyID = 0 diff --git a/deployment/ccip/changeset/v1_6/cs_ccip_home.go b/deployment/ccip/changeset/v1_6/cs_ccip_home.go index c93865e9b0d..01ce9f4224b 100644 --- a/deployment/ccip/changeset/v1_6/cs_ccip_home.go +++ b/deployment/ccip/changeset/v1_6/cs_ccip_home.go @@ -242,7 +242,6 @@ func WithDefaultExecuteOffChainConfig(tokenDataObservers []pluginconfig.TokenDat if params.ExecuteOffChainConfig == nil { params.ExecuteOffChainConfig = &pluginconfig.ExecuteOffchainConfig{ BatchGasLimit: globals.BatchGasLimit, - RelativeBoostPerWaitHour: globals.RelativeBoostPerWaitHour, InflightCacheExpiry: *config.MustNewDuration(globals.InflightCacheExpiry), RootSnoozeTime: *config.MustNewDuration(globals.RootSnoozeTime), MessageVisibilityInterval: *config.MustNewDuration(globals.PermissionLessExecutionThreshold), diff --git a/deployment/go.mod b/deployment/go.mod index f1a0f6fb3f3..2fa4e14ef63 100644 --- a/deployment/go.mod +++ b/deployment/go.mod @@ -30,7 +30,7 @@ require ( github.com/sethvargo/go-retry v0.2.4 github.com/smartcontractkit/ccip-owner-contracts v0.1.0 github.com/smartcontractkit/chain-selectors v1.0.40 - github.com/smartcontractkit/chainlink-ccip v0.0.0-20250224132459-c57ae4a97dcb + github.com/smartcontractkit/chainlink-ccip v0.0.0-20250224184104-b25011bb3512 github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250214202341-4190f2db1c01 github.com/smartcontractkit/chainlink-common v0.4.2-0.20250221174903-e1e47fdb11b0 github.com/smartcontractkit/chainlink-framework/multinode v0.0.0-20250211162441-3d6cea220efb diff --git a/deployment/go.sum b/deployment/go.sum index df1bf1dc209..f5125d641fc 100644 --- a/deployment/go.sum +++ b/deployment/go.sum @@ -1134,8 +1134,8 @@ github.com/smartcontractkit/chain-selectors v1.0.40 h1:iLvvoZeehVq6/7F+zzolQLF0D github.com/smartcontractkit/chain-selectors v1.0.40/go.mod h1:xsKM0aN3YGcQKTPRPDDtPx2l4mlTN1Djmg0VVXV40b8= github.com/smartcontractkit/chainlink-automation v0.8.1 h1:sTc9LKpBvcKPc1JDYAmgBc2xpDKBco/Q4h4ydl6+UUU= github.com/smartcontractkit/chainlink-automation v0.8.1/go.mod h1:Iij36PvWZ6blrdC5A/nrQUBuf3MH3JvsBB9sSyc9W08= -github.com/smartcontractkit/chainlink-ccip v0.0.0-20250224132459-c57ae4a97dcb h1:Z5QRY8DtXnxnPwbo+mR1mxwaL+OClza3ATUqcQ1Ynz8= -github.com/smartcontractkit/chainlink-ccip v0.0.0-20250224132459-c57ae4a97dcb/go.mod h1:Hht/OJq/PxC+gnBCIPyzHt4Otsw6mYwUVsmtOqIvlxo= +github.com/smartcontractkit/chainlink-ccip v0.0.0-20250224184104-b25011bb3512 h1:XUz6jj+pPIvRbmlalXyFf6O0hGicU8thQtjFvw7dPLo= +github.com/smartcontractkit/chainlink-ccip v0.0.0-20250224184104-b25011bb3512/go.mod h1:Hht/OJq/PxC+gnBCIPyzHt4Otsw6mYwUVsmtOqIvlxo= github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250214202341-4190f2db1c01 h1:R3OD6Phi0ULIQ2uvHiKVWYdgpi/O1Mt46CUK1UApcXU= github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250214202341-4190f2db1c01/go.mod h1:Bmwq4lNb5tE47sydN0TKetcLEGbgl+VxHEWp4S0LI60= github.com/smartcontractkit/chainlink-common v0.4.2-0.20250221174903-e1e47fdb11b0 h1:BTN2nQgFKBxgas6oqY3ym82O+wT++WlpP1+a6KzIfY0= diff --git a/go.mod b/go.mod index bdd5ee85fff..b257bdecab1 100644 --- a/go.mod +++ b/go.mod @@ -76,7 +76,7 @@ require ( github.com/shopspring/decimal v1.4.0 github.com/smartcontractkit/chain-selectors v1.0.40 github.com/smartcontractkit/chainlink-automation v0.8.1 - github.com/smartcontractkit/chainlink-ccip v0.0.0-20250224132459-c57ae4a97dcb + github.com/smartcontractkit/chainlink-ccip v0.0.0-20250224184104-b25011bb3512 github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250214202341-4190f2db1c01 github.com/smartcontractkit/chainlink-common v0.4.2-0.20250214231858-f365e2bdecea github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20250128203428-08031923fbe5 diff --git a/go.sum b/go.sum index bde89e1c8a3..b9fe39601a3 100644 --- a/go.sum +++ b/go.sum @@ -1018,8 +1018,8 @@ github.com/smartcontractkit/chain-selectors v1.0.40 h1:iLvvoZeehVq6/7F+zzolQLF0D github.com/smartcontractkit/chain-selectors v1.0.40/go.mod h1:xsKM0aN3YGcQKTPRPDDtPx2l4mlTN1Djmg0VVXV40b8= github.com/smartcontractkit/chainlink-automation v0.8.1 h1:sTc9LKpBvcKPc1JDYAmgBc2xpDKBco/Q4h4ydl6+UUU= github.com/smartcontractkit/chainlink-automation v0.8.1/go.mod h1:Iij36PvWZ6blrdC5A/nrQUBuf3MH3JvsBB9sSyc9W08= -github.com/smartcontractkit/chainlink-ccip v0.0.0-20250224132459-c57ae4a97dcb h1:Z5QRY8DtXnxnPwbo+mR1mxwaL+OClza3ATUqcQ1Ynz8= -github.com/smartcontractkit/chainlink-ccip v0.0.0-20250224132459-c57ae4a97dcb/go.mod h1:Hht/OJq/PxC+gnBCIPyzHt4Otsw6mYwUVsmtOqIvlxo= +github.com/smartcontractkit/chainlink-ccip v0.0.0-20250224184104-b25011bb3512 h1:XUz6jj+pPIvRbmlalXyFf6O0hGicU8thQtjFvw7dPLo= +github.com/smartcontractkit/chainlink-ccip v0.0.0-20250224184104-b25011bb3512/go.mod h1:Hht/OJq/PxC+gnBCIPyzHt4Otsw6mYwUVsmtOqIvlxo= github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250214202341-4190f2db1c01 h1:R3OD6Phi0ULIQ2uvHiKVWYdgpi/O1Mt46CUK1UApcXU= github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250214202341-4190f2db1c01/go.mod h1:Bmwq4lNb5tE47sydN0TKetcLEGbgl+VxHEWp4S0LI60= github.com/smartcontractkit/chainlink-common v0.4.2-0.20250214231858-f365e2bdecea h1:/1f/pWf7vSV9acTR9UPn2exPAwQG/LHGa4l9OywhS00= diff --git a/integration-tests/go.mod b/integration-tests/go.mod index 47986b51869..072af129c63 100644 --- a/integration-tests/go.mod +++ b/integration-tests/go.mod @@ -46,7 +46,7 @@ require ( github.com/slack-go/slack v0.15.0 github.com/smartcontractkit/chain-selectors v1.0.40 github.com/smartcontractkit/chainlink-automation v0.8.1 - github.com/smartcontractkit/chainlink-ccip v0.0.0-20250224132459-c57ae4a97dcb + github.com/smartcontractkit/chainlink-ccip v0.0.0-20250224184104-b25011bb3512 github.com/smartcontractkit/chainlink-common v0.4.2-0.20250221174903-e1e47fdb11b0 github.com/smartcontractkit/chainlink-integrations/evm v0.0.0-20250213145514-41d874782c02 github.com/smartcontractkit/chainlink-protos/job-distributor v0.9.0 diff --git a/integration-tests/go.sum b/integration-tests/go.sum index a8bf643a088..dd2bac1d964 100644 --- a/integration-tests/go.sum +++ b/integration-tests/go.sum @@ -1384,8 +1384,8 @@ github.com/smartcontractkit/chain-selectors v1.0.40 h1:iLvvoZeehVq6/7F+zzolQLF0D github.com/smartcontractkit/chain-selectors v1.0.40/go.mod h1:xsKM0aN3YGcQKTPRPDDtPx2l4mlTN1Djmg0VVXV40b8= github.com/smartcontractkit/chainlink-automation v0.8.1 h1:sTc9LKpBvcKPc1JDYAmgBc2xpDKBco/Q4h4ydl6+UUU= github.com/smartcontractkit/chainlink-automation v0.8.1/go.mod h1:Iij36PvWZ6blrdC5A/nrQUBuf3MH3JvsBB9sSyc9W08= -github.com/smartcontractkit/chainlink-ccip v0.0.0-20250224132459-c57ae4a97dcb h1:Z5QRY8DtXnxnPwbo+mR1mxwaL+OClza3ATUqcQ1Ynz8= -github.com/smartcontractkit/chainlink-ccip v0.0.0-20250224132459-c57ae4a97dcb/go.mod h1:Hht/OJq/PxC+gnBCIPyzHt4Otsw6mYwUVsmtOqIvlxo= +github.com/smartcontractkit/chainlink-ccip v0.0.0-20250224184104-b25011bb3512 h1:XUz6jj+pPIvRbmlalXyFf6O0hGicU8thQtjFvw7dPLo= +github.com/smartcontractkit/chainlink-ccip v0.0.0-20250224184104-b25011bb3512/go.mod h1:Hht/OJq/PxC+gnBCIPyzHt4Otsw6mYwUVsmtOqIvlxo= github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250214202341-4190f2db1c01 h1:R3OD6Phi0ULIQ2uvHiKVWYdgpi/O1Mt46CUK1UApcXU= github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250214202341-4190f2db1c01/go.mod h1:Bmwq4lNb5tE47sydN0TKetcLEGbgl+VxHEWp4S0LI60= github.com/smartcontractkit/chainlink-common v0.4.2-0.20250221174903-e1e47fdb11b0 h1:BTN2nQgFKBxgas6oqY3ym82O+wT++WlpP1+a6KzIfY0= diff --git a/integration-tests/load/go.mod b/integration-tests/load/go.mod index e699c548a0a..2e7558cce85 100644 --- a/integration-tests/load/go.mod +++ b/integration-tests/load/go.mod @@ -28,7 +28,7 @@ require ( github.com/rs/zerolog v1.33.0 github.com/slack-go/slack v0.15.0 github.com/smartcontractkit/chain-selectors v1.0.40 - github.com/smartcontractkit/chainlink-ccip v0.0.0-20250224132459-c57ae4a97dcb + github.com/smartcontractkit/chainlink-ccip v0.0.0-20250224184104-b25011bb3512 github.com/smartcontractkit/chainlink-common v0.4.2-0.20250221174903-e1e47fdb11b0 github.com/smartcontractkit/chainlink-integrations/evm v0.0.0-20250213145514-41d874782c02 github.com/smartcontractkit/chainlink-testing-framework/lib v1.51.0 diff --git a/integration-tests/load/go.sum b/integration-tests/load/go.sum index 04569532d2f..f45501304d7 100644 --- a/integration-tests/load/go.sum +++ b/integration-tests/load/go.sum @@ -1369,8 +1369,8 @@ github.com/smartcontractkit/chain-selectors v1.0.40 h1:iLvvoZeehVq6/7F+zzolQLF0D github.com/smartcontractkit/chain-selectors v1.0.40/go.mod h1:xsKM0aN3YGcQKTPRPDDtPx2l4mlTN1Djmg0VVXV40b8= github.com/smartcontractkit/chainlink-automation v0.8.1 h1:sTc9LKpBvcKPc1JDYAmgBc2xpDKBco/Q4h4ydl6+UUU= github.com/smartcontractkit/chainlink-automation v0.8.1/go.mod h1:Iij36PvWZ6blrdC5A/nrQUBuf3MH3JvsBB9sSyc9W08= -github.com/smartcontractkit/chainlink-ccip v0.0.0-20250224132459-c57ae4a97dcb h1:Z5QRY8DtXnxnPwbo+mR1mxwaL+OClza3ATUqcQ1Ynz8= -github.com/smartcontractkit/chainlink-ccip v0.0.0-20250224132459-c57ae4a97dcb/go.mod h1:Hht/OJq/PxC+gnBCIPyzHt4Otsw6mYwUVsmtOqIvlxo= +github.com/smartcontractkit/chainlink-ccip v0.0.0-20250224184104-b25011bb3512 h1:XUz6jj+pPIvRbmlalXyFf6O0hGicU8thQtjFvw7dPLo= +github.com/smartcontractkit/chainlink-ccip v0.0.0-20250224184104-b25011bb3512/go.mod h1:Hht/OJq/PxC+gnBCIPyzHt4Otsw6mYwUVsmtOqIvlxo= github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250214202341-4190f2db1c01 h1:R3OD6Phi0ULIQ2uvHiKVWYdgpi/O1Mt46CUK1UApcXU= github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250214202341-4190f2db1c01/go.mod h1:Bmwq4lNb5tE47sydN0TKetcLEGbgl+VxHEWp4S0LI60= github.com/smartcontractkit/chainlink-common v0.4.2-0.20250221174903-e1e47fdb11b0 h1:BTN2nQgFKBxgas6oqY3ym82O+wT++WlpP1+a6KzIfY0= diff --git a/integration-tests/smoke/ccip/ccip_add_chain_test.go b/integration-tests/smoke/ccip/ccip_add_chain_test.go index 22c5acea9fa..0b5f9a3ad46 100644 --- a/integration-tests/smoke/ccip/ccip_add_chain_test.go +++ b/integration-tests/smoke/ccip/ccip_add_chain_test.go @@ -40,10 +40,6 @@ func Test_AddChain(t *testing.T) { testhelpers.WithPrerequisiteDeploymentOnly(nil), testhelpers.WithNumOfUsersPerChain(usersPerChain), testhelpers.WithNoJobsAndContracts(), - testhelpers.WithOCRConfigOverride(func(params *v1_6.CCIPOCRParams) { - // Only 1 boost (=OCR round) is enough to cover the fee - params.ExecuteOffChainConfig.RelativeBoostPerWaitHour = 1 - }), ) allChains := maps.Keys(e.Env.Chains) diff --git a/integration-tests/smoke/ccip/ccip_fee_boosting_test.go b/integration-tests/smoke/ccip/ccip_fee_boosting_test.go deleted file mode 100644 index e8e300b466f..00000000000 --- a/integration-tests/smoke/ccip/ccip_fee_boosting_test.go +++ /dev/null @@ -1,287 +0,0 @@ -package ccip - -import ( - "context" - "math/big" - "testing" - "time" - - "github.com/smartcontractkit/chainlink-common/pkg/config" - - "github.com/smartcontractkit/chainlink/deployment/ccip/changeset" - "github.com/smartcontractkit/chainlink/deployment/ccip/changeset/testhelpers" - "github.com/smartcontractkit/chainlink/deployment/ccip/changeset/v1_6" - commoncs "github.com/smartcontractkit/chainlink/deployment/common/changeset" - testsetups "github.com/smartcontractkit/chainlink/integration-tests/testsetups/ccip" - - "github.com/ethereum/go-ethereum/accounts/abi/bind" - "github.com/ethereum/go-ethereum/common" - "github.com/stretchr/testify/require" - "golang.org/x/exp/maps" - - "github.com/smartcontractkit/chainlink-testing-framework/lib/utils/testcontext" - - cciptypes "github.com/smartcontractkit/chainlink-ccip/pkg/types/ccipocr3" - - "github.com/smartcontractkit/chainlink/v2/core/capabilities/ccip/ccipevm" - - "github.com/smartcontractkit/chainlink/deployment" - "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/v1_2_0/router" - "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/v1_6_0/onramp" -) - -var ( - linkPrice = deployment.E18Mult(100) - wethPrice = deployment.E18Mult(4000) -) - -func Test_CCIPFeeBoosting(t *testing.T) { - t.Skip("Skipping test as Fee Boosting is disabled") - e, _, _ := testsetups.NewIntegrationEnvironment( - t, - testhelpers.WithOCRConfigOverride(func(params *v1_6.CCIPOCRParams) { - params.ExecuteOffChainConfig.RelativeBoostPerWaitHour = 1 - // Disable token price updates - params.CommitOffChainConfig.TokenPriceBatchWriteFrequency = *config.MustNewDuration(1_000_000 * time.Hour) - // Disable gas price updates - params.CommitOffChainConfig.RemoteGasPriceBatchWriteFrequency = *config.MustNewDuration(1_000_000 * time.Hour) - // Disable token price updates - params.CommitOffChainConfig.TokenInfo = nil - }), - ) - - state, err := changeset.LoadOnchainState(e.Env) - require.NoError(t, err) - - allChainSelectors := maps.Keys(e.Env.Chains) - require.Len(t, allChainSelectors, 2) - sourceChain := allChainSelectors[0] - destChain := allChainSelectors[1] - t.Log("All chain selectors:", allChainSelectors, - ", home chain selector:", e.HomeChainSel, - ", feed chain selector:", e.FeedChainSel, - ", source chain selector:", sourceChain, - ", dest chain selector:", destChain, - ) - - // TODO: discrepancy between client and the gas estimator gas price to be fixed - hardcoded for now - // fetchedGasPriceDest, err := e.Env.Chains[destChain].Client.SuggestGasPrice(tests.Context(t)) - fetchedGasPriceDest := big.NewInt(20e9) // 20 Gwei = default gas price - require.NoError(t, err) - originalGasPriceDestUSD := new(big.Int).Div( - new(big.Int).Mul(fetchedGasPriceDest, wethPrice), - big.NewInt(1e18), - ) - t.Log("Gas price on dest chain (USD):", originalGasPriceDestUSD) - - // Adjust destination gas price on source fee quoter to 95% of the current value - adjustedGasPriceDest := - new(big.Int).Div( - new(big.Int).Mul(originalGasPriceDestUSD, big.NewInt(99)), - big.NewInt(100), - ) - t.Log("Adjusted gas price on dest chain:", adjustedGasPriceDest) - - feeQuoterCfg := v1_6.DefaultFeeQuoterDestChainConfig(true) - // the default adds 10% to the gas price, we want to increase it - // to make sure the fee boosting will be finished in proper time for testing - feeQuoterCfg.GasMultiplierWeiPerEth = 120e16 - - testhelpers.AddLane(t, &e, sourceChain, destChain, false, - map[uint64]*big.Int{ - destChain: testhelpers.ToPackedFee(adjustedGasPriceDest, big.NewInt(0)), - }, - map[common.Address]*big.Int{ - state.Chains[sourceChain].LinkToken.Address(): linkPrice, - state.Chains[sourceChain].Weth9.Address(): wethPrice, - }, - feeQuoterCfg) - - // Update token prices in destination chain FeeQuoter - e.Env, err = commoncs.Apply(t, e.Env, e.TimelockContracts(t), - commoncs.Configure( - deployment.CreateLegacyChangeSet(v1_6.UpdateFeeQuoterPricesChangeset), - v1_6.UpdateFeeQuoterPricesConfig{ - PricesByChain: map[uint64]v1_6.FeeQuoterPriceUpdatePerSource{ - destChain: { - TokenPrices: map[common.Address]*big.Int{ - state.Chains[destChain].LinkToken.Address(): linkPrice, - state.Chains[destChain].Weth9.Address(): wethPrice, - }, - }, - }, - }, - ), - ) - require.NoError(t, err) - - startBlocks := make(map[uint64]*uint64) - expectedSeqNum := make(map[testhelpers.SourceDestPair]uint64) - expectedSeqNumExec := make(map[testhelpers.SourceDestPair][]uint64) - - latesthdr, err := e.Env.Chains[sourceChain].Client.HeaderByNumber(testcontext.Get(t), nil) - require.NoError(t, err) - block := latesthdr.Number.Uint64() - msgSentEvent := testhelpers.TestSendRequest(t, e.Env, state, sourceChain, destChain, false, router.ClientEVM2AnyMessage{ - Receiver: common.LeftPadBytes(state.Chains[destChain].Receiver.Address().Bytes(), 32), - Data: []byte("message that needs fee boosting"), - TokenAmounts: nil, - FeeToken: common.HexToAddress("0x0"), - ExtraArgs: nil, - }) - startBlocks[sourceChain] = &block - expectedSeqNum[testhelpers.SourceDestPair{ - SourceChainSelector: sourceChain, - DestChainSelector: destChain, - }] = msgSentEvent.SequenceNumber - expectedSeqNumExec[testhelpers.SourceDestPair{ - SourceChainSelector: sourceChain, - DestChainSelector: destChain, - }] = []uint64{msgSentEvent.SequenceNumber} - - e.Env, err = commoncs.Apply(t, e.Env, e.TimelockContracts(t), - commoncs.Configure( - deployment.CreateLegacyChangeSet(v1_6.UpdateFeeQuoterPricesChangeset), - v1_6.UpdateFeeQuoterPricesConfig{ - PricesByChain: map[uint64]v1_6.FeeQuoterPriceUpdatePerSource{ - sourceChain: { - GasPrices: map[uint64]*big.Int{ - destChain: originalGasPriceDestUSD, - }, - }, - }, - }, - ), - ) - require.NoError(t, err) - - // Confirm gas prices are updated - srcFeeQuoter := state.Chains[sourceChain].FeeQuoter - err = testhelpers.ConfirmGasPriceUpdated(t, e.Env.Chains[destChain], srcFeeQuoter, 0, originalGasPriceDestUSD) - require.NoError(t, err) - - // Confirm that fee boosting will be triggered - require.True(t, willTriggerFeeBoosting(t, msgSentEvent, state, sourceChain, destChain)) - - // hack - time.Sleep(30 * time.Second) - replayBlocks := make(map[uint64]uint64) - replayBlocks[sourceChain] = 1 - replayBlocks[destChain] = 1 - testhelpers.ReplayLogs(t, e.Env.Offchain, replayBlocks) - - // Confirm that the message is committed and executed - testhelpers.ConfirmCommitForAllWithExpectedSeqNums(t, e.Env, state, expectedSeqNum, startBlocks) - testhelpers.ConfirmExecWithSeqNrsForAll(t, e.Env, state, expectedSeqNumExec, startBlocks) -} - -// TODO: Find a more accurate way to determine if fee boosting will be triggered -func willTriggerFeeBoosting( - t *testing.T, - msgSentEvent *onramp.OnRampCCIPMessageSent, - state changeset.CCIPOnChainState, - srcChain, destChain uint64) bool { - msg := convertToMessage(msgSentEvent.Message) - t.Log("\n=== Fee Boosting Analysis ===") - t.Logf("Src Chain: %d", msg.Header.SourceChainSelector) - t.Logf("Dest Chain: %d", msg.Header.DestChainSelector) - - ep := ccipevm.NewGasEstimateProvider() - chainState, exists := state.Chains[srcChain] - require.True(t, exists) - feeQuoter := chainState.FeeQuoter - - premium, err := feeQuoter.GetPremiumMultiplierWeiPerEth(&bind.CallOpts{Context: context.Background()}, chainState.Weth9.Address()) - require.NoError(t, err) - t.Logf("Premium: %d", premium) - - // Get LINK price - linkPrice, err := feeQuoter.GetTokenPrice(&bind.CallOpts{Context: context.Background()}, chainState.LinkToken.Address()) - require.NoError(t, err) - t.Logf("LINK Price: %s", linkPrice.Value.String()) - t.Logf("Juels in message: %s", msg.FeeValueJuels.String()) - - // Calculate fee in USD token - fee := new(big.Int).Div( - new(big.Int).Mul(linkPrice.Value, msg.FeeValueJuels.Int), - new(big.Int).Exp(big.NewInt(10), big.NewInt(18), nil), - ) - t.Logf("Fee paid (in USD token): %s", fee.String()) - - // Calculate message gas - messageGas := new(big.Int).SetUint64(ep.CalculateMessageMaxGas(msg)) - t.Logf("Estimated message gas: %s", messageGas.String()) - - // Get token and gas prices - nativeTokenAddress := chainState.Weth9.Address() - tokenAndGasPrice, err := feeQuoter.GetTokenAndGasPrices(&bind.CallOpts{Context: context.Background()}, nativeTokenAddress, destChain) - require.NoError(t, err) - t.Logf("Raw gas price (uint224): %s for chain: %d", tokenAndGasPrice.GasPriceValue.String(), destChain) - - // Extract uint112 gas price - gasPrice, err := convertGasPriceToUint112(tokenAndGasPrice.GasPriceValue) - require.NoError(t, err) - t.Logf("Extracted gas price (uint112): %s", gasPrice.String()) - t.Logf("Native token price: %s", tokenAndGasPrice.TokenPrice.String()) - - // Calculate total execution cost - execCost := new(big.Int).Mul(messageGas, gasPrice) - t.Logf("Total execution cost: %s", execCost.String()) - - // Check if fee boosting will trigger - willBoost := execCost.Cmp(fee) > 0 - t.Logf("\nWill fee boosting trigger? %v", willBoost) - t.Logf("Execution cost / Fee ratio: %.2f", - new(big.Float).Quo( - new(big.Float).SetInt(execCost), - new(big.Float).SetInt(fee), - ), - ) - - return execCost.Cmp(fee) > 0 -} - -func convertGasPriceToUint112(gasPrice *big.Int) (*big.Int, error) { - // Create a mask for uint112 (112 bits of 1s) - mask := new(big.Int).Sub(new(big.Int).Lsh(big.NewInt(1), 112), big.NewInt(1)) - - // Extract the lower 112 bits using AND operation - result := new(big.Int).And(gasPrice, mask) - - return result, nil -} - -func convertToMessage(msg onramp.InternalEVM2AnyRampMessage) cciptypes.Message { - // Convert header - header := cciptypes.RampMessageHeader{ - MessageID: cciptypes.Bytes32(msg.Header.MessageId), - SourceChainSelector: cciptypes.ChainSelector(msg.Header.SourceChainSelector), - DestChainSelector: cciptypes.ChainSelector(msg.Header.DestChainSelector), - SequenceNumber: cciptypes.SeqNum(msg.Header.SequenceNumber), - Nonce: msg.Header.Nonce, - } - - // Convert token amounts - tokenAmounts := make([]cciptypes.RampTokenAmount, len(msg.TokenAmounts)) - for i, ta := range msg.TokenAmounts { - tokenAmounts[i] = cciptypes.RampTokenAmount{ - SourcePoolAddress: cciptypes.UnknownAddress(ta.SourcePoolAddress.Bytes()), - DestTokenAddress: cciptypes.UnknownAddress(ta.DestTokenAddress), - ExtraData: cciptypes.Bytes(ta.ExtraData), - Amount: cciptypes.BigInt{Int: ta.Amount}, - DestExecData: cciptypes.Bytes(ta.DestExecData), - } - } - - return cciptypes.Message{ - Header: header, - Sender: cciptypes.UnknownAddress(msg.Sender.Bytes()), - Data: cciptypes.Bytes(msg.Data), - Receiver: cciptypes.UnknownAddress(msg.Receiver), - ExtraArgs: cciptypes.Bytes(msg.ExtraArgs), - FeeToken: cciptypes.UnknownAddress(msg.FeeToken.Bytes()), - FeeTokenAmount: cciptypes.BigInt{Int: msg.FeeTokenAmount}, - FeeValueJuels: cciptypes.BigInt{Int: msg.FeeValueJuels}, - TokenAmounts: tokenAmounts, - } -} diff --git a/system-tests/lib/go.mod b/system-tests/lib/go.mod index 8868a5e7f6e..815fe491643 100644 --- a/system-tests/lib/go.mod +++ b/system-tests/lib/go.mod @@ -338,7 +338,7 @@ require ( github.com/smartcontractkit/ccip-owner-contracts v0.1.0 // indirect github.com/smartcontractkit/chain-selectors v1.0.40 // indirect github.com/smartcontractkit/chainlink-automation v0.8.1 // indirect - github.com/smartcontractkit/chainlink-ccip v0.0.0-20250224132459-c57ae4a97dcb // indirect + github.com/smartcontractkit/chainlink-ccip v0.0.0-20250224184104-b25011bb3512 // indirect github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250214202341-4190f2db1c01 // indirect github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20250128203428-08031923fbe5 // indirect github.com/smartcontractkit/chainlink-feeds v0.1.1 // indirect diff --git a/system-tests/lib/go.sum b/system-tests/lib/go.sum index a52fa0c717d..22041e117e8 100644 --- a/system-tests/lib/go.sum +++ b/system-tests/lib/go.sum @@ -1122,8 +1122,8 @@ github.com/smartcontractkit/chain-selectors v1.0.40 h1:iLvvoZeehVq6/7F+zzolQLF0D github.com/smartcontractkit/chain-selectors v1.0.40/go.mod h1:xsKM0aN3YGcQKTPRPDDtPx2l4mlTN1Djmg0VVXV40b8= github.com/smartcontractkit/chainlink-automation v0.8.1 h1:sTc9LKpBvcKPc1JDYAmgBc2xpDKBco/Q4h4ydl6+UUU= github.com/smartcontractkit/chainlink-automation v0.8.1/go.mod h1:Iij36PvWZ6blrdC5A/nrQUBuf3MH3JvsBB9sSyc9W08= -github.com/smartcontractkit/chainlink-ccip v0.0.0-20250224132459-c57ae4a97dcb h1:Z5QRY8DtXnxnPwbo+mR1mxwaL+OClza3ATUqcQ1Ynz8= -github.com/smartcontractkit/chainlink-ccip v0.0.0-20250224132459-c57ae4a97dcb/go.mod h1:Hht/OJq/PxC+gnBCIPyzHt4Otsw6mYwUVsmtOqIvlxo= +github.com/smartcontractkit/chainlink-ccip v0.0.0-20250224184104-b25011bb3512 h1:XUz6jj+pPIvRbmlalXyFf6O0hGicU8thQtjFvw7dPLo= +github.com/smartcontractkit/chainlink-ccip v0.0.0-20250224184104-b25011bb3512/go.mod h1:Hht/OJq/PxC+gnBCIPyzHt4Otsw6mYwUVsmtOqIvlxo= github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250214202341-4190f2db1c01 h1:R3OD6Phi0ULIQ2uvHiKVWYdgpi/O1Mt46CUK1UApcXU= github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250214202341-4190f2db1c01/go.mod h1:Bmwq4lNb5tE47sydN0TKetcLEGbgl+VxHEWp4S0LI60= github.com/smartcontractkit/chainlink-common v0.4.2-0.20250221174903-e1e47fdb11b0 h1:BTN2nQgFKBxgas6oqY3ym82O+wT++WlpP1+a6KzIfY0= diff --git a/system-tests/tests/go.mod b/system-tests/tests/go.mod index c46809f5f61..be753da2e5c 100644 --- a/system-tests/tests/go.mod +++ b/system-tests/tests/go.mod @@ -341,7 +341,7 @@ require ( github.com/sirupsen/logrus v1.9.3 // indirect github.com/smartcontractkit/ccip-owner-contracts v0.1.0 // indirect github.com/smartcontractkit/chainlink-automation v0.8.1 // indirect - github.com/smartcontractkit/chainlink-ccip v0.0.0-20250224132459-c57ae4a97dcb // indirect + github.com/smartcontractkit/chainlink-ccip v0.0.0-20250224184104-b25011bb3512 // indirect github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250214202341-4190f2db1c01 // indirect github.com/smartcontractkit/chainlink-common v0.4.2-0.20250221174903-e1e47fdb11b0 // indirect github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20250128203428-08031923fbe5 // indirect diff --git a/system-tests/tests/go.sum b/system-tests/tests/go.sum index 57a42423877..7a02d902f03 100644 --- a/system-tests/tests/go.sum +++ b/system-tests/tests/go.sum @@ -1122,8 +1122,8 @@ github.com/smartcontractkit/chain-selectors v1.0.40 h1:iLvvoZeehVq6/7F+zzolQLF0D github.com/smartcontractkit/chain-selectors v1.0.40/go.mod h1:xsKM0aN3YGcQKTPRPDDtPx2l4mlTN1Djmg0VVXV40b8= github.com/smartcontractkit/chainlink-automation v0.8.1 h1:sTc9LKpBvcKPc1JDYAmgBc2xpDKBco/Q4h4ydl6+UUU= github.com/smartcontractkit/chainlink-automation v0.8.1/go.mod h1:Iij36PvWZ6blrdC5A/nrQUBuf3MH3JvsBB9sSyc9W08= -github.com/smartcontractkit/chainlink-ccip v0.0.0-20250224132459-c57ae4a97dcb h1:Z5QRY8DtXnxnPwbo+mR1mxwaL+OClza3ATUqcQ1Ynz8= -github.com/smartcontractkit/chainlink-ccip v0.0.0-20250224132459-c57ae4a97dcb/go.mod h1:Hht/OJq/PxC+gnBCIPyzHt4Otsw6mYwUVsmtOqIvlxo= +github.com/smartcontractkit/chainlink-ccip v0.0.0-20250224184104-b25011bb3512 h1:XUz6jj+pPIvRbmlalXyFf6O0hGicU8thQtjFvw7dPLo= +github.com/smartcontractkit/chainlink-ccip v0.0.0-20250224184104-b25011bb3512/go.mod h1:Hht/OJq/PxC+gnBCIPyzHt4Otsw6mYwUVsmtOqIvlxo= github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250214202341-4190f2db1c01 h1:R3OD6Phi0ULIQ2uvHiKVWYdgpi/O1Mt46CUK1UApcXU= github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250214202341-4190f2db1c01/go.mod h1:Bmwq4lNb5tE47sydN0TKetcLEGbgl+VxHEWp4S0LI60= github.com/smartcontractkit/chainlink-common v0.4.2-0.20250221174903-e1e47fdb11b0 h1:BTN2nQgFKBxgas6oqY3ym82O+wT++WlpP1+a6KzIfY0=