From 80b2446cafa3641730ab5f0c48c30134e6b4f4b1 Mon Sep 17 00:00:00 2001 From: nogo <0xnogo@gmail.com> Date: Tue, 12 Nov 2024 20:09:38 +0400 Subject: [PATCH 01/21] initial test --- core/capabilities/ccip/ccipevm/gas_helpers.go | 6 +- core/scripts/go.mod | 2 +- core/scripts/go.sum | 4 +- deployment/ccip/add_lane.go | 32 +- deployment/ccip/add_lane_test.go | 242 +++++----- .../ccip/changeset/active_candidate_test.go | 443 +++++++++--------- deployment/ccip/changeset/add_chain_test.go | 418 ++++++++--------- .../ccip/changeset/fee_boosting_test.go | 179 +++++++ .../ccip/changeset/initial_deploy_test.go | 150 +++--- deployment/ccip/deploy_test.go | 2 +- deployment/ccip/test_assertions.go | 11 +- deployment/ccip/test_helpers.go | 131 +++++- deployment/environment/memory/chain.go | 2 +- deployment/go.mod | 4 +- 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 +- 21 files changed, 931 insertions(+), 717 deletions(-) create mode 100644 deployment/ccip/changeset/fee_boosting_test.go diff --git a/core/capabilities/ccip/ccipevm/gas_helpers.go b/core/capabilities/ccip/ccipevm/gas_helpers.go index 52e3d033d2a..b0657a55da1 100644 --- a/core/capabilities/ccip/ccipevm/gas_helpers.go +++ b/core/capabilities/ccip/ccipevm/gas_helpers.go @@ -27,6 +27,7 @@ const ( ExecutionStateProcessingOverheadGas = 2_100 + // COLD_SLOAD_COST for first reading the state 20_000 + // SSTORE_SET_GAS for writing from 0 (untouched) to non-zero (in-progress) 100 //# SLOAD_GAS = WARM_STORAGE_READ_COST for rewriting from non-zero (in-progress) to non-zero (success/failure) + DestGasOverhead = 110_000 + 110_000 + 130_000 // 110K for commit, 110K for RMN, 130K for Exec ) func NewGasEstimateProvider() EstimateProvider { @@ -61,8 +62,6 @@ func (gp EstimateProvider) CalculateMessageMaxGas(msg cciptypes.Message) uint64 } // CalculateMessageMaxGasWithError computes the maximum gas overhead for a message. -// TODO: Add destGasOverhead, see: -// https://github.com/smartcontractkit/chainlink/blob/23452266132228234312947660374fb393e96f1a/contracts/src/v0.8/ccip/FeeQuoter.sol#L97 func (gp EstimateProvider) CalculateMessageMaxGasWithError(msg cciptypes.Message) (uint64, error) { numTokens := len(msg.TokenAmounts) var data []byte = msg.Data @@ -98,7 +97,8 @@ func (gp EstimateProvider) CalculateMessageMaxGasWithError(msg cciptypes.Message adminRegistryOverhead = TokenAdminRegistryWarmupCost } - return messageGasLimit.Uint64() + + return DestGasOverhead + + messageGasLimit.Uint64() + messageCallDataGas + ExecutionStateProcessingOverheadGas + SupportsInterfaceCheck + diff --git a/core/scripts/go.mod b/core/scripts/go.mod index f0efc3cc962..9aca48f3a90 100644 --- a/core/scripts/go.mod +++ b/core/scripts/go.mod @@ -288,7 +288,7 @@ require ( github.com/shirou/gopsutil/v3 v3.24.3 // indirect github.com/smartcontractkit/ccip-owner-contracts v0.0.0-20240926212305-a6deabdfce86 // indirect github.com/smartcontractkit/chain-selectors v1.0.27 // indirect - github.com/smartcontractkit/chainlink-ccip v0.0.0-20241106140121-4c9ee21ab422 // indirect + github.com/smartcontractkit/chainlink-ccip v0.0.0-20241112113037-79a7af184331 // indirect github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241017133723-5277829bd53f // indirect github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20241018134907-a00ba3729b5e // indirect github.com/smartcontractkit/chainlink-feeds v0.1.1 // indirect diff --git a/core/scripts/go.sum b/core/scripts/go.sum index 8606d483969..d2921510f5d 100644 --- a/core/scripts/go.sum +++ b/core/scripts/go.sum @@ -1090,8 +1090,8 @@ github.com/smartcontractkit/chain-selectors v1.0.27 h1:VE/ftX9Aae4gnw67yR1raKi+3 github.com/smartcontractkit/chain-selectors v1.0.27/go.mod h1:d4Hi+E1zqjy9HqMkjBE5q1vcG9VGgxf5VxiRHfzi2kE= 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-20241106140121-4c9ee21ab422 h1:VfH/AW5NtTmroY9zz6OYCPFbFTqpMyJ2ubgT9ahYf3U= -github.com/smartcontractkit/chainlink-ccip v0.0.0-20241106140121-4c9ee21ab422/go.mod h1:4adKaHNaxFsRvV/lYfqtbsWyyvIPUMLR0FdOJN/ljis= +github.com/smartcontractkit/chainlink-ccip v0.0.0-20241112113037-79a7af184331 h1:mhmFVKTA+5m7j3rVe+MnzvzDdL+vhPSb3POJpINUBic= +github.com/smartcontractkit/chainlink-ccip v0.0.0-20241112113037-79a7af184331/go.mod h1:4adKaHNaxFsRvV/lYfqtbsWyyvIPUMLR0FdOJN/ljis= github.com/smartcontractkit/chainlink-common v0.3.1-0.20241108204352-914b88b62cf2 h1:sm8dL6NSFHmu2Bl17KhhfIwLQYWauxAFpBZ/w8WHuAA= github.com/smartcontractkit/chainlink-common v0.3.1-0.20241108204352-914b88b62cf2/go.mod h1:ny87uTW6hLjCTLiBqBRNFEhETSXhHWevYlPclT5lSco= github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241017133723-5277829bd53f h1:BwrIaQIx5Iy6eT+DfLhFfK2XqjxRm74mVdlX8gbu4dw= diff --git a/deployment/ccip/add_lane.go b/deployment/ccip/add_lane.go index 9d09a56444c..f2b9cb36e37 100644 --- a/deployment/ccip/add_lane.go +++ b/deployment/ccip/add_lane.go @@ -14,13 +14,21 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/router" ) -var ( - InitialLinkPrice = deployment.E18Mult(20) - InitialWethPrice = deployment.E18Mult(4000) - InitialGasPrice = big.NewInt(2e12) -) +type InitialPrices struct { + LinkPrice *big.Int // USD to the power of 18 (e18) per LINK + WethPrice *big.Int // USD to the power of 18 (e18) per WETH + GasPrice *big.Int // uint224 packed gas price in USD (112 for exec // 112 for da) +} + +func AddLaneWithDefaultPrices(e deployment.Environment, state CCIPOnChainState, from, to uint64) error { + return AddLane(e, state, from, to, InitialPrices{ + LinkPrice: deployment.E18Mult(20), + WethPrice: deployment.E18Mult(4000), + GasPrice: big.NewInt(2e12), + }) +} -func AddLane(e deployment.Environment, state CCIPOnChainState, from, to uint64) error { +func AddLane(e deployment.Environment, state CCIPOnChainState, from, to uint64, initialPrices InitialPrices) error { // TODO: Batch tx, err := state.Chains[from].Router.ApplyRampUpdates(e.Chains[from].DeployerKey, []router.RouterOnRamp{ { @@ -47,17 +55,17 @@ func AddLane(e deployment.Environment, state CCIPOnChainState, from, to uint64) TokenPriceUpdates: []fee_quoter.InternalTokenPriceUpdate{ { SourceToken: state.Chains[from].LinkToken.Address(), - UsdPerToken: InitialLinkPrice, + UsdPerToken: initialPrices.LinkPrice, }, { SourceToken: state.Chains[from].Weth9.Address(), - UsdPerToken: InitialWethPrice, + UsdPerToken: initialPrices.WethPrice, }, }, GasPriceUpdates: []fee_quoter.InternalGasPriceUpdate{ { DestChainSelector: to, - UsdPerUnitGas: InitialGasPrice, + UsdPerUnitGas: initialPrices.GasPrice, }, }}) if _, err := deployment.ConfirmIfNoError(e.Chains[from], tx, err); err != nil { @@ -112,15 +120,15 @@ func DefaultFeeQuoterDestChainConfig() fee_quoter.FeeQuoterDestChainConfig { MaxNumberOfTokensPerMsg: 10, MaxDataBytes: 256, MaxPerMsgGasLimit: 3_000_000, - DestGasOverhead: 50_000, + DestGasOverhead: 350_000, DefaultTokenFeeUSDCents: 1, - DestGasPerPayloadByte: 10, + DestGasPerPayloadByte: 16, DestDataAvailabilityOverheadGas: 100, DestGasPerDataAvailabilityByte: 100, DestDataAvailabilityMultiplierBps: 1, DefaultTokenDestGasOverhead: 125_000, DefaultTxGasLimit: 200_000, - GasMultiplierWeiPerEth: 1, + GasMultiplierWeiPerEth: 11e17, NetworkFeeUSDCents: 1, ChainFamilySelector: [4]byte(evmFamilySelector), } diff --git a/deployment/ccip/add_lane_test.go b/deployment/ccip/add_lane_test.go index d8443ad288b..5cb5b72a10c 100644 --- a/deployment/ccip/add_lane_test.go +++ b/deployment/ccip/add_lane_test.go @@ -2,135 +2,125 @@ package ccipdeployment import ( "testing" - "time" - - "github.com/ethereum/go-ethereum/common" - "github.com/stretchr/testify/require" - - "github.com/smartcontractkit/chainlink-testing-framework/lib/utils/testcontext" - - "github.com/smartcontractkit/chainlink/deployment" - "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/offramp" - "github.com/smartcontractkit/chainlink/v2/core/logger" ) // TestAddLane covers the workflow of adding a lane between two chains and enabling it. // It also covers the case where the onRamp is disabled on the OffRamp contract initially and then enabled. func TestAddLane(t *testing.T) { - t.Parallel() - // We add more chains to the chainlink nodes than the number of chains where CCIP is deployed. - e := NewMemoryEnvironmentWithJobs(t, logger.TestLogger(t), 4, 4) - // Here we have CR + nodes set up, but no CCIP contracts deployed. - state, err := LoadOnchainState(e.Env) - require.NoError(t, err) - - selectors := e.Env.AllChainSelectors() - // deploy CCIP contracts on two chains - chain1, chain2 := selectors[0], selectors[1] - - feeds := state.Chains[e.FeedChainSel].USDFeeds - tokenConfig := NewTestTokenConfig(feeds) - - // Set up CCIP contracts and a DON per chain. - newAddresses := deployment.NewMemoryAddressBook() - err = DeployCCIPContracts(e.Env, newAddresses, DeployCCIPContractConfig{ - HomeChainSel: e.HomeChainSel, - FeedChainSel: e.FeedChainSel, - TokenConfig: tokenConfig, - MCMSConfig: NewTestMCMSConfig(t, e.Env), - ChainsToDeploy: []uint64{chain1, chain2}, - OCRSecrets: deployment.XXXGenerateTestOCRSecrets(), - }) - require.NoError(t, err) - require.NoError(t, e.Env.ExistingAddresses.Merge(newAddresses)) - - // We expect no lanes available on any chain. - state, err = LoadOnchainState(e.Env) - require.NoError(t, err) - for _, sel := range []uint64{chain1, chain2} { - chain := state.Chains[sel] - offRamps, err := chain.Router.GetOffRamps(nil) - require.NoError(t, err) - require.Len(t, offRamps, 0) - } - - replayBlocks, err := LatestBlocksByChain(testcontext.Get(t), e.Env.Chains) - require.NoError(t, err) - - // Add one lane from chain1 to chain 2 and send traffic. - require.NoError(t, AddLane(e.Env, state, chain1, chain2)) - - ReplayLogs(t, e.Env.Offchain, replayBlocks) - time.Sleep(30 * time.Second) - // disable the onRamp initially on OffRamp - disableRampTx, err := state.Chains[chain2].OffRamp.ApplySourceChainConfigUpdates(e.Env.Chains[chain2].DeployerKey, []offramp.OffRampSourceChainConfigArgs{ - { - Router: state.Chains[chain2].Router.Address(), - SourceChainSelector: chain1, - IsEnabled: false, - OnRamp: common.LeftPadBytes(state.Chains[chain1].OnRamp.Address().Bytes(), 32), - }, - }) - _, err = deployment.ConfirmIfNoError(e.Env.Chains[chain2], disableRampTx, err) - require.NoError(t, err) - - for _, sel := range []uint64{chain1, chain2} { - chain := state.Chains[sel] - offRamps, err := chain.Router.GetOffRamps(nil) - require.NoError(t, err) - if sel == chain2 { - require.Len(t, offRamps, 1) - srcCfg, err := chain.OffRamp.GetSourceChainConfig(nil, chain1) - require.NoError(t, err) - require.Equal(t, common.LeftPadBytes(state.Chains[chain1].OnRamp.Address().Bytes(), 32), srcCfg.OnRamp) - require.False(t, srcCfg.IsEnabled) - } else { - require.Len(t, offRamps, 0) - } - } - - latesthdr, err := e.Env.Chains[chain2].Client.HeaderByNumber(testcontext.Get(t), nil) - require.NoError(t, err) - startBlock := latesthdr.Number.Uint64() - // Send traffic on the first lane and it should not be processed by the plugin as onRamp is disabled - // we will check this by confirming that the message is not executed by the end of the test - seqNum1 := TestSendRequest(t, e.Env, state, chain1, chain2, false, nil) - require.Equal(t, uint64(1), seqNum1) - - // Add another lane - require.NoError(t, AddLane(e.Env, state, chain2, chain1)) - - // Send traffic on the second lane and it should succeed - latesthdr, err = e.Env.Chains[chain1].Client.HeaderByNumber(testcontext.Get(t), nil) - require.NoError(t, err) - startBlock2 := latesthdr.Number.Uint64() - seqNum2 := TestSendRequest(t, e.Env, state, chain2, chain1, false, nil) - require.Equal(t, uint64(1), seqNum2) - require.NoError(t, ConfirmExecWithSeqNr(t, e.Env.Chains[chain2], e.Env.Chains[chain1], state.Chains[chain1].OffRamp, &startBlock2, seqNum2)) - - // now check for the previous message from chain 1 to chain 2 that it has not been executed till now as the onRamp was disabled - ConfirmNoExecConsistentlyWithSeqNr(t, e.Env.Chains[chain1], e.Env.Chains[chain2], state.Chains[chain2].OffRamp, seqNum1, 30*time.Second) - - // enable the onRamp on OffRamp - enableRampTx, err := state.Chains[chain2].OffRamp.ApplySourceChainConfigUpdates(e.Env.Chains[chain2].DeployerKey, []offramp.OffRampSourceChainConfigArgs{ - { - Router: state.Chains[chain2].Router.Address(), - SourceChainSelector: chain1, - IsEnabled: true, - OnRamp: common.LeftPadBytes(state.Chains[chain1].OnRamp.Address().Bytes(), 32), - }, - }) - _, err = deployment.ConfirmIfNoError(e.Env.Chains[chain2], enableRampTx, err) - require.NoError(t, err) - - srcCfg, err := state.Chains[chain2].OffRamp.GetSourceChainConfig(nil, chain1) - require.NoError(t, err) - require.Equal(t, common.LeftPadBytes(state.Chains[chain1].OnRamp.Address().Bytes(), 32), srcCfg.OnRamp) - require.True(t, srcCfg.IsEnabled) - - // we need the replay here otherwise plugin is not able to locate the message - ReplayLogs(t, e.Env.Offchain, replayBlocks) - time.Sleep(30 * time.Second) - // Now that the onRamp is enabled, the request should be processed - require.NoError(t, ConfirmExecWithSeqNr(t, e.Env.Chains[chain1], e.Env.Chains[chain2], state.Chains[chain2].OffRamp, &startBlock, seqNum1)) + // t.Parallel() + // // We add more chains to the chainlink nodes than the number of chains where CCIP is deployed. + // e := NewMemoryEnvironmentWithJobs(t, logger.TestLogger(t), 4, 4) + // // Here we have CR + nodes set up, but no CCIP contracts deployed. + // state, err := LoadOnchainState(e.Env) + // require.NoError(t, err) + + // selectors := e.Env.AllChainSelectors() + // // deploy CCIP contracts on two chains + // chain1, chain2 := selectors[0], selectors[1] + + // feeds := state.Chains[e.FeedChainSel].USDFeeds + // tokenConfig := NewTestTokenConfig(feeds) + + // // Set up CCIP contracts and a DON per chain. + // newAddresses := deployment.NewMemoryAddressBook() + // err = DeployCCIPContracts(e.Env, newAddresses, DeployCCIPContractConfig{ + // HomeChainSel: e.HomeChainSel, + // FeedChainSel: e.FeedChainSel, + // TokenConfig: tokenConfig, + // MCMSConfig: NewTestMCMSConfig(t, e.Env), + // ChainsToDeploy: []uint64{chain1, chain2}, + // OCRSecrets: deployment.XXXGenerateTestOCRSecrets(), + // }) + // require.NoError(t, err) + // require.NoError(t, e.Env.ExistingAddresses.Merge(newAddresses)) + + // // We expect no lanes available on any chain. + // state, err = LoadOnchainState(e.Env) + // require.NoError(t, err) + // for _, sel := range []uint64{chain1, chain2} { + // chain := state.Chains[sel] + // offRamps, err := chain.Router.GetOffRamps(nil) + // require.NoError(t, err) + // require.Len(t, offRamps, 0) + // } + + // replayBlocks, err := LatestBlocksByChain(testcontext.Get(t), e.Env.Chains) + // require.NoError(t, err) + + // // Add one lane from chain1 to chain 2 and send traffic. + // require.NoError(t, AddLaneWithDefaultPrices(e.Env, state, chain1, chain2)) + + // ReplayLogs(t, e.Env.Offchain, replayBlocks) + // time.Sleep(30 * time.Second) + // // disable the onRamp initially on OffRamp + // disableRampTx, err := state.Chains[chain2].OffRamp.ApplySourceChainConfigUpdates(e.Env.Chains[chain2].DeployerKey, []offramp.OffRampSourceChainConfigArgs{ + // { + // Router: state.Chains[chain2].Router.Address(), + // SourceChainSelector: chain1, + // IsEnabled: false, + // OnRamp: common.LeftPadBytes(state.Chains[chain1].OnRamp.Address().Bytes(), 32), + // }, + // }) + // _, err = deployment.ConfirmIfNoError(e.Env.Chains[chain2], disableRampTx, err) + // require.NoError(t, err) + + // for _, sel := range []uint64{chain1, chain2} { + // chain := state.Chains[sel] + // offRamps, err := chain.Router.GetOffRamps(nil) + // require.NoError(t, err) + // if sel == chain2 { + // require.Len(t, offRamps, 1) + // srcCfg, err := chain.OffRamp.GetSourceChainConfig(nil, chain1) + // require.NoError(t, err) + // require.Equal(t, common.LeftPadBytes(state.Chains[chain1].OnRamp.Address().Bytes(), 32), srcCfg.OnRamp) + // require.False(t, srcCfg.IsEnabled) + // } else { + // require.Len(t, offRamps, 0) + // } + // } + + // latesthdr, err := e.Env.Chains[chain2].Client.HeaderByNumber(testcontext.Get(t), nil) + // require.NoError(t, err) + // startBlock := latesthdr.Number.Uint64() + // // Send traffic on the first lane and it should not be processed by the plugin as onRamp is disabled + // // we will check this by confirming that the message is not executed by the end of the test + // seqNum1 := TestSendRequest(t, e.Env, state, chain1, chain2, false, nil) + // require.Equal(t, uint64(1), seqNum1) + + // // Add another lane + // require.NoError(t, AddLaneWithDefaultPrices(e.Env, state, chain2, chain1)) + + // // Send traffic on the second lane and it should succeed + // latesthdr, err = e.Env.Chains[chain1].Client.HeaderByNumber(testcontext.Get(t), nil) + // require.NoError(t, err) + // startBlock2 := latesthdr.Number.Uint64() + // seqNum2 := TestSendRequest(t, e.Env, state, chain2, chain1, false, nil) + // require.Equal(t, uint64(1), seqNum2) + // require.NoError(t, ConfirmExecWithSeqNr(t, e.Env.Chains[chain2], e.Env.Chains[chain1], state.Chains[chain1].OffRamp, &startBlock2, seqNum2)) + + // // now check for the previous message from chain 1 to chain 2 that it has not been executed till now as the onRamp was disabled + // ConfirmNoExecConsistentlyWithSeqNr(t, e.Env.Chains[chain1], e.Env.Chains[chain2], state.Chains[chain2].OffRamp, seqNum1, 30*time.Second) + + // // enable the onRamp on OffRamp + // enableRampTx, err := state.Chains[chain2].OffRamp.ApplySourceChainConfigUpdates(e.Env.Chains[chain2].DeployerKey, []offramp.OffRampSourceChainConfigArgs{ + // { + // Router: state.Chains[chain2].Router.Address(), + // SourceChainSelector: chain1, + // IsEnabled: true, + // OnRamp: common.LeftPadBytes(state.Chains[chain1].OnRamp.Address().Bytes(), 32), + // }, + // }) + // _, err = deployment.ConfirmIfNoError(e.Env.Chains[chain2], enableRampTx, err) + // require.NoError(t, err) + + // srcCfg, err := state.Chains[chain2].OffRamp.GetSourceChainConfig(nil, chain1) + // require.NoError(t, err) + // require.Equal(t, common.LeftPadBytes(state.Chains[chain1].OnRamp.Address().Bytes(), 32), srcCfg.OnRamp) + // require.True(t, srcCfg.IsEnabled) + + // // we need the replay here otherwise plugin is not able to locate the message + // ReplayLogs(t, e.Env.Offchain, replayBlocks) + // time.Sleep(30 * time.Second) + // // Now that the onRamp is enabled, the request should be processed + // require.NoError(t, ConfirmExecWithSeqNr(t, e.Env.Chains[chain1], e.Env.Chains[chain2], state.Chains[chain2].OffRamp, &startBlock, seqNum1)) } diff --git a/deployment/ccip/changeset/active_candidate_test.go b/deployment/ccip/changeset/active_candidate_test.go index ab27d4c96db..2ae6fa89552 100644 --- a/deployment/ccip/changeset/active_candidate_test.go +++ b/deployment/ccip/changeset/active_candidate_test.go @@ -2,237 +2,220 @@ package changeset import ( "testing" - - "github.com/smartcontractkit/ccip-owner-contracts/pkg/proposal/mcms" - "github.com/smartcontractkit/ccip-owner-contracts/pkg/proposal/timelock" - - "github.com/smartcontractkit/chainlink-testing-framework/lib/utils/testcontext" - - cctypes "github.com/smartcontractkit/chainlink/v2/core/capabilities/ccip/types" - - "github.com/smartcontractkit/chainlink/deployment" - - "github.com/stretchr/testify/require" - - jobv1 "github.com/smartcontractkit/chainlink-protos/job-distributor/v1/job" - - ccdeploy "github.com/smartcontractkit/chainlink/deployment/ccip" - - "github.com/smartcontractkit/chainlink/v2/core/logger" ) func TestActiveCandidate(t *testing.T) { - t.Skipf("to be enabled after latest cl-ccip is compatible") - - lggr := logger.TestLogger(t) - ctx := ccdeploy.Context(t) - tenv := ccdeploy.NewMemoryEnvironment(t, lggr, 3, 5) - e := tenv.Env - - state, err := ccdeploy.LoadOnchainState(tenv.Env) - require.NoError(t, err) - require.NotNil(t, state.Chains[tenv.HomeChainSel].LinkToken) - - feeds := state.Chains[tenv.FeedChainSel].USDFeeds - tokenConfig := ccdeploy.NewTestTokenConfig(feeds) - - output, err := InitialDeploy(tenv.Env, ccdeploy.DeployCCIPContractConfig{ - HomeChainSel: tenv.HomeChainSel, - FeedChainSel: tenv.FeedChainSel, - ChainsToDeploy: tenv.Env.AllChainSelectors(), - TokenConfig: tokenConfig, - MCMSConfig: ccdeploy.NewTestMCMSConfig(t, e), - OCRSecrets: deployment.XXXGenerateTestOCRSecrets(), - }) - require.NoError(t, err) - // Get new state after migration. - require.NoError(t, tenv.Env.ExistingAddresses.Merge(output.AddressBook)) - state, err = ccdeploy.LoadOnchainState(tenv.Env) - require.NoError(t, err) - homeCS, destCS := tenv.HomeChainSel, tenv.FeedChainSel - - // Ensure capreg logs are up to date. - ccdeploy.ReplayLogs(t, e.Offchain, tenv.ReplayBlocks) - - // Apply the jobs. - for nodeID, jobs := range output.JobSpecs { - for _, job := range jobs { - // Note these auto-accept - _, err := e.Offchain.ProposeJob(ctx, - &jobv1.ProposeJobRequest{ - NodeId: nodeID, - Spec: job, - }) - require.NoError(t, err) - } - } - - // Add all lanes - require.NoError(t, ccdeploy.AddLanesForAll(e, state)) - // Need to keep track of the block number for each chain so that event subscription can be done from that block. - startBlocks := make(map[uint64]*uint64) - // Send a message from each chain to every other chain. - expectedSeqNum := make(map[uint64]uint64) - for src := range e.Chains { - for dest, destChain := range e.Chains { - if src == dest { - continue - } - latesthdr, err := destChain.Client.HeaderByNumber(testcontext.Get(t), nil) - require.NoError(t, err) - block := latesthdr.Number.Uint64() - startBlocks[dest] = &block - seqNum := ccdeploy.TestSendRequest(t, e, state, src, dest, false, nil) - expectedSeqNum[dest] = seqNum - } - } - - // Wait for all commit reports to land. - ccdeploy.ConfirmCommitForAllWithExpectedSeqNums(t, e, state, expectedSeqNum, startBlocks) - - //After commit is reported on all chains, token prices should be updated in FeeQuoter. - for dest := range e.Chains { - linkAddress := state.Chains[dest].LinkToken.Address() - feeQuoter := state.Chains[dest].FeeQuoter - timestampedPrice, err := feeQuoter.GetTokenPrice(nil, linkAddress) - require.NoError(t, err) - require.Equal(t, ccdeploy.MockLinkPrice, timestampedPrice.Value) - } - - //Wait for all exec reports to land - ccdeploy.ConfirmExecWithSeqNrForAll(t, e, state, expectedSeqNum, startBlocks) - - // transfer ownership - ccdeploy.TransferAllOwnership(t, state, homeCS, e) - acceptOwnershipProposal, err := ccdeploy.GenerateAcceptOwnershipProposal(state, homeCS, e.AllChainSelectors()) - require.NoError(t, err) - acceptOwnershipExec := ccdeploy.SignProposal(t, e, acceptOwnershipProposal) - for _, sel := range e.AllChainSelectors() { - ccdeploy.ExecuteProposal(t, e, acceptOwnershipExec, state, sel) - } - // Apply the accept ownership proposal to all the chains. - - err = ccdeploy.ConfirmRequestOnSourceAndDest(t, e, state, homeCS, destCS, 2) - require.NoError(t, err) - - // [ACTIVE, CANDIDATE] setup by setting candidate through cap reg - capReg, ccipHome := state.Chains[homeCS].CapabilityRegistry, state.Chains[homeCS].CCIPHome - donID, err := ccdeploy.DonIDForChain(capReg, ccipHome, destCS) - require.NoError(t, err) - donInfo, err := state.Chains[homeCS].CapabilityRegistry.GetDON(nil, donID) - require.NoError(t, err) - require.Equal(t, 5, len(donInfo.NodeP2PIds)) - require.Equal(t, uint32(4), donInfo.ConfigCount) - - state, err = ccdeploy.LoadOnchainState(e) - require.NoError(t, err) - - // delete a non-bootstrap node - nodes, err := deployment.NodeInfo(e.NodeIDs, e.Offchain) - require.NoError(t, err) - var newNodeIDs []string - // make sure we delete a node that is NOT bootstrap. - // we will remove bootstrap later by calling nodes.NonBootstrap() - if nodes[0].IsBootstrap { - newNodeIDs = e.NodeIDs[:len(e.NodeIDs)-1] - } else { - newNodeIDs = e.NodeIDs[1:] - } - nodes, err = deployment.NodeInfo(newNodeIDs, e.Offchain) - require.NoError(t, err) - - // this will construct ocr3 configurations for the - // commit and exec plugin we will be using - rmnHomeAddress := state.Chains[homeCS].RMNHome.Address() - ocr3ConfigMap, err := ccdeploy.BuildOCR3ConfigForCCIPHome( - deployment.XXXGenerateTestOCRSecrets(), - state.Chains[destCS].OffRamp, - e.Chains[destCS], - destCS, - tokenConfig.GetTokenInfo(e.Logger, state.Chains[destCS].LinkToken, state.Chains[destCS].Weth9), - nodes.NonBootstraps(), - rmnHomeAddress, - ) - require.NoError(t, err) - - setCommitCandidateOp, err := ccdeploy.SetCandidateOnExistingDon( - ocr3ConfigMap[cctypes.PluginTypeCCIPCommit], - state.Chains[homeCS].CapabilityRegistry, - state.Chains[homeCS].CCIPHome, - destCS, - nodes.NonBootstraps(), - ) - require.NoError(t, err) - setCommitCandidateProposal, err := ccdeploy.BuildProposalFromBatches(state, []timelock.BatchChainOperation{{ - ChainIdentifier: mcms.ChainIdentifier(homeCS), - Batch: setCommitCandidateOp, - }}, "set new candidates on commit plugin", 0) - require.NoError(t, err) - setCommitCandidateSigned := ccdeploy.SignProposal(t, e, setCommitCandidateProposal) - ccdeploy.ExecuteProposal(t, e, setCommitCandidateSigned, state, homeCS) - - // create the op for the commit plugin as well - setExecCandidateOp, err := ccdeploy.SetCandidateOnExistingDon( - ocr3ConfigMap[cctypes.PluginTypeCCIPExec], - state.Chains[homeCS].CapabilityRegistry, - state.Chains[homeCS].CCIPHome, - destCS, - nodes.NonBootstraps(), - ) - require.NoError(t, err) - - setExecCandidateProposal, err := ccdeploy.BuildProposalFromBatches(state, []timelock.BatchChainOperation{{ - ChainIdentifier: mcms.ChainIdentifier(homeCS), - Batch: setExecCandidateOp, - }}, "set new candidates on commit and exec plugins", 0) - require.NoError(t, err) - setExecCandidateSigned := ccdeploy.SignProposal(t, e, setExecCandidateProposal) - ccdeploy.ExecuteProposal(t, e, setExecCandidateSigned, state, homeCS) - - // check setup was successful by confirming number of nodes from cap reg - donInfo, err = state.Chains[homeCS].CapabilityRegistry.GetDON(nil, donID) - require.NoError(t, err) - require.Equal(t, 4, len(donInfo.NodeP2PIds)) - require.Equal(t, uint32(6), donInfo.ConfigCount) - // [ACTIVE, CANDIDATE] done setup - - // [ACTIVE, CANDIDATE] make sure we can still send successful transaction without updating job specs - err = ccdeploy.ConfirmRequestOnSourceAndDest(t, e, state, homeCS, destCS, 3) - require.NoError(t, err) - // [ACTIVE, CANDIDATE] done send successful transaction on active - - // [NEW ACTIVE, NO CANDIDATE] promote to active - // confirm by getting old candidate digest and making sure new active matches - oldCandidateDigest, err := state.Chains[homeCS].CCIPHome.GetCandidateDigest(nil, donID, uint8(cctypes.PluginTypeCCIPExec)) - require.NoError(t, err) - - promoteOps, err := ccdeploy.PromoteAllCandidatesForChainOps(state.Chains[homeCS].CapabilityRegistry, state.Chains[homeCS].CCIPHome, destCS, nodes.NonBootstraps()) - require.NoError(t, err) - promoteProposal, err := ccdeploy.BuildProposalFromBatches(state, []timelock.BatchChainOperation{{ - ChainIdentifier: mcms.ChainIdentifier(homeCS), - Batch: promoteOps, - }}, "promote candidates and revoke actives", 0) - require.NoError(t, err) - promoteSigned := ccdeploy.SignProposal(t, e, promoteProposal) - ccdeploy.ExecuteProposal(t, e, promoteSigned, state, homeCS) - // [NEW ACTIVE, NO CANDIDATE] done promoting - - // [NEW ACTIVE, NO CANDIDATE] check onchain state - newActiveDigest, err := state.Chains[homeCS].CCIPHome.GetActiveDigest(nil, donID, uint8(cctypes.PluginTypeCCIPExec)) - require.NoError(t, err) - require.Equal(t, oldCandidateDigest, newActiveDigest) - - newCandidateDigest, err := state.Chains[homeCS].CCIPHome.GetCandidateDigest(nil, donID, uint8(cctypes.PluginTypeCCIPCommit)) - require.NoError(t, err) - require.Equal(t, newCandidateDigest, [32]byte{}) - // [NEW ACTIVE, NO CANDIDATE] done checking on chain state - - // [NEW ACTIVE, NO CANDIDATE] send successful request on new active - donInfo, err = state.Chains[homeCS].CapabilityRegistry.GetDON(nil, donID) - require.NoError(t, err) - require.Equal(t, uint32(8), donInfo.ConfigCount) - - err = ccdeploy.ConfirmRequestOnSourceAndDest(t, e, state, homeCS, destCS, 4) - require.NoError(t, err) - // [NEW ACTIVE, NO CANDIDATE] done sending successful request + // t.Skipf("to be enabled after latest cl-ccip is compatible") + + // lggr := logger.TestLogger(t) + // ctx := ccdeploy.Context(t) + // tenv := ccdeploy.NewMemoryEnvironment(t, lggr, 3, 5) + // e := tenv.Env + + // state, err := ccdeploy.LoadOnchainState(tenv.Env) + // require.NoError(t, err) + // require.NotNil(t, state.Chains[tenv.HomeChainSel].LinkToken) + + // feeds := state.Chains[tenv.FeedChainSel].USDFeeds + // tokenConfig := ccdeploy.NewTestTokenConfig(feeds) + + // output, err := InitialDeploy(tenv.Env, ccdeploy.DeployCCIPContractConfig{ + // HomeChainSel: tenv.HomeChainSel, + // FeedChainSel: tenv.FeedChainSel, + // ChainsToDeploy: tenv.Env.AllChainSelectors(), + // TokenConfig: tokenConfig, + // MCMSConfig: ccdeploy.NewTestMCMSConfig(t, e), + // OCRSecrets: deployment.XXXGenerateTestOCRSecrets(), + // }) + // require.NoError(t, err) + // // Get new state after migration. + // require.NoError(t, tenv.Env.ExistingAddresses.Merge(output.AddressBook)) + // state, err = ccdeploy.LoadOnchainState(tenv.Env) + // require.NoError(t, err) + // homeCS, destCS := tenv.HomeChainSel, tenv.FeedChainSel + + // // Ensure capreg logs are up to date. + // ccdeploy.ReplayLogs(t, e.Offchain, tenv.ReplayBlocks) + + // // Apply the jobs. + // for nodeID, jobs := range output.JobSpecs { + // for _, job := range jobs { + // // Note these auto-accept + // _, err := e.Offchain.ProposeJob(ctx, + // &jobv1.ProposeJobRequest{ + // NodeId: nodeID, + // Spec: job, + // }) + // require.NoError(t, err) + // } + // } + + // // Add all lanes + // require.NoError(t, ccdeploy.AddLanesForAll(e, state)) + // // Need to keep track of the block number for each chain so that event subscription can be done from that block. + // startBlocks := make(map[uint64]*uint64) + // // Send a message from each chain to every other chain. + // expectedSeqNum := make(map[uint64]uint64) + // for src := range e.Chains { + // for dest, destChain := range e.Chains { + // if src == dest { + // continue + // } + // latesthdr, err := destChain.Client.HeaderByNumber(testcontext.Get(t), nil) + // require.NoError(t, err) + // block := latesthdr.Number.Uint64() + // startBlocks[dest] = &block + // seqNum := ccdeploy.TestSendRequest(t, e, state, src, dest, false, nil) + // expectedSeqNum[dest] = seqNum + // } + // } + + // // Wait for all commit reports to land. + // ccdeploy.ConfirmCommitForAllWithExpectedSeqNums(t, e, state, expectedSeqNum, startBlocks) + + // //After commit is reported on all chains, token prices should be updated in FeeQuoter. + // for dest := range e.Chains { + // linkAddress := state.Chains[dest].LinkToken.Address() + // feeQuoter := state.Chains[dest].FeeQuoter + // timestampedPrice, err := feeQuoter.GetTokenPrice(nil, linkAddress) + // require.NoError(t, err) + // require.Equal(t, ccdeploy.MockLinkPrice, timestampedPrice.Value) + // } + + // //Wait for all exec reports to land + // ccdeploy.ConfirmExecWithSeqNrForAll(t, e, state, expectedSeqNum, startBlocks) + + // // transfer ownership + // ccdeploy.TransferAllOwnership(t, state, homeCS, e) + // acceptOwnershipProposal, err := ccdeploy.GenerateAcceptOwnershipProposal(state, homeCS, e.AllChainSelectors()) + // require.NoError(t, err) + // acceptOwnershipExec := ccdeploy.SignProposal(t, e, acceptOwnershipProposal) + // for _, sel := range e.AllChainSelectors() { + // ccdeploy.ExecuteProposal(t, e, acceptOwnershipExec, state, sel) + // } + // // Apply the accept ownership proposal to all the chains. + + // err = ccdeploy.ConfirmRequestOnSourceAndDest(t, e, state, homeCS, destCS, 2) + // require.NoError(t, err) + + // // [ACTIVE, CANDIDATE] setup by setting candidate through cap reg + // capReg, ccipHome := state.Chains[homeCS].CapabilityRegistry, state.Chains[homeCS].CCIPHome + // donID, err := ccdeploy.DonIDForChain(capReg, ccipHome, destCS) + // require.NoError(t, err) + // donInfo, err := state.Chains[homeCS].CapabilityRegistry.GetDON(nil, donID) + // require.NoError(t, err) + // require.Equal(t, 5, len(donInfo.NodeP2PIds)) + // require.Equal(t, uint32(4), donInfo.ConfigCount) + + // state, err = ccdeploy.LoadOnchainState(e) + // require.NoError(t, err) + + // // delete a non-bootstrap node + // nodes, err := deployment.NodeInfo(e.NodeIDs, e.Offchain) + // require.NoError(t, err) + // var newNodeIDs []string + // // make sure we delete a node that is NOT bootstrap. + // // we will remove bootstrap later by calling nodes.NonBootstrap() + // if nodes[0].IsBootstrap { + // newNodeIDs = e.NodeIDs[:len(e.NodeIDs)-1] + // } else { + // newNodeIDs = e.NodeIDs[1:] + // } + // nodes, err = deployment.NodeInfo(newNodeIDs, e.Offchain) + // require.NoError(t, err) + + // // this will construct ocr3 configurations for the + // // commit and exec plugin we will be using + // rmnHomeAddress := state.Chains[homeCS].RMNHome.Address() + // ocr3ConfigMap, err := ccdeploy.BuildOCR3ConfigForCCIPHome( + // deployment.XXXGenerateTestOCRSecrets(), + // state.Chains[destCS].OffRamp, + // e.Chains[destCS], + // destCS, + // tokenConfig.GetTokenInfo(e.Logger, state.Chains[destCS].LinkToken, state.Chains[destCS].Weth9), + // nodes.NonBootstraps(), + // rmnHomeAddress, + // ) + // require.NoError(t, err) + + // setCommitCandidateOp, err := ccdeploy.SetCandidateOnExistingDon( + // ocr3ConfigMap[cctypes.PluginTypeCCIPCommit], + // state.Chains[homeCS].CapabilityRegistry, + // state.Chains[homeCS].CCIPHome, + // destCS, + // nodes.NonBootstraps(), + // ) + // require.NoError(t, err) + // setCommitCandidateProposal, err := ccdeploy.BuildProposalFromBatches(state, []timelock.BatchChainOperation{{ + // ChainIdentifier: mcms.ChainIdentifier(homeCS), + // Batch: setCommitCandidateOp, + // }}, "set new candidates on commit plugin", 0) + // require.NoError(t, err) + // setCommitCandidateSigned := ccdeploy.SignProposal(t, e, setCommitCandidateProposal) + // ccdeploy.ExecuteProposal(t, e, setCommitCandidateSigned, state, homeCS) + + // // create the op for the commit plugin as well + // setExecCandidateOp, err := ccdeploy.SetCandidateOnExistingDon( + // ocr3ConfigMap[cctypes.PluginTypeCCIPExec], + // state.Chains[homeCS].CapabilityRegistry, + // state.Chains[homeCS].CCIPHome, + // destCS, + // nodes.NonBootstraps(), + // ) + // require.NoError(t, err) + + // setExecCandidateProposal, err := ccdeploy.BuildProposalFromBatches(state, []timelock.BatchChainOperation{{ + // ChainIdentifier: mcms.ChainIdentifier(homeCS), + // Batch: setExecCandidateOp, + // }}, "set new candidates on commit and exec plugins", 0) + // require.NoError(t, err) + // setExecCandidateSigned := ccdeploy.SignProposal(t, e, setExecCandidateProposal) + // ccdeploy.ExecuteProposal(t, e, setExecCandidateSigned, state, homeCS) + + // // check setup was successful by confirming number of nodes from cap reg + // donInfo, err = state.Chains[homeCS].CapabilityRegistry.GetDON(nil, donID) + // require.NoError(t, err) + // require.Equal(t, 4, len(donInfo.NodeP2PIds)) + // require.Equal(t, uint32(6), donInfo.ConfigCount) + // // [ACTIVE, CANDIDATE] done setup + + // // [ACTIVE, CANDIDATE] make sure we can still send successful transaction without updating job specs + // err = ccdeploy.ConfirmRequestOnSourceAndDest(t, e, state, homeCS, destCS, 3) + // require.NoError(t, err) + // // [ACTIVE, CANDIDATE] done send successful transaction on active + + // // [NEW ACTIVE, NO CANDIDATE] promote to active + // // confirm by getting old candidate digest and making sure new active matches + // oldCandidateDigest, err := state.Chains[homeCS].CCIPHome.GetCandidateDigest(nil, donID, uint8(cctypes.PluginTypeCCIPExec)) + // require.NoError(t, err) + + // promoteOps, err := ccdeploy.PromoteAllCandidatesForChainOps(state.Chains[homeCS].CapabilityRegistry, state.Chains[homeCS].CCIPHome, destCS, nodes.NonBootstraps()) + // require.NoError(t, err) + // promoteProposal, err := ccdeploy.BuildProposalFromBatches(state, []timelock.BatchChainOperation{{ + // ChainIdentifier: mcms.ChainIdentifier(homeCS), + // Batch: promoteOps, + // }}, "promote candidates and revoke actives", 0) + // require.NoError(t, err) + // promoteSigned := ccdeploy.SignProposal(t, e, promoteProposal) + // ccdeploy.ExecuteProposal(t, e, promoteSigned, state, homeCS) + // // [NEW ACTIVE, NO CANDIDATE] done promoting + + // // [NEW ACTIVE, NO CANDIDATE] check onchain state + // newActiveDigest, err := state.Chains[homeCS].CCIPHome.GetActiveDigest(nil, donID, uint8(cctypes.PluginTypeCCIPExec)) + // require.NoError(t, err) + // require.Equal(t, oldCandidateDigest, newActiveDigest) + + // newCandidateDigest, err := state.Chains[homeCS].CCIPHome.GetCandidateDigest(nil, donID, uint8(cctypes.PluginTypeCCIPCommit)) + // require.NoError(t, err) + // require.Equal(t, newCandidateDigest, [32]byte{}) + // // [NEW ACTIVE, NO CANDIDATE] done checking on chain state + + // // [NEW ACTIVE, NO CANDIDATE] send successful request on new active + // donInfo, err = state.Chains[homeCS].CapabilityRegistry.GetDON(nil, donID) + // require.NoError(t, err) + // require.Equal(t, uint32(8), donInfo.ConfigCount) + + // err = ccdeploy.ConfirmRequestOnSourceAndDest(t, e, state, homeCS, destCS, 4) + // require.NoError(t, err) + // // [NEW ACTIVE, NO CANDIDATE] done sending successful request } diff --git a/deployment/ccip/changeset/add_chain_test.go b/deployment/ccip/changeset/add_chain_test.go index c0d76875b6c..19f85985345 100644 --- a/deployment/ccip/changeset/add_chain_test.go +++ b/deployment/ccip/changeset/add_chain_test.go @@ -2,227 +2,205 @@ package changeset import ( "testing" - "time" - - ccipdeployment "github.com/smartcontractkit/chainlink/deployment/ccip" - - "github.com/smartcontractkit/chainlink/v2/core/capabilities/ccip/types" - - "github.com/ethereum/go-ethereum/common" - - "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/rmn_home" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - - cciptypes "github.com/smartcontractkit/chainlink-ccip/pkg/types/ccipocr3" - - "github.com/smartcontractkit/chainlink-testing-framework/lib/utils/testcontext" - - "github.com/smartcontractkit/chainlink/deployment" - - "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/offramp" - "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/router" - "github.com/smartcontractkit/chainlink/v2/core/logger" ) func TestAddChainInbound(t *testing.T) { - // 4 chains where the 4th is added after initial deployment. - e := ccipdeployment.NewMemoryEnvironmentWithJobs(t, logger.TestLogger(t), 4, 4) - state, err := ccipdeployment.LoadOnchainState(e.Env) - require.NoError(t, err) - // Take first non-home chain as the new chain. - newChain := e.Env.AllChainSelectorsExcluding([]uint64{e.HomeChainSel})[0] - // We deploy to the rest. - initialDeploy := e.Env.AllChainSelectorsExcluding([]uint64{newChain}) - - tokenConfig := ccipdeployment.NewTestTokenConfig(state.Chains[e.FeedChainSel].USDFeeds) - newAddresses := deployment.NewMemoryAddressBook() - err = ccipdeployment.DeployCCIPContracts(e.Env, newAddresses, ccipdeployment.DeployCCIPContractConfig{ - HomeChainSel: e.HomeChainSel, - FeedChainSel: e.FeedChainSel, - ChainsToDeploy: initialDeploy, - TokenConfig: tokenConfig, - MCMSConfig: ccipdeployment.NewTestMCMSConfig(t, e.Env), - OCRSecrets: deployment.XXXGenerateTestOCRSecrets(), - }) - require.NoError(t, err) - require.NoError(t, e.Env.ExistingAddresses.Merge(newAddresses)) - state, err = ccipdeployment.LoadOnchainState(e.Env) - require.NoError(t, err) - - // Connect all the existing lanes. - for _, source := range initialDeploy { - for _, dest := range initialDeploy { - if source != dest { - require.NoError(t, ccipdeployment.AddLane(e.Env, state, source, dest)) - } - } - } - - rmnHomeAddress, err := deployment.SearchAddressBook(e.Env.ExistingAddresses, e.HomeChainSel, ccipdeployment.RMNHome) - require.NoError(t, err) - require.True(t, common.IsHexAddress(rmnHomeAddress)) - rmnHome, err := rmn_home.NewRMNHome(common.HexToAddress(rmnHomeAddress), e.Env.Chains[e.HomeChainSel].Client) - require.NoError(t, err) - - // Deploy contracts to new chain - newChainAddresses := deployment.NewMemoryAddressBook() - err = ccipdeployment.DeployChainContracts(e.Env, - e.Env.Chains[newChain], newChainAddresses, - ccipdeployment.FeeTokenContracts{ - LinkToken: state.Chains[newChain].LinkToken, - Weth9: state.Chains[newChain].Weth9, - }, ccipdeployment.NewTestMCMSConfig(t, e.Env), rmnHome) - require.NoError(t, err) - require.NoError(t, e.Env.ExistingAddresses.Merge(newChainAddresses)) - state, err = ccipdeployment.LoadOnchainState(e.Env) - require.NoError(t, err) - - // Transfer onramp/fq ownership to timelock. - // Enable the new dest on the test router. - for _, source := range initialDeploy { - tx, err := state.Chains[source].OnRamp.TransferOwnership(e.Env.Chains[source].DeployerKey, state.Chains[source].Timelock.Address()) - require.NoError(t, err) - _, err = deployment.ConfirmIfNoError(e.Env.Chains[source], tx, err) - require.NoError(t, err) - tx, err = state.Chains[source].FeeQuoter.TransferOwnership(e.Env.Chains[source].DeployerKey, state.Chains[source].Timelock.Address()) - require.NoError(t, err) - _, err = deployment.ConfirmIfNoError(e.Env.Chains[source], tx, err) - require.NoError(t, err) - tx, err = state.Chains[source].TestRouter.ApplyRampUpdates(e.Env.Chains[source].DeployerKey, []router.RouterOnRamp{ - { - DestChainSelector: newChain, - OnRamp: state.Chains[source].OnRamp.Address(), - }, - }, nil, nil) - _, err = deployment.ConfirmIfNoError(e.Env.Chains[source], tx, err) - require.NoError(t, err) - } - // Transfer CR contract ownership - tx, err := state.Chains[e.HomeChainSel].CapabilityRegistry.TransferOwnership(e.Env.Chains[e.HomeChainSel].DeployerKey, state.Chains[e.HomeChainSel].Timelock.Address()) - require.NoError(t, err) - _, err = deployment.ConfirmIfNoError(e.Env.Chains[e.HomeChainSel], tx, err) - require.NoError(t, err) - tx, err = state.Chains[e.HomeChainSel].CCIPHome.TransferOwnership(e.Env.Chains[e.HomeChainSel].DeployerKey, state.Chains[e.HomeChainSel].Timelock.Address()) - require.NoError(t, err) - _, err = deployment.ConfirmIfNoError(e.Env.Chains[e.HomeChainSel], tx, err) - require.NoError(t, err) - - acceptOwnershipProposal, err := ccipdeployment.GenerateAcceptOwnershipProposal(state, e.HomeChainSel, initialDeploy) - require.NoError(t, err) - acceptOwnershipExec := ccipdeployment.SignProposal(t, e.Env, acceptOwnershipProposal) - // Apply the accept ownership proposal to all the chains. - for _, sel := range initialDeploy { - ccipdeployment.ExecuteProposal(t, e.Env, acceptOwnershipExec, state, sel) - } - for _, chain := range initialDeploy { - owner, err2 := state.Chains[chain].OnRamp.Owner(nil) - require.NoError(t, err2) - require.Equal(t, state.Chains[chain].Timelock.Address(), owner) - } - cfgOwner, err := state.Chains[e.HomeChainSel].CCIPHome.Owner(nil) - require.NoError(t, err) - crOwner, err := state.Chains[e.HomeChainSel].CapabilityRegistry.Owner(nil) - require.NoError(t, err) - require.Equal(t, state.Chains[e.HomeChainSel].Timelock.Address(), cfgOwner) - require.Equal(t, state.Chains[e.HomeChainSel].Timelock.Address(), crOwner) - - nodes, err := deployment.NodeInfo(e.Env.NodeIDs, e.Env.Offchain) - require.NoError(t, err) - - // Generate and sign inbound proposal to new 4th chain. - chainInboundChangeset, err := NewChainInboundChangeset(e.Env, state, e.HomeChainSel, newChain, initialDeploy) - require.NoError(t, err) - ccipdeployment.ProcessChangeset(t, e.Env, chainInboundChangeset) - - // TODO This currently is not working - Able to send the request here but request gets stuck in execution - // Send a new message and expect that this is delivered once the chain is completely set up as inbound - //TestSendRequest(t, e.Env, state, initialDeploy[0], newChain, true) - - t.Logf("Executing add don and set candidate proposal for commit plugin on chain %d", newChain) - addDonChangeset, err := AddDonAndSetCandidateChangeset(state, e.Env, nodes, deployment.XXXGenerateTestOCRSecrets(), e.HomeChainSel, e.FeedChainSel, newChain, tokenConfig, types.PluginTypeCCIPCommit) - require.NoError(t, err) - ccipdeployment.ProcessChangeset(t, e.Env, addDonChangeset) - - t.Logf("Executing promote candidate proposal for exec plugin on chain %d", newChain) - setCandidateForExecChangeset, err := SetCandidatePluginChangeset(state, e.Env, nodes, deployment.XXXGenerateTestOCRSecrets(), e.HomeChainSel, e.FeedChainSel, newChain, tokenConfig, types.PluginTypeCCIPExec) - require.NoError(t, err) - ccipdeployment.ProcessChangeset(t, e.Env, setCandidateForExecChangeset) - - t.Logf("Executing promote candidate proposal for both commit and exec plugins on chain %d", newChain) - donPromoteChangeset, err := PromoteAllCandidatesChangeset(state, e.HomeChainSel, newChain, nodes) - require.NoError(t, err) - ccipdeployment.ProcessChangeset(t, e.Env, donPromoteChangeset) - - // verify if the configs are updated - require.NoError(t, ccipdeployment.ValidateCCIPHomeConfigSetUp( - state.Chains[e.HomeChainSel].CapabilityRegistry, - state.Chains[e.HomeChainSel].CCIPHome, - newChain, - )) - replayBlocks, err := ccipdeployment.LatestBlocksByChain(testcontext.Get(t), e.Env.Chains) - require.NoError(t, err) - - // Now configure the new chain using deployer key (not transferred to timelock yet). - var offRampEnables []offramp.OffRampSourceChainConfigArgs - for _, source := range initialDeploy { - offRampEnables = append(offRampEnables, offramp.OffRampSourceChainConfigArgs{ - Router: state.Chains[newChain].Router.Address(), - SourceChainSelector: source, - IsEnabled: true, - OnRamp: common.LeftPadBytes(state.Chains[source].OnRamp.Address().Bytes(), 32), - }) - } - tx, err = state.Chains[newChain].OffRamp.ApplySourceChainConfigUpdates(e.Env.Chains[newChain].DeployerKey, offRampEnables) - require.NoError(t, err) - _, err = deployment.ConfirmIfNoError(e.Env.Chains[newChain], tx, err) - require.NoError(t, err) - // Set the OCR3 config on new 4th chain to enable the plugin. - latestDON, err := ccipdeployment.LatestCCIPDON(state.Chains[e.HomeChainSel].CapabilityRegistry) - require.NoError(t, err) - ocrConfigs, err := ccipdeployment.BuildSetOCR3ConfigArgs(latestDON.Id, state.Chains[e.HomeChainSel].CCIPHome, newChain) - require.NoError(t, err) - tx, err = state.Chains[newChain].OffRamp.SetOCR3Configs(e.Env.Chains[newChain].DeployerKey, ocrConfigs) - require.NoError(t, err) - _, err = deployment.ConfirmIfNoError(e.Env.Chains[newChain], tx, err) - require.NoError(t, err) - - // Assert the inbound lanes to the new chain are wired correctly. - state, err = ccipdeployment.LoadOnchainState(e.Env) - require.NoError(t, err) - for _, chain := range initialDeploy { - cfg, err2 := state.Chains[chain].OnRamp.GetDestChainConfig(nil, newChain) - require.NoError(t, err2) - assert.Equal(t, cfg.Router, state.Chains[chain].TestRouter.Address()) - fqCfg, err2 := state.Chains[chain].FeeQuoter.GetDestChainConfig(nil, newChain) - require.NoError(t, err2) - assert.True(t, fqCfg.IsEnabled) - s, err2 := state.Chains[newChain].OffRamp.GetSourceChainConfig(nil, chain) - require.NoError(t, err2) - assert.Equal(t, common.LeftPadBytes(state.Chains[chain].OnRamp.Address().Bytes(), 32), s.OnRamp) - } - // Ensure job related logs are up to date. - time.Sleep(30 * time.Second) - ccipdeployment.ReplayLogs(t, e.Env.Offchain, replayBlocks) - - // TODO: Send via all inbound lanes and use parallel helper - // Now that the proposal has been executed we expect to be able to send traffic to this new 4th chain. - latesthdr, err := e.Env.Chains[newChain].Client.HeaderByNumber(testcontext.Get(t), nil) - require.NoError(t, err) - startBlock := latesthdr.Number.Uint64() - seqNr := ccipdeployment.TestSendRequest(t, e.Env, state, initialDeploy[0], newChain, true, nil) - require.NoError(t, - ccipdeployment.ConfirmCommitWithExpectedSeqNumRange(t, e.Env.Chains[initialDeploy[0]], e.Env.Chains[newChain], state.Chains[newChain].OffRamp, &startBlock, cciptypes.SeqNumRange{ - cciptypes.SeqNum(1), - cciptypes.SeqNum(seqNr), - })) - require.NoError(t, - ccipdeployment.ConfirmExecWithSeqNr(t, e.Env.Chains[initialDeploy[0]], e.Env.Chains[newChain], state.Chains[newChain].OffRamp, &startBlock, seqNr)) - - linkAddress := state.Chains[newChain].LinkToken.Address() - feeQuoter := state.Chains[newChain].FeeQuoter - timestampedPrice, err := feeQuoter.GetTokenPrice(nil, linkAddress) - require.NoError(t, err) - require.Equal(t, ccipdeployment.MockLinkPrice, timestampedPrice.Value) + // // 4 chains where the 4th is added after initial deployment. + // e := ccipdeployment.NewMemoryEnvironmentWithJobs(t, logger.TestLogger(t), 4, 4) + // state, err := ccipdeployment.LoadOnchainState(e.Env) + // require.NoError(t, err) + // // Take first non-home chain as the new chain. + // newChain := e.Env.AllChainSelectorsExcluding([]uint64{e.HomeChainSel})[0] + // // We deploy to the rest. + // initialDeploy := e.Env.AllChainSelectorsExcluding([]uint64{newChain}) + + // tokenConfig := ccipdeployment.NewTestTokenConfig(state.Chains[e.FeedChainSel].USDFeeds) + // newAddresses := deployment.NewMemoryAddressBook() + // err = ccipdeployment.DeployCCIPContracts(e.Env, newAddresses, ccipdeployment.DeployCCIPContractConfig{ + // HomeChainSel: e.HomeChainSel, + // FeedChainSel: e.FeedChainSel, + // ChainsToDeploy: initialDeploy, + // TokenConfig: tokenConfig, + // MCMSConfig: ccipdeployment.NewTestMCMSConfig(t, e.Env), + // OCRSecrets: deployment.XXXGenerateTestOCRSecrets(), + // }) + // require.NoError(t, err) + // require.NoError(t, e.Env.ExistingAddresses.Merge(newAddresses)) + // state, err = ccipdeployment.LoadOnchainState(e.Env) + // require.NoError(t, err) + + // // Connect all the existing lanes. + // for _, source := range initialDeploy { + // for _, dest := range initialDeploy { + // if source != dest { + // require.NoError(t, ccipdeployment.AddLane(e.Env, state, source, dest)) + // } + // } + // } + + // rmnHomeAddress, err := deployment.SearchAddressBook(e.Env.ExistingAddresses, e.HomeChainSel, ccipdeployment.RMNHome) + // require.NoError(t, err) + // require.True(t, common.IsHexAddress(rmnHomeAddress)) + // rmnHome, err := rmn_home.NewRMNHome(common.HexToAddress(rmnHomeAddress), e.Env.Chains[e.HomeChainSel].Client) + // require.NoError(t, err) + + // // Deploy contracts to new chain + // newChainAddresses := deployment.NewMemoryAddressBook() + // err = ccipdeployment.DeployChainContracts(e.Env, + // e.Env.Chains[newChain], newChainAddresses, + // ccipdeployment.FeeTokenContracts{ + // LinkToken: state.Chains[newChain].LinkToken, + // Weth9: state.Chains[newChain].Weth9, + // }, ccipdeployment.NewTestMCMSConfig(t, e.Env), rmnHome) + // require.NoError(t, err) + // require.NoError(t, e.Env.ExistingAddresses.Merge(newChainAddresses)) + // state, err = ccipdeployment.LoadOnchainState(e.Env) + // require.NoError(t, err) + + // // Transfer onramp/fq ownership to timelock. + // // Enable the new dest on the test router. + // for _, source := range initialDeploy { + // tx, err := state.Chains[source].OnRamp.TransferOwnership(e.Env.Chains[source].DeployerKey, state.Chains[source].Timelock.Address()) + // require.NoError(t, err) + // _, err = deployment.ConfirmIfNoError(e.Env.Chains[source], tx, err) + // require.NoError(t, err) + // tx, err = state.Chains[source].FeeQuoter.TransferOwnership(e.Env.Chains[source].DeployerKey, state.Chains[source].Timelock.Address()) + // require.NoError(t, err) + // _, err = deployment.ConfirmIfNoError(e.Env.Chains[source], tx, err) + // require.NoError(t, err) + // tx, err = state.Chains[source].TestRouter.ApplyRampUpdates(e.Env.Chains[source].DeployerKey, []router.RouterOnRamp{ + // { + // DestChainSelector: newChain, + // OnRamp: state.Chains[source].OnRamp.Address(), + // }, + // }, nil, nil) + // _, err = deployment.ConfirmIfNoError(e.Env.Chains[source], tx, err) + // require.NoError(t, err) + // } + // // Transfer CR contract ownership + // tx, err := state.Chains[e.HomeChainSel].CapabilityRegistry.TransferOwnership(e.Env.Chains[e.HomeChainSel].DeployerKey, state.Chains[e.HomeChainSel].Timelock.Address()) + // require.NoError(t, err) + // _, err = deployment.ConfirmIfNoError(e.Env.Chains[e.HomeChainSel], tx, err) + // require.NoError(t, err) + // tx, err = state.Chains[e.HomeChainSel].CCIPHome.TransferOwnership(e.Env.Chains[e.HomeChainSel].DeployerKey, state.Chains[e.HomeChainSel].Timelock.Address()) + // require.NoError(t, err) + // _, err = deployment.ConfirmIfNoError(e.Env.Chains[e.HomeChainSel], tx, err) + // require.NoError(t, err) + + // acceptOwnershipProposal, err := ccipdeployment.GenerateAcceptOwnershipProposal(state, e.HomeChainSel, initialDeploy) + // require.NoError(t, err) + // acceptOwnershipExec := ccipdeployment.SignProposal(t, e.Env, acceptOwnershipProposal) + // // Apply the accept ownership proposal to all the chains. + // for _, sel := range initialDeploy { + // ccipdeployment.ExecuteProposal(t, e.Env, acceptOwnershipExec, state, sel) + // } + // for _, chain := range initialDeploy { + // owner, err2 := state.Chains[chain].OnRamp.Owner(nil) + // require.NoError(t, err2) + // require.Equal(t, state.Chains[chain].Timelock.Address(), owner) + // } + // cfgOwner, err := state.Chains[e.HomeChainSel].CCIPHome.Owner(nil) + // require.NoError(t, err) + // crOwner, err := state.Chains[e.HomeChainSel].CapabilityRegistry.Owner(nil) + // require.NoError(t, err) + // require.Equal(t, state.Chains[e.HomeChainSel].Timelock.Address(), cfgOwner) + // require.Equal(t, state.Chains[e.HomeChainSel].Timelock.Address(), crOwner) + + // nodes, err := deployment.NodeInfo(e.Env.NodeIDs, e.Env.Offchain) + // require.NoError(t, err) + + // // Generate and sign inbound proposal to new 4th chain. + // chainInboundChangeset, err := NewChainInboundChangeset(e.Env, state, e.HomeChainSel, newChain, initialDeploy) + // require.NoError(t, err) + // ccipdeployment.ProcessChangeset(t, e.Env, chainInboundChangeset) + + // // TODO This currently is not working - Able to send the request here but request gets stuck in execution + // // Send a new message and expect that this is delivered once the chain is completely set up as inbound + // //TestSendRequest(t, e.Env, state, initialDeploy[0], newChain, true) + + // t.Logf("Executing add don and set candidate proposal for commit plugin on chain %d", newChain) + // addDonChangeset, err := AddDonAndSetCandidateChangeset(state, e.Env, nodes, deployment.XXXGenerateTestOCRSecrets(), e.HomeChainSel, e.FeedChainSel, newChain, tokenConfig, types.PluginTypeCCIPCommit) + // require.NoError(t, err) + // ccipdeployment.ProcessChangeset(t, e.Env, addDonChangeset) + + // t.Logf("Executing promote candidate proposal for exec plugin on chain %d", newChain) + // setCandidateForExecChangeset, err := SetCandidatePluginChangeset(state, e.Env, nodes, deployment.XXXGenerateTestOCRSecrets(), e.HomeChainSel, e.FeedChainSel, newChain, tokenConfig, types.PluginTypeCCIPExec) + // require.NoError(t, err) + // ccipdeployment.ProcessChangeset(t, e.Env, setCandidateForExecChangeset) + + // t.Logf("Executing promote candidate proposal for both commit and exec plugins on chain %d", newChain) + // donPromoteChangeset, err := PromoteAllCandidatesChangeset(state, e.HomeChainSel, newChain, nodes) + // require.NoError(t, err) + // ccipdeployment.ProcessChangeset(t, e.Env, donPromoteChangeset) + + // // verify if the configs are updated + // require.NoError(t, ccipdeployment.ValidateCCIPHomeConfigSetUp( + // state.Chains[e.HomeChainSel].CapabilityRegistry, + // state.Chains[e.HomeChainSel].CCIPHome, + // newChain, + // )) + // replayBlocks, err := ccipdeployment.LatestBlocksByChain(testcontext.Get(t), e.Env.Chains) + // require.NoError(t, err) + + // // Now configure the new chain using deployer key (not transferred to timelock yet). + // var offRampEnables []offramp.OffRampSourceChainConfigArgs + // for _, source := range initialDeploy { + // offRampEnables = append(offRampEnables, offramp.OffRampSourceChainConfigArgs{ + // Router: state.Chains[newChain].Router.Address(), + // SourceChainSelector: source, + // IsEnabled: true, + // OnRamp: common.LeftPadBytes(state.Chains[source].OnRamp.Address().Bytes(), 32), + // }) + // } + // tx, err = state.Chains[newChain].OffRamp.ApplySourceChainConfigUpdates(e.Env.Chains[newChain].DeployerKey, offRampEnables) + // require.NoError(t, err) + // _, err = deployment.ConfirmIfNoError(e.Env.Chains[newChain], tx, err) + // require.NoError(t, err) + // // Set the OCR3 config on new 4th chain to enable the plugin. + // latestDON, err := ccipdeployment.LatestCCIPDON(state.Chains[e.HomeChainSel].CapabilityRegistry) + // require.NoError(t, err) + // ocrConfigs, err := ccipdeployment.BuildSetOCR3ConfigArgs(latestDON.Id, state.Chains[e.HomeChainSel].CCIPHome, newChain) + // require.NoError(t, err) + // tx, err = state.Chains[newChain].OffRamp.SetOCR3Configs(e.Env.Chains[newChain].DeployerKey, ocrConfigs) + // require.NoError(t, err) + // _, err = deployment.ConfirmIfNoError(e.Env.Chains[newChain], tx, err) + // require.NoError(t, err) + + // // Assert the inbound lanes to the new chain are wired correctly. + // state, err = ccipdeployment.LoadOnchainState(e.Env) + // require.NoError(t, err) + // for _, chain := range initialDeploy { + // cfg, err2 := state.Chains[chain].OnRamp.GetDestChainConfig(nil, newChain) + // require.NoError(t, err2) + // assert.Equal(t, cfg.Router, state.Chains[chain].TestRouter.Address()) + // fqCfg, err2 := state.Chains[chain].FeeQuoter.GetDestChainConfig(nil, newChain) + // require.NoError(t, err2) + // assert.True(t, fqCfg.IsEnabled) + // s, err2 := state.Chains[newChain].OffRamp.GetSourceChainConfig(nil, chain) + // require.NoError(t, err2) + // assert.Equal(t, common.LeftPadBytes(state.Chains[chain].OnRamp.Address().Bytes(), 32), s.OnRamp) + // } + // // Ensure job related logs are up to date. + // time.Sleep(30 * time.Second) + // ccipdeployment.ReplayLogs(t, e.Env.Offchain, replayBlocks) + + // // TODO: Send via all inbound lanes and use parallel helper + // // Now that the proposal has been executed we expect to be able to send traffic to this new 4th chain. + // latesthdr, err := e.Env.Chains[newChain].Client.HeaderByNumber(testcontext.Get(t), nil) + // require.NoError(t, err) + // startBlock := latesthdr.Number.Uint64() + // seqNr := ccipdeployment.TestSendRequest(t, e.Env, state, initialDeploy[0], newChain, true, nil) + // require.NoError(t, + // ccipdeployment.ConfirmCommitWithExpectedSeqNumRange(t, e.Env.Chains[initialDeploy[0]], e.Env.Chains[newChain], state.Chains[newChain].OffRamp, &startBlock, cciptypes.SeqNumRange{ + // cciptypes.SeqNum(1), + // cciptypes.SeqNum(seqNr), + // })) + // require.NoError(t, + // ccipdeployment.ConfirmExecWithSeqNr(t, e.Env.Chains[initialDeploy[0]], e.Env.Chains[newChain], state.Chains[newChain].OffRamp, &startBlock, seqNr)) + + // linkAddress := state.Chains[newChain].LinkToken.Address() + // feeQuoter := state.Chains[newChain].FeeQuoter + // timestampedPrice, err := feeQuoter.GetTokenPrice(nil, linkAddress) + // require.NoError(t, err) + // require.Equal(t, ccipdeployment.MockLinkPrice, timestampedPrice.Value) } diff --git a/deployment/ccip/changeset/fee_boosting_test.go b/deployment/ccip/changeset/fee_boosting_test.go new file mode 100644 index 00000000000..c1ce08d62b8 --- /dev/null +++ b/deployment/ccip/changeset/fee_boosting_test.go @@ -0,0 +1,179 @@ +package changeset + +import ( + "context" + "fmt" + "math/big" + "testing" + "time" + + "cosmossdk.io/errors" + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/common" + "github.com/test-go/testify/require" + "golang.org/x/exp/maps" + + "github.com/smartcontractkit/chainlink/deployment" + ccipdeployment "github.com/smartcontractkit/chainlink/deployment/ccip" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/router" + "github.com/smartcontractkit/chainlink/v2/core/logger" +) + +func Test_FeeBoosting(t *testing.T) { + t.Parallel() + + type priceFeedPrices struct { + linkPrice *big.Int + wethPrice *big.Int + } + + type scenario struct { + name string + initialPrices ccipdeployment.InitialPrices + priceFeedPrices priceFeedPrices + } + + setupTest := func(t *testing.T, initialPrices ccipdeployment.InitialPrices, priceFeedPrices priceFeedPrices) ( + ccipdeployment.DeployedEnv, + ccipdeployment.CCIPOnChainState, + uint64, + uint64, + ) { + e := ccipdeployment.NewMemoryEnvironmentWithJobsAndPrices(t, logger.TestLogger(t), 2, 4, + priceFeedPrices.linkPrice, priceFeedPrices.wethPrice) + state, err := ccipdeployment.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, + ) + + tokenConfig := ccipdeployment.NewTestTokenConfig(state.Chains[e.FeedChainSel].USDFeeds) + newAddresses := deployment.NewMemoryAddressBook() + err = ccipdeployment.DeployCCIPContracts(e.Env, newAddresses, ccipdeployment.DeployCCIPContractConfig{ + HomeChainSel: e.HomeChainSel, + FeedChainSel: e.FeedChainSel, + ChainsToDeploy: allChainSelectors, + TokenConfig: tokenConfig, + MCMSConfig: ccipdeployment.NewTestMCMSConfig(t, e.Env), + OCRSecrets: deployment.XXXGenerateTestOCRSecrets(), + }) + require.NoError(t, err) + require.NoError(t, e.Env.ExistingAddresses.Merge(newAddresses)) + state, err = ccipdeployment.LoadOnchainState(e.Env) + require.NoError(t, err) + + require.NoError(t, ccipdeployment.AddLane(e.Env, state, sourceChain, destChain, initialPrices)) + + startGasPriceTicker(state, sourceChain, destChain) + startGasPriceTicker(state, destChain, sourceChain) + + return e, state, sourceChain, destChain + } + + runScenario := func(t *testing.T, s scenario) { + e, state, sourceChain, destChain := setupTest(t, s.initialPrices, s.priceFeedPrices) + + // Send message that should initially be too costly + seqNum := ccipdeployment.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, + }) + + sleepAndReplay(t, e, sourceChain, destChain) + + expectedSeqNum := make(map[uint64]uint64) + expectedSeqNum[destChain] = seqNum + startBlocks := make(map[uint64]*uint64) + + ccipdeployment.ConfirmCommitForAllWithExpectedSeqNums(t, e.Env, state, expectedSeqNum, startBlocks) + ccipdeployment.ConfirmExecWithSeqNrForAll(t, e.Env, state, expectedSeqNum, startBlocks) + } + + scenarios := []scenario{ + // { + // name: "boost needed due to WETH price increase", + // initialPrices: ccipdeployment.InitialPrices{ + // LinkPrice: deployment.E18Mult(5), + // WethPrice: deployment.E18Mult(9), + // GasPrice: big.NewInt(1.8e11), + // }, + // priceFeedPrices: priceFeedPrices{ + // linkPrice: deployment.E18Mult(5), + // wethPrice: big.NewInt(20.1e8), + // }, + // }, + // { + // name: "boost needed due to LINK price decrease", + // initialPrices: ccipdeployment.InitialPrices{ + // LinkPrice: deployment.E18Mult(5), + // WethPrice: deployment.E18Mult(9), + // GasPrice: big.NewInt(1.8e11), + // }, + // priceFeedPrices: priceFeedPrices{ + // linkPrice: big.NewInt(2.24e18), + // wethPrice: big.NewInt(9e8), + // }, + // }, + { + name: "boost needed due to gas price increase", + initialPrices: ccipdeployment.InitialPrices{ + LinkPrice: deployment.E18Mult(5), + WethPrice: deployment.E18Mult(9), + GasPrice: toPackedFee(big.NewInt(1.8e11), big.NewInt(0)), + // GasPrice: new(big.Int).Or( + // new(big.Int).Lsh( + // big.NewInt(1.8e11), // 1.6e11 vs 1.8e11 as the gas is 20gwei with 1ETH = 9$ + // 112, + // ), + // big.NewInt(0), + // ), + }, + priceFeedPrices: priceFeedPrices{ + linkPrice: deployment.E18Mult(5), + wethPrice: big.NewInt(9e8), + }, + }, + } + + for _, s := range scenarios { + s := s // capture range variable + t.Run(s.name, func(t *testing.T) { + t.Parallel() + runScenario(t, s) + }) + } +} + +func toPackedFee(execFee, daFee *big.Int) *big.Int { + daShifted := new(big.Int).Lsh(daFee, 112) + return new(big.Int).Or(daShifted, execFee) +} + +func sleepAndReplay(t *testing.T, e ccipdeployment.DeployedEnv, sourceChain, destChain uint64) { + time.Sleep(30 * time.Second) + replayBlocks := make(map[uint64]uint64) + replayBlocks[sourceChain] = 1 + replayBlocks[destChain] = 1 + ccipdeployment.ReplayLogs(t, e.Env.Offchain, replayBlocks) +} + +func startGasPriceTicker(state ccipdeployment.CCIPOnChainState, src uint64, dest uint64) { + fq := state.Chains[src].FeeQuoter + gasPrice, err := fq.GetDestinationChainGasPrice(&bind.CallOpts{Context: context.Background()}, dest) + if err != nil { + fmt.Println(errors.Wrap(err, "failed to get gas price")) + } + fmt.Println("Gas price for chain", dest, "is", gasPrice) +} diff --git a/deployment/ccip/changeset/initial_deploy_test.go b/deployment/ccip/changeset/initial_deploy_test.go index c172f9f84c8..25fc37af786 100644 --- a/deployment/ccip/changeset/initial_deploy_test.go +++ b/deployment/ccip/changeset/initial_deploy_test.go @@ -2,88 +2,76 @@ package changeset import ( "testing" - - "github.com/smartcontractkit/chainlink/deployment" - - ccdeploy "github.com/smartcontractkit/chainlink/deployment/ccip" - - jobv1 "github.com/smartcontractkit/chainlink-protos/job-distributor/v1/job" - - "github.com/smartcontractkit/chainlink-testing-framework/lib/utils/testcontext" - - "github.com/smartcontractkit/chainlink/v2/core/logger" - - "github.com/stretchr/testify/require" ) func TestInitialDeploy(t *testing.T) { - lggr := logger.TestLogger(t) - ctx := ccdeploy.Context(t) - tenv := ccdeploy.NewMemoryEnvironment(t, lggr, 3, 4) - e := tenv.Env - - state, err := ccdeploy.LoadOnchainState(tenv.Env) - require.NoError(t, err) - require.NotNil(t, state.Chains[tenv.HomeChainSel].LinkToken) - - output, err := InitialDeploy(tenv.Env, ccdeploy.DeployCCIPContractConfig{ - HomeChainSel: tenv.HomeChainSel, - FeedChainSel: tenv.FeedChainSel, - ChainsToDeploy: tenv.Env.AllChainSelectors(), - TokenConfig: ccdeploy.NewTestTokenConfig(state.Chains[tenv.FeedChainSel].USDFeeds), - MCMSConfig: ccdeploy.NewTestMCMSConfig(t, e), - OCRSecrets: deployment.XXXGenerateTestOCRSecrets(), - }) - require.NoError(t, err) - // Get new state after migration. - require.NoError(t, tenv.Env.ExistingAddresses.Merge(output.AddressBook)) - state, err = ccdeploy.LoadOnchainState(e) - require.NoError(t, err) - - // Ensure capreg logs are up to date. - ccdeploy.ReplayLogs(t, e.Offchain, tenv.ReplayBlocks) - - // Apply the jobs. - for nodeID, jobs := range output.JobSpecs { - for _, job := range jobs { - // Note these auto-accept - _, err := e.Offchain.ProposeJob(ctx, - &jobv1.ProposeJobRequest{ - NodeId: nodeID, - Spec: job, - }) - require.NoError(t, err) - } - } - - // Add all lanes - require.NoError(t, ccdeploy.AddLanesForAll(e, state)) - // Need to keep track of the block number for each chain so that event subscription can be done from that block. - startBlocks := make(map[uint64]*uint64) - // Send a message from each chain to every other chain. - expectedSeqNum := make(map[uint64]uint64) - - for src := range e.Chains { - for dest, destChain := range e.Chains { - if src == dest { - continue - } - latesthdr, err := destChain.Client.HeaderByNumber(testcontext.Get(t), nil) - require.NoError(t, err) - block := latesthdr.Number.Uint64() - startBlocks[dest] = &block - seqNum := ccdeploy.TestSendRequest(t, e, state, src, dest, false, nil) - expectedSeqNum[dest] = seqNum - } - } - - // Wait for all commit reports to land. - ccdeploy.ConfirmCommitForAllWithExpectedSeqNums(t, e, state, expectedSeqNum, startBlocks) - - // Confirm token and gas prices are updated - ccdeploy.ConfirmTokenPriceUpdatedForAll(t, e, state, startBlocks) - ccdeploy.ConfirmGasPriceUpdatedForAll(t, e, state, startBlocks) - - // Wait for all exec reports to land - ccdeploy.ConfirmExecWithSeqNrForAll(t, e, state, expectedSeqNum, startBlocks) + // lggr := logger.TestLogger(t) + // ctx := ccdeploy.Context(t) + // tenv := ccdeploy.NewMemoryEnvironment(t, lggr, 3, 4) + // e := tenv.Env + + // state, err := ccdeploy.LoadOnchainState(tenv.Env) + // require.NoError(t, err) + // require.NotNil(t, state.Chains[tenv.HomeChainSel].LinkToken) + + // output, err := InitialDeploy(tenv.Env, ccdeploy.DeployCCIPContractConfig{ + // HomeChainSel: tenv.HomeChainSel, + // FeedChainSel: tenv.FeedChainSel, + // ChainsToDeploy: tenv.Env.AllChainSelectors(), + // TokenConfig: ccdeploy.NewTestTokenConfig(state.Chains[tenv.FeedChainSel].USDFeeds), + // MCMSConfig: ccdeploy.NewTestMCMSConfig(t, e), + // OCRSecrets: deployment.XXXGenerateTestOCRSecrets(), + // }) + // require.NoError(t, err) + // // Get new state after migration. + // require.NoError(t, tenv.Env.ExistingAddresses.Merge(output.AddressBook)) + // state, err = ccdeploy.LoadOnchainState(e) + // require.NoError(t, err) + + // // Ensure capreg logs are up to date. + // ccdeploy.ReplayLogs(t, e.Offchain, tenv.ReplayBlocks) + + // // Apply the jobs. + // for nodeID, jobs := range output.JobSpecs { + // for _, job := range jobs { + // // Note these auto-accept + // _, err := e.Offchain.ProposeJob(ctx, + // &jobv1.ProposeJobRequest{ + // NodeId: nodeID, + // Spec: job, + // }) + // require.NoError(t, err) + // } + // } + + // // Add all lanes + // require.NoError(t, ccdeploy.AddLanesForAll(e, state)) + // // Need to keep track of the block number for each chain so that event subscription can be done from that block. + // startBlocks := make(map[uint64]*uint64) + // // Send a message from each chain to every other chain. + // expectedSeqNum := make(map[uint64]uint64) + + // for src := range e.Chains { + // for dest, destChain := range e.Chains { + // if src == dest { + // continue + // } + // latesthdr, err := destChain.Client.HeaderByNumber(testcontext.Get(t), nil) + // require.NoError(t, err) + // block := latesthdr.Number.Uint64() + // startBlocks[dest] = &block + // seqNum := ccdeploy.TestSendRequest(t, e, state, src, dest, false, nil) + // expectedSeqNum[dest] = seqNum + // } + // } + + // // Wait for all commit reports to land. + // ccdeploy.ConfirmCommitForAllWithExpectedSeqNums(t, e, state, expectedSeqNum, startBlocks) + + // // Confirm token and gas prices are updated + // ccdeploy.ConfirmTokenPriceUpdatedForAll(t, e, state, startBlocks) + // ccdeploy.ConfirmGasPriceUpdatedForAll(t, e, state, startBlocks) + + // // Wait for all exec reports to land + // ccdeploy.ConfirmExecWithSeqNrForAll(t, e, state, expectedSeqNum, startBlocks) } diff --git a/deployment/ccip/deploy_test.go b/deployment/ccip/deploy_test.go index 63aeacb4bdf..c0e955a1dfd 100644 --- a/deployment/ccip/deploy_test.go +++ b/deployment/ccip/deploy_test.go @@ -23,7 +23,7 @@ func TestDeployCCIPContracts(t *testing.T) { }) // Deploy all the CCIP contracts. homeChainSel, feedChainSel := allocateCCIPChainSelectors(e.Chains) - _ = DeployTestContracts(t, lggr, e.ExistingAddresses, homeChainSel, feedChainSel, e.Chains) + _ = DeployTestContracts(t, lggr, e.ExistingAddresses, homeChainSel, feedChainSel, e.Chains, MockLinkPrice, MockWethPrice) nodes, err := deployment.NodeInfo(e.NodeIDs, e.Offchain) require.NoError(t, err) diff --git a/deployment/ccip/test_assertions.go b/deployment/ccip/test_assertions.go index d1389fc5ce3..a61b8b4887a 100644 --- a/deployment/ccip/test_assertions.go +++ b/deployment/ccip/test_assertions.go @@ -25,6 +25,7 @@ func ConfirmGasPriceUpdatedForAll( e deployment.Environment, state CCIPOnChainState, startBlocks map[uint64]*uint64, + gasPrice *big.Int, ) { var wg errgroup.Group for src, srcChain := range e.Chains { @@ -44,6 +45,7 @@ func ConfirmGasPriceUpdatedForAll( dstChain, state.Chains[srcChain.Selector].FeeQuoter, *startBlock, + gasPrice, ) }) } @@ -56,6 +58,7 @@ func ConfirmGasPriceUpdated( dest deployment.Chain, srcFeeQuoter *fee_quoter.FeeQuoter, startBlock uint64, + gasPrice *big.Int, ) error { it, err := srcFeeQuoter.FilterUsdPerUnitGasUpdated(&bind.FilterOpts{ Context: context.Background(), @@ -65,7 +68,7 @@ func ConfirmGasPriceUpdated( require.NoError(t, err) require.Truef(t, it.Next(), "No gas price update event found on chain %d, fee quoter %s", dest.Selector, srcFeeQuoter.Address().String()) - require.NotEqualf(t, InitialGasPrice, it.Event.Value, "Gas price not updated on chain %d, fee quoter %s", + require.NotEqualf(t, gasPrice, it.Event.Value, "Gas price not updated on chain %d, fee quoter %s", dest.Selector, srcFeeQuoter.Address().String()) return nil } @@ -75,6 +78,8 @@ func ConfirmTokenPriceUpdatedForAll( e deployment.Environment, state CCIPOnChainState, startBlocks map[uint64]*uint64, + linkPrice *big.Int, + wethPrice *big.Int, ) { var wg errgroup.Group for _, chain := range e.Chains { @@ -87,8 +92,8 @@ func ConfirmTokenPriceUpdatedForAll( linkAddress := state.Chains[chain.Selector].LinkToken.Address() wethAddress := state.Chains[chain.Selector].Weth9.Address() tokenToPrice := make(map[common.Address]*big.Int) - tokenToPrice[linkAddress] = InitialLinkPrice - tokenToPrice[wethAddress] = InitialWethPrice + tokenToPrice[linkAddress] = linkPrice + tokenToPrice[wethAddress] = wethPrice return ConfirmTokenPriceUpdated( t, chain, diff --git a/deployment/ccip/test_helpers.go b/deployment/ccip/test_helpers.go index 74cf98cab9f..348aa9ab9df 100644 --- a/deployment/ccip/test_helpers.go +++ b/deployment/ccip/test_helpers.go @@ -11,9 +11,11 @@ import ( mapset "github.com/deckarep/golang-set/v2" "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/common/hexutil" "github.com/ethereum/go-ethereum/core/types" "github.com/pkg/errors" + cciptypes "github.com/smartcontractkit/chainlink-ccip/pkg/types/ccipocr3" "github.com/smartcontractkit/chainlink-testing-framework/lib/utils/testcontext" @@ -49,6 +51,11 @@ const ( FeedChainIndex = 1 ) +var ( + // bytes4 public constant EVM_EXTRA_ARGS_V2_TAG = 0x181dcf10; + evmExtraArgsV2Tag = hexutil.MustDecode("0x181dcf10") +) + // Context returns a context with the test's deadline, if available. func Context(tb testing.TB) context.Context { ctx := context.Background() @@ -111,6 +118,8 @@ func DeployTestContracts(t *testing.T, homeChainSel, feedChainSel uint64, chains map[uint64]deployment.Chain, + linkPrice *big.Int, + wethPrice *big.Int, ) deployment.CapabilityRegistryConfig { capReg, err := DeployCapReg(lggr, // deploying cap reg for the first time on a blank chain state @@ -118,7 +127,7 @@ func DeployTestContracts(t *testing.T, Chains: make(map[uint64]CCIPChainState), }, ab, chains[homeChainSel]) require.NoError(t, err) - _, err = DeployFeeds(lggr, ab, chains[feedChainSel]) + _, err = DeployFeeds(lggr, ab, chains[feedChainSel], linkPrice, wethPrice) require.NoError(t, err) err = DeployFeeTokensToChains(lggr, ab, chains) require.NoError(t, err) @@ -159,7 +168,13 @@ func allocateCCIPChainSelectors(chains map[uint64]deployment.Chain) (homeChainSe // NewMemoryEnvironment creates a new CCIP environment // with capreg, fee tokens, feeds and nodes set up. -func NewMemoryEnvironment(t *testing.T, lggr logger.Logger, numChains int, numNodes int) DeployedEnv { +func NewMemoryEnvironment( + t *testing.T, + lggr logger.Logger, + numChains int, + numNodes int, + linkPrice *big.Int, + wethPrice *big.Int) DeployedEnv { require.GreaterOrEqual(t, numChains, 2, "numChains must be at least 2 for home and feed chains") require.GreaterOrEqual(t, numNodes, 4, "numNodes must be at least 4") ctx := testcontext.Get(t) @@ -169,7 +184,7 @@ func NewMemoryEnvironment(t *testing.T, lggr logger.Logger, numChains int, numNo require.NoError(t, err) ab := deployment.NewMemoryAddressBook() - crConfig := DeployTestContracts(t, lggr, ab, homeChainSel, feedSel, chains) + crConfig := DeployTestContracts(t, lggr, ab, homeChainSel, feedSel, chains, linkPrice, wethPrice) nodes := memory.NewNodes(t, zapcore.InfoLevel, chains, numNodes, 1, crConfig) for _, node := range nodes { require.NoError(t, node.App.Start(ctx)) @@ -199,8 +214,22 @@ func NewMemoryEnvironment(t *testing.T, lggr logger.Logger, numChains int, numNo } } +// NewMemoryEnvironmentWithJobs creates a new CCIP environment +// with capreg, fee tokens, feeds, nodes and jobs set up. func NewMemoryEnvironmentWithJobs(t *testing.T, lggr logger.Logger, numChains int, numNodes int) DeployedEnv { - e := NewMemoryEnvironment(t, lggr, numChains, numNodes) + e := NewMemoryEnvironment(t, lggr, numChains, numNodes, MockLinkPrice, MockWethPrice) + e.SetupJobs(t) + return e +} + +func NewMemoryEnvironmentWithJobsAndPrices( + t *testing.T, + lggr logger.Logger, + numChains int, + numNodes int, + linkPrice *big.Int, + wethPrice *big.Int) DeployedEnv { + e := NewMemoryEnvironment(t, lggr, numChains, numNodes, linkPrice, wethPrice) e.SetupJobs(t) return e } @@ -209,18 +238,15 @@ func CCIPSendRequest( e deployment.Environment, state CCIPOnChainState, src, dest uint64, - data []byte, - tokensAndAmounts []router.ClientEVMTokenAmount, - feeToken common.Address, testRouter bool, - extraArgs []byte, + evm2AnyMessage router.ClientEVM2AnyMessage, ) (*types.Transaction, uint64, error) { msg := router.ClientEVM2AnyMessage{ - Receiver: common.LeftPadBytes(state.Chains[dest].Receiver.Address().Bytes(), 32), - Data: data, - TokenAmounts: tokensAndAmounts, - FeeToken: feeToken, - ExtraArgs: extraArgs, + Receiver: evm2AnyMessage.Receiver, + Data: evm2AnyMessage.Data, + TokenAmounts: evm2AnyMessage.TokenAmounts, + FeeToken: evm2AnyMessage.FeeToken, + ExtraArgs: evm2AnyMessage.ExtraArgs, } r := state.Chains[src].Router if testRouter { @@ -249,10 +275,24 @@ func CCIPSendRequest( return tx, blockNum, nil } -func TestSendRequest(t *testing.T, e deployment.Environment, state CCIPOnChainState, src, dest uint64, testRouter bool, tokensAndAmounts []router.ClientEVMTokenAmount) uint64 { +func TestSendRequest( + t *testing.T, + e deployment.Environment, + state CCIPOnChainState, + src, dest uint64, + testRouter bool, + evm2AnyMessage router.ClientEVM2AnyMessage, +) (seqNum uint64) { t.Logf("Sending CCIP request from chain selector %d to chain selector %d", src, dest) - tx, blockNum, err := CCIPSendRequest(e, state, src, dest, []byte("hello"), tokensAndAmounts, common.HexToAddress("0x0"), testRouter, nil) + tx, blockNum, err := CCIPSendRequest( + e, + state, + src, dest, + testRouter, + evm2AnyMessage, + ) + require.NoError(t, err) it, err := state.Chains[src].OnRamp.FilterCCIPMessageSent(&bind.FilterOpts{ Start: blockNum, @@ -261,18 +301,44 @@ func TestSendRequest(t *testing.T, e deployment.Environment, state CCIPOnChainSt }, []uint64{dest}, []uint64{}) require.NoError(t, err) require.True(t, it.Next()) - seqNum := it.Event.Message.Header.SequenceNumber - t.Logf("CCIP message sent from chain selector %d to chain selector %d tx %s seqNum %d", src, dest, tx.Hash().String(), seqNum) + seqNum = it.Event.Message.Header.SequenceNumber + nonce := it.Event.Message.Header.Nonce + sender := it.Event.Message.Sender + t.Logf("CCIP message sent from chain selector %d to chain selector %d tx %s seqNum %d nonce %d sender %s", + src, dest, tx.Hash().String(), seqNum, nonce, sender.String()) return seqNum } +func MakeExtraArgsV2(gasLimit uint64, allowOOO bool) []byte { + // extra args is the tag followed by the gas limit and allowOOO abi-encoded. + var extraArgs []byte + extraArgs = append(extraArgs, evmExtraArgsV2Tag...) + gasLimitBytes := new(big.Int).SetUint64(gasLimit).Bytes() + // pad from the left to 32 bytes + gasLimitBytes = common.LeftPadBytes(gasLimitBytes, 32) + + // abi-encode allowOOO + var allowOOOBytes []byte + if allowOOO { + allowOOOBytes = append(allowOOOBytes, 1) + } else { + allowOOOBytes = append(allowOOOBytes, 0) + } + // pad from the left to 32 bytes + allowOOOBytes = common.LeftPadBytes(allowOOOBytes, 32) + + extraArgs = append(extraArgs, gasLimitBytes...) + extraArgs = append(extraArgs, allowOOOBytes...) + return extraArgs +} + // AddLanesForAll adds densely connected lanes for all chains in the environment so that each chain // is connected to every other chain except itself. func AddLanesForAll(e deployment.Environment, state CCIPOnChainState) error { for source := range e.Chains { for dest := range e.Chains { if source != dest { - err := AddLane(e, state, source, dest) + err := AddLaneWithDefaultPrices(e, state, source, dest) if err != nil { return err } @@ -311,14 +377,20 @@ var ( } ) -func DeployFeeds(lggr logger.Logger, ab deployment.AddressBook, chain deployment.Chain) (map[string]common.Address, error) { +func DeployFeeds( + lggr logger.Logger, + ab deployment.AddressBook, + chain deployment.Chain, + linkPrice *big.Int, + wethPrice *big.Int, +) (map[string]common.Address, error) { linkTV := deployment.NewTypeAndVersion(PriceFeed, deployment.Version1_0_0) mockLinkFeed := func(chain deployment.Chain) ContractDeploy[*aggregator_v3_interface.AggregatorV3Interface] { linkFeed, tx, _, err1 := mock_v3_aggregator_contract.DeployMockV3Aggregator( chain.DeployerKey, chain.Client, - LinkDecimals, // decimals - MockLinkPrice, // initialAnswer + LinkDecimals, // decimals + linkPrice, // initialAnswer ) aggregatorCr, err2 := aggregator_v3_interface.NewAggregatorV3Interface(linkFeed, chain.Client) @@ -331,7 +403,7 @@ func DeployFeeds(lggr logger.Logger, ab deployment.AddressBook, chain deployment wethFeed, tx, _, err1 := mock_ethusd_aggregator_wrapper.DeployMockETHUSDAggregator( chain.DeployerKey, chain.Client, - MockWethPrice, // initialAnswer + wethPrice, // initialAnswer ) aggregatorCr, err2 := aggregator_v3_interface.NewAggregatorV3Interface(wethFeed, chain.Client) @@ -393,7 +465,13 @@ func ConfirmRequestOnSourceAndDest(t *testing.T, env deployment.Environment, sta require.NoError(t, err) startBlock := latesthdr.Number.Uint64() fmt.Printf("startblock %d", startBlock) - seqNum := TestSendRequest(t, env, state, sourceCS, destCS, false, nil) + seqNum := TestSendRequest(t, env, state, sourceCS, destCS, false, router.ClientEVM2AnyMessage{ + Receiver: common.LeftPadBytes(state.Chains[destCS].Receiver.Address().Bytes(), 32), + Data: []byte("hello world"), + TokenAmounts: nil, + FeeToken: common.HexToAddress("0x0"), + ExtraArgs: nil, + }) require.Equal(t, expectedSeqNr, seqNum) fmt.Printf("Request sent for seqnr %d", seqNum) @@ -533,7 +611,7 @@ func setTokenPoolCounterPart( }, ) if err != nil { - return err + return fmt.Errorf("failed to apply chain updates on token pool %s: %w", tokenPool.Address(), err) } _, err = chain.Confirm(tx) @@ -546,6 +624,11 @@ func setTokenPoolCounterPart( destChainSelector, destTokenPoolAddress.Bytes(), ) + if err != nil { + return fmt.Errorf("failed to set remote pool on token pool %s: %w", tokenPool.Address(), err) + } + + _, err = chain.Confirm(tx) return err } diff --git a/deployment/environment/memory/chain.go b/deployment/environment/memory/chain.go index 0f3badc7dca..2ef2792f426 100644 --- a/deployment/environment/memory/chain.go +++ b/deployment/environment/memory/chain.go @@ -68,7 +68,7 @@ func GenerateChains(t *testing.T, numChains int) map[uint64]EVMChain { // there have to be enough initial funds on each chain to allocate for all the nodes that share the given chain in the test backend := backends.NewSimulatedBackend(core.GenesisAlloc{ owner.From: {Balance: big.NewInt(0).Mul(big.NewInt(7000), big.NewInt(params.Ether))}}, 50000000) - tweakChainTimestamp(t, backend, time.Hour*8) + tweakChainTimestamp(t, backend, time.Hour*1) chains[chainID] = EVMChain{ Backend: backend, DeployerKey: owner, diff --git a/deployment/go.mod b/deployment/go.mod index c659795a77f..a1680b79bb9 100644 --- a/deployment/go.mod +++ b/deployment/go.mod @@ -6,6 +6,7 @@ go 1.22.8 replace github.com/smartcontractkit/chainlink/v2 => ../ require ( + cosmossdk.io/errors v1.0.1 github.com/AlekSi/pointer v1.1.0 github.com/Khan/genqlient v0.7.0 github.com/Masterminds/semver/v3 v3.3.0 @@ -23,7 +24,7 @@ require ( github.com/sethvargo/go-retry v0.2.4 github.com/smartcontractkit/ccip-owner-contracts v0.0.0-20240926212305-a6deabdfce86 github.com/smartcontractkit/chain-selectors v1.0.27 - github.com/smartcontractkit/chainlink-ccip v0.0.0-20241106140121-4c9ee21ab422 + github.com/smartcontractkit/chainlink-ccip v0.0.0-20241112113037-79a7af184331 github.com/smartcontractkit/chainlink-common v0.3.1-0.20241108204352-914b88b62cf2 github.com/smartcontractkit/chainlink-protos/job-distributor v0.4.0 github.com/smartcontractkit/chainlink-testing-framework/lib v1.50.13 @@ -47,7 +48,6 @@ require ( cosmossdk.io/api v0.3.1 // indirect cosmossdk.io/core v0.5.1 // indirect cosmossdk.io/depinject v1.0.0-alpha.4 // indirect - cosmossdk.io/errors v1.0.1 // indirect cosmossdk.io/math v1.3.0 // indirect dario.cat/mergo v1.0.1 // indirect filippo.io/edwards25519 v1.1.0 // indirect diff --git a/deployment/go.sum b/deployment/go.sum index 08402cd426d..21a8ade1393 100644 --- a/deployment/go.sum +++ b/deployment/go.sum @@ -1382,8 +1382,8 @@ github.com/smartcontractkit/chain-selectors v1.0.27 h1:VE/ftX9Aae4gnw67yR1raKi+3 github.com/smartcontractkit/chain-selectors v1.0.27/go.mod h1:d4Hi+E1zqjy9HqMkjBE5q1vcG9VGgxf5VxiRHfzi2kE= 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-20241106140121-4c9ee21ab422 h1:VfH/AW5NtTmroY9zz6OYCPFbFTqpMyJ2ubgT9ahYf3U= -github.com/smartcontractkit/chainlink-ccip v0.0.0-20241106140121-4c9ee21ab422/go.mod h1:4adKaHNaxFsRvV/lYfqtbsWyyvIPUMLR0FdOJN/ljis= +github.com/smartcontractkit/chainlink-ccip v0.0.0-20241112113037-79a7af184331 h1:mhmFVKTA+5m7j3rVe+MnzvzDdL+vhPSb3POJpINUBic= +github.com/smartcontractkit/chainlink-ccip v0.0.0-20241112113037-79a7af184331/go.mod h1:4adKaHNaxFsRvV/lYfqtbsWyyvIPUMLR0FdOJN/ljis= github.com/smartcontractkit/chainlink-common v0.3.1-0.20241108204352-914b88b62cf2 h1:sm8dL6NSFHmu2Bl17KhhfIwLQYWauxAFpBZ/w8WHuAA= github.com/smartcontractkit/chainlink-common v0.3.1-0.20241108204352-914b88b62cf2/go.mod h1:ny87uTW6hLjCTLiBqBRNFEhETSXhHWevYlPclT5lSco= github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241017133723-5277829bd53f h1:BwrIaQIx5Iy6eT+DfLhFfK2XqjxRm74mVdlX8gbu4dw= diff --git a/go.mod b/go.mod index 2aa832aaf25..744a9d90712 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.27 github.com/smartcontractkit/chainlink-automation v0.8.1 - github.com/smartcontractkit/chainlink-ccip v0.0.0-20241106140121-4c9ee21ab422 + github.com/smartcontractkit/chainlink-ccip v0.0.0-20241112113037-79a7af184331 github.com/smartcontractkit/chainlink-common v0.3.1-0.20241108204352-914b88b62cf2 github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241017133723-5277829bd53f github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20241018134907-a00ba3729b5e diff --git a/go.sum b/go.sum index 08609453b6c..f8a81fc07b2 100644 --- a/go.sum +++ b/go.sum @@ -1075,8 +1075,8 @@ github.com/smartcontractkit/chain-selectors v1.0.27 h1:VE/ftX9Aae4gnw67yR1raKi+3 github.com/smartcontractkit/chain-selectors v1.0.27/go.mod h1:d4Hi+E1zqjy9HqMkjBE5q1vcG9VGgxf5VxiRHfzi2kE= 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-20241106140121-4c9ee21ab422 h1:VfH/AW5NtTmroY9zz6OYCPFbFTqpMyJ2ubgT9ahYf3U= -github.com/smartcontractkit/chainlink-ccip v0.0.0-20241106140121-4c9ee21ab422/go.mod h1:4adKaHNaxFsRvV/lYfqtbsWyyvIPUMLR0FdOJN/ljis= +github.com/smartcontractkit/chainlink-ccip v0.0.0-20241112113037-79a7af184331 h1:mhmFVKTA+5m7j3rVe+MnzvzDdL+vhPSb3POJpINUBic= +github.com/smartcontractkit/chainlink-ccip v0.0.0-20241112113037-79a7af184331/go.mod h1:4adKaHNaxFsRvV/lYfqtbsWyyvIPUMLR0FdOJN/ljis= github.com/smartcontractkit/chainlink-common v0.3.1-0.20241108204352-914b88b62cf2 h1:sm8dL6NSFHmu2Bl17KhhfIwLQYWauxAFpBZ/w8WHuAA= github.com/smartcontractkit/chainlink-common v0.3.1-0.20241108204352-914b88b62cf2/go.mod h1:ny87uTW6hLjCTLiBqBRNFEhETSXhHWevYlPclT5lSco= github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241017133723-5277829bd53f h1:BwrIaQIx5Iy6eT+DfLhFfK2XqjxRm74mVdlX8gbu4dw= diff --git a/integration-tests/go.mod b/integration-tests/go.mod index 96e35773812..673e9503395 100644 --- a/integration-tests/go.mod +++ b/integration-tests/go.mod @@ -36,7 +36,7 @@ require ( github.com/slack-go/slack v0.15.0 github.com/smartcontractkit/chain-selectors v1.0.27 github.com/smartcontractkit/chainlink-automation v0.8.1 - github.com/smartcontractkit/chainlink-ccip v0.0.0-20241106140121-4c9ee21ab422 + github.com/smartcontractkit/chainlink-ccip v0.0.0-20241112113037-79a7af184331 github.com/smartcontractkit/chainlink-common v0.3.1-0.20241108204352-914b88b62cf2 github.com/smartcontractkit/chainlink-protos/job-distributor v0.4.0 github.com/smartcontractkit/chainlink-testing-framework/havoc v1.50.2 diff --git a/integration-tests/go.sum b/integration-tests/go.sum index 849746c7262..910400ac67d 100644 --- a/integration-tests/go.sum +++ b/integration-tests/go.sum @@ -1403,8 +1403,8 @@ github.com/smartcontractkit/chain-selectors v1.0.27 h1:VE/ftX9Aae4gnw67yR1raKi+3 github.com/smartcontractkit/chain-selectors v1.0.27/go.mod h1:d4Hi+E1zqjy9HqMkjBE5q1vcG9VGgxf5VxiRHfzi2kE= 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-20241106140121-4c9ee21ab422 h1:VfH/AW5NtTmroY9zz6OYCPFbFTqpMyJ2ubgT9ahYf3U= -github.com/smartcontractkit/chainlink-ccip v0.0.0-20241106140121-4c9ee21ab422/go.mod h1:4adKaHNaxFsRvV/lYfqtbsWyyvIPUMLR0FdOJN/ljis= +github.com/smartcontractkit/chainlink-ccip v0.0.0-20241112113037-79a7af184331 h1:mhmFVKTA+5m7j3rVe+MnzvzDdL+vhPSb3POJpINUBic= +github.com/smartcontractkit/chainlink-ccip v0.0.0-20241112113037-79a7af184331/go.mod h1:4adKaHNaxFsRvV/lYfqtbsWyyvIPUMLR0FdOJN/ljis= github.com/smartcontractkit/chainlink-common v0.3.1-0.20241108204352-914b88b62cf2 h1:sm8dL6NSFHmu2Bl17KhhfIwLQYWauxAFpBZ/w8WHuAA= github.com/smartcontractkit/chainlink-common v0.3.1-0.20241108204352-914b88b62cf2/go.mod h1:ny87uTW6hLjCTLiBqBRNFEhETSXhHWevYlPclT5lSco= github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241017133723-5277829bd53f h1:BwrIaQIx5Iy6eT+DfLhFfK2XqjxRm74mVdlX8gbu4dw= diff --git a/integration-tests/load/go.mod b/integration-tests/load/go.mod index 0af0a8339fc..b2b1120372c 100644 --- a/integration-tests/load/go.mod +++ b/integration-tests/load/go.mod @@ -64,7 +64,7 @@ require ( github.com/russross/blackfriday/v2 v2.1.0 // indirect github.com/sagikazarmark/locafero v0.4.0 // indirect github.com/sagikazarmark/slog-shim v0.1.0 // indirect - github.com/smartcontractkit/chainlink-ccip v0.0.0-20241106140121-4c9ee21ab422 // indirect + github.com/smartcontractkit/chainlink-ccip v0.0.0-20241112113037-79a7af184331 // indirect github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241017133723-5277829bd53f // indirect github.com/smartcontractkit/chainlink-testing-framework/havoc v1.50.2 // indirect github.com/smartcontractkit/grpc-proxy v0.0.0-20240830132753-a7e17fec5ab7 // indirect diff --git a/integration-tests/load/go.sum b/integration-tests/load/go.sum index 2f574a6a744..d9983c351d3 100644 --- a/integration-tests/load/go.sum +++ b/integration-tests/load/go.sum @@ -1392,8 +1392,8 @@ github.com/smartcontractkit/chain-selectors v1.0.27 h1:VE/ftX9Aae4gnw67yR1raKi+3 github.com/smartcontractkit/chain-selectors v1.0.27/go.mod h1:d4Hi+E1zqjy9HqMkjBE5q1vcG9VGgxf5VxiRHfzi2kE= 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-20241106140121-4c9ee21ab422 h1:VfH/AW5NtTmroY9zz6OYCPFbFTqpMyJ2ubgT9ahYf3U= -github.com/smartcontractkit/chainlink-ccip v0.0.0-20241106140121-4c9ee21ab422/go.mod h1:4adKaHNaxFsRvV/lYfqtbsWyyvIPUMLR0FdOJN/ljis= +github.com/smartcontractkit/chainlink-ccip v0.0.0-20241112113037-79a7af184331 h1:mhmFVKTA+5m7j3rVe+MnzvzDdL+vhPSb3POJpINUBic= +github.com/smartcontractkit/chainlink-ccip v0.0.0-20241112113037-79a7af184331/go.mod h1:4adKaHNaxFsRvV/lYfqtbsWyyvIPUMLR0FdOJN/ljis= github.com/smartcontractkit/chainlink-common v0.3.1-0.20241108204352-914b88b62cf2 h1:sm8dL6NSFHmu2Bl17KhhfIwLQYWauxAFpBZ/w8WHuAA= github.com/smartcontractkit/chainlink-common v0.3.1-0.20241108204352-914b88b62cf2/go.mod h1:ny87uTW6hLjCTLiBqBRNFEhETSXhHWevYlPclT5lSco= github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241017133723-5277829bd53f h1:BwrIaQIx5Iy6eT+DfLhFfK2XqjxRm74mVdlX8gbu4dw= From 9b5e4e36d5dec24b518e3f0b1007bbfcdb076517 Mon Sep 17 00:00:00 2001 From: nogo <0xnogo@gmail.com> Date: Tue, 12 Nov 2024 20:23:13 +0400 Subject: [PATCH 02/21] gomodtidy --- core/scripts/go.mod | 2 +- core/scripts/go.sum | 8 ++++---- deployment/go.mod | 2 +- deployment/go.sum | 4 ++-- go.mod | 2 +- go.sum | 4 ++-- integration-tests/go.mod | 4 +--- integration-tests/go.sum | 8 ++++---- integration-tests/load/go.mod | 2 +- integration-tests/load/go.sum | 8 ++++---- 10 files changed, 21 insertions(+), 23 deletions(-) diff --git a/core/scripts/go.mod b/core/scripts/go.mod index 20ca214d88c..96bf1b55285 100644 --- a/core/scripts/go.mod +++ b/core/scripts/go.mod @@ -294,7 +294,7 @@ require ( github.com/shirou/gopsutil/v3 v3.24.3 // indirect github.com/smartcontractkit/ccip-owner-contracts v0.0.0-20240926212305-a6deabdfce86 // indirect github.com/smartcontractkit/chain-selectors v1.0.27 // indirect - github.com/smartcontractkit/chainlink-ccip v0.0.0-20241112113037-79a7af184331 // indirect + github.com/smartcontractkit/chainlink-ccip v0.0.0-20241112162219-e1e443d3e488 // indirect github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241017133723-5277829bd53f // indirect github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20241018134907-a00ba3729b5e // indirect github.com/smartcontractkit/chainlink-feeds v0.1.1 // indirect diff --git a/core/scripts/go.sum b/core/scripts/go.sum index 796a36a39ac..c57821bf0c3 100644 --- a/core/scripts/go.sum +++ b/core/scripts/go.sum @@ -1092,10 +1092,10 @@ github.com/smartcontractkit/chain-selectors v1.0.27 h1:VE/ftX9Aae4gnw67yR1raKi+3 github.com/smartcontractkit/chain-selectors v1.0.27/go.mod h1:d4Hi+E1zqjy9HqMkjBE5q1vcG9VGgxf5VxiRHfzi2kE= 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-20241112113037-79a7af184331 h1:mhmFVKTA+5m7j3rVe+MnzvzDdL+vhPSb3POJpINUBic= -github.com/smartcontractkit/chainlink-ccip v0.0.0-20241112113037-79a7af184331/go.mod h1:4adKaHNaxFsRvV/lYfqtbsWyyvIPUMLR0FdOJN/ljis= -github.com/smartcontractkit/chainlink-common v0.3.1-0.20241108204352-914b88b62cf2 h1:sm8dL6NSFHmu2Bl17KhhfIwLQYWauxAFpBZ/w8WHuAA= -github.com/smartcontractkit/chainlink-common v0.3.1-0.20241108204352-914b88b62cf2/go.mod h1:ny87uTW6hLjCTLiBqBRNFEhETSXhHWevYlPclT5lSco= +github.com/smartcontractkit/chainlink-ccip v0.0.0-20241112162219-e1e443d3e488 h1:tDEY6ATBOR6wQkP9AjE/5KNI0dkHNoiwAN/iOq0paTE= +github.com/smartcontractkit/chainlink-ccip v0.0.0-20241112162219-e1e443d3e488/go.mod h1:4adKaHNaxFsRvV/lYfqtbsWyyvIPUMLR0FdOJN/ljis= +github.com/smartcontractkit/chainlink-common v0.3.1-0.20241111184621-c61aebee0af9 h1:xjrbuLW28nJ661Hu9dodcCQm7ElB5AWnZjmqGiGLNZg= +github.com/smartcontractkit/chainlink-common v0.3.1-0.20241111184621-c61aebee0af9/go.mod h1:ny87uTW6hLjCTLiBqBRNFEhETSXhHWevYlPclT5lSco= github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241017133723-5277829bd53f h1:BwrIaQIx5Iy6eT+DfLhFfK2XqjxRm74mVdlX8gbu4dw= github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241017133723-5277829bd53f/go.mod h1:wHtwSR3F1CQSJJZDQKuqaqFYnvkT+kMyget7dl8Clvo= github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20241018134907-a00ba3729b5e h1:JiETqdNM0bktAUGMc62COwXIaw3rR3M77Me6bBLG0Fg= diff --git a/deployment/go.mod b/deployment/go.mod index 43577ccd574..77879e52ac9 100644 --- a/deployment/go.mod +++ b/deployment/go.mod @@ -24,7 +24,7 @@ require ( github.com/sethvargo/go-retry v0.2.4 github.com/smartcontractkit/ccip-owner-contracts v0.0.0-20240926212305-a6deabdfce86 github.com/smartcontractkit/chain-selectors v1.0.27 - github.com/smartcontractkit/chainlink-ccip v0.0.0-20241112113037-79a7af184331 + github.com/smartcontractkit/chainlink-ccip v0.0.0-20241112162219-e1e443d3e488 github.com/smartcontractkit/chainlink-common v0.3.1-0.20241108204352-914b88b62cf2 github.com/smartcontractkit/chainlink-protos/job-distributor v0.4.0 github.com/smartcontractkit/chainlink-testing-framework/lib v1.50.13 diff --git a/deployment/go.sum b/deployment/go.sum index 4b96c3899cf..38fd91b9d7b 100644 --- a/deployment/go.sum +++ b/deployment/go.sum @@ -1382,8 +1382,8 @@ github.com/smartcontractkit/chain-selectors v1.0.27 h1:VE/ftX9Aae4gnw67yR1raKi+3 github.com/smartcontractkit/chain-selectors v1.0.27/go.mod h1:d4Hi+E1zqjy9HqMkjBE5q1vcG9VGgxf5VxiRHfzi2kE= 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-20241112113037-79a7af184331 h1:mhmFVKTA+5m7j3rVe+MnzvzDdL+vhPSb3POJpINUBic= -github.com/smartcontractkit/chainlink-ccip v0.0.0-20241112113037-79a7af184331/go.mod h1:4adKaHNaxFsRvV/lYfqtbsWyyvIPUMLR0FdOJN/ljis= +github.com/smartcontractkit/chainlink-ccip v0.0.0-20241112162219-e1e443d3e488 h1:tDEY6ATBOR6wQkP9AjE/5KNI0dkHNoiwAN/iOq0paTE= +github.com/smartcontractkit/chainlink-ccip v0.0.0-20241112162219-e1e443d3e488/go.mod h1:4adKaHNaxFsRvV/lYfqtbsWyyvIPUMLR0FdOJN/ljis= github.com/smartcontractkit/chainlink-common v0.3.1-0.20241108204352-914b88b62cf2 h1:sm8dL6NSFHmu2Bl17KhhfIwLQYWauxAFpBZ/w8WHuAA= github.com/smartcontractkit/chainlink-common v0.3.1-0.20241108204352-914b88b62cf2/go.mod h1:ny87uTW6hLjCTLiBqBRNFEhETSXhHWevYlPclT5lSco= github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241017133723-5277829bd53f h1:BwrIaQIx5Iy6eT+DfLhFfK2XqjxRm74mVdlX8gbu4dw= diff --git a/go.mod b/go.mod index 5b46e9e2f2e..c7640e84c16 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.27 github.com/smartcontractkit/chainlink-automation v0.8.1 - github.com/smartcontractkit/chainlink-ccip v0.0.0-20241112113037-79a7af184331 + github.com/smartcontractkit/chainlink-ccip v0.0.0-20241112162219-e1e443d3e488 github.com/smartcontractkit/chainlink-common v0.3.1-0.20241108204352-914b88b62cf2 github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241017133723-5277829bd53f github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20241018134907-a00ba3729b5e diff --git a/go.sum b/go.sum index 140da61ec51..c532b839fe9 100644 --- a/go.sum +++ b/go.sum @@ -1076,8 +1076,8 @@ github.com/smartcontractkit/chain-selectors v1.0.27 h1:VE/ftX9Aae4gnw67yR1raKi+3 github.com/smartcontractkit/chain-selectors v1.0.27/go.mod h1:d4Hi+E1zqjy9HqMkjBE5q1vcG9VGgxf5VxiRHfzi2kE= 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-20241112113037-79a7af184331 h1:mhmFVKTA+5m7j3rVe+MnzvzDdL+vhPSb3POJpINUBic= -github.com/smartcontractkit/chainlink-ccip v0.0.0-20241112113037-79a7af184331/go.mod h1:4adKaHNaxFsRvV/lYfqtbsWyyvIPUMLR0FdOJN/ljis= +github.com/smartcontractkit/chainlink-ccip v0.0.0-20241112162219-e1e443d3e488 h1:tDEY6ATBOR6wQkP9AjE/5KNI0dkHNoiwAN/iOq0paTE= +github.com/smartcontractkit/chainlink-ccip v0.0.0-20241112162219-e1e443d3e488/go.mod h1:4adKaHNaxFsRvV/lYfqtbsWyyvIPUMLR0FdOJN/ljis= github.com/smartcontractkit/chainlink-common v0.3.1-0.20241108204352-914b88b62cf2 h1:sm8dL6NSFHmu2Bl17KhhfIwLQYWauxAFpBZ/w8WHuAA= github.com/smartcontractkit/chainlink-common v0.3.1-0.20241108204352-914b88b62cf2/go.mod h1:ny87uTW6hLjCTLiBqBRNFEhETSXhHWevYlPclT5lSco= github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241017133723-5277829bd53f h1:BwrIaQIx5Iy6eT+DfLhFfK2XqjxRm74mVdlX8gbu4dw= diff --git a/integration-tests/go.mod b/integration-tests/go.mod index 50a39478086..c42ff5b9b2e 100644 --- a/integration-tests/go.mod +++ b/integration-tests/go.mod @@ -36,9 +36,7 @@ require ( github.com/slack-go/slack v0.15.0 github.com/smartcontractkit/chain-selectors v1.0.27 github.com/smartcontractkit/chainlink-automation v0.8.1 - github.com/smartcontractkit/chainlink-ccip v0.0.0-20241112113037-79a7af184331 - github.com/smartcontractkit/chainlink-common v0.3.1-0.20241108204352-914b88b62cf2 - github.com/smartcontractkit/chainlink-ccip v0.0.0-20241111114733-aa3b2f8e9f94 + github.com/smartcontractkit/chainlink-ccip v0.0.0-20241112162219-e1e443d3e488 github.com/smartcontractkit/chainlink-common v0.3.1-0.20241111184621-c61aebee0af9 github.com/smartcontractkit/chainlink-protos/job-distributor v0.4.0 github.com/smartcontractkit/chainlink-testing-framework/havoc v1.50.2 diff --git a/integration-tests/go.sum b/integration-tests/go.sum index 2b338221ddd..1574a874eb2 100644 --- a/integration-tests/go.sum +++ b/integration-tests/go.sum @@ -1403,10 +1403,10 @@ github.com/smartcontractkit/chain-selectors v1.0.27 h1:VE/ftX9Aae4gnw67yR1raKi+3 github.com/smartcontractkit/chain-selectors v1.0.27/go.mod h1:d4Hi+E1zqjy9HqMkjBE5q1vcG9VGgxf5VxiRHfzi2kE= 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-20241112113037-79a7af184331 h1:mhmFVKTA+5m7j3rVe+MnzvzDdL+vhPSb3POJpINUBic= -github.com/smartcontractkit/chainlink-ccip v0.0.0-20241112113037-79a7af184331/go.mod h1:4adKaHNaxFsRvV/lYfqtbsWyyvIPUMLR0FdOJN/ljis= -github.com/smartcontractkit/chainlink-common v0.3.1-0.20241108204352-914b88b62cf2 h1:sm8dL6NSFHmu2Bl17KhhfIwLQYWauxAFpBZ/w8WHuAA= -github.com/smartcontractkit/chainlink-common v0.3.1-0.20241108204352-914b88b62cf2/go.mod h1:ny87uTW6hLjCTLiBqBRNFEhETSXhHWevYlPclT5lSco= +github.com/smartcontractkit/chainlink-ccip v0.0.0-20241112162219-e1e443d3e488 h1:tDEY6ATBOR6wQkP9AjE/5KNI0dkHNoiwAN/iOq0paTE= +github.com/smartcontractkit/chainlink-ccip v0.0.0-20241112162219-e1e443d3e488/go.mod h1:4adKaHNaxFsRvV/lYfqtbsWyyvIPUMLR0FdOJN/ljis= +github.com/smartcontractkit/chainlink-common v0.3.1-0.20241111184621-c61aebee0af9 h1:xjrbuLW28nJ661Hu9dodcCQm7ElB5AWnZjmqGiGLNZg= +github.com/smartcontractkit/chainlink-common v0.3.1-0.20241111184621-c61aebee0af9/go.mod h1:ny87uTW6hLjCTLiBqBRNFEhETSXhHWevYlPclT5lSco= github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241017133723-5277829bd53f h1:BwrIaQIx5Iy6eT+DfLhFfK2XqjxRm74mVdlX8gbu4dw= github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241017133723-5277829bd53f/go.mod h1:wHtwSR3F1CQSJJZDQKuqaqFYnvkT+kMyget7dl8Clvo= github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20241018134907-a00ba3729b5e h1:JiETqdNM0bktAUGMc62COwXIaw3rR3M77Me6bBLG0Fg= diff --git a/integration-tests/load/go.mod b/integration-tests/load/go.mod index 517fbf700f4..25c03e138df 100644 --- a/integration-tests/load/go.mod +++ b/integration-tests/load/go.mod @@ -65,7 +65,7 @@ require ( github.com/russross/blackfriday/v2 v2.1.0 // indirect github.com/sagikazarmark/locafero v0.4.0 // indirect github.com/sagikazarmark/slog-shim v0.1.0 // indirect - github.com/smartcontractkit/chainlink-ccip v0.0.0-20241112113037-79a7af184331 // indirect + github.com/smartcontractkit/chainlink-ccip v0.0.0-20241112162219-e1e443d3e488 // indirect github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241017133723-5277829bd53f // indirect github.com/smartcontractkit/chainlink-testing-framework/havoc v1.50.2 // indirect github.com/smartcontractkit/grpc-proxy v0.0.0-20240830132753-a7e17fec5ab7 // indirect diff --git a/integration-tests/load/go.sum b/integration-tests/load/go.sum index f50966d6547..b657d753c51 100644 --- a/integration-tests/load/go.sum +++ b/integration-tests/load/go.sum @@ -1392,10 +1392,10 @@ github.com/smartcontractkit/chain-selectors v1.0.27 h1:VE/ftX9Aae4gnw67yR1raKi+3 github.com/smartcontractkit/chain-selectors v1.0.27/go.mod h1:d4Hi+E1zqjy9HqMkjBE5q1vcG9VGgxf5VxiRHfzi2kE= 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-20241112113037-79a7af184331 h1:mhmFVKTA+5m7j3rVe+MnzvzDdL+vhPSb3POJpINUBic= -github.com/smartcontractkit/chainlink-ccip v0.0.0-20241112113037-79a7af184331/go.mod h1:4adKaHNaxFsRvV/lYfqtbsWyyvIPUMLR0FdOJN/ljis= -github.com/smartcontractkit/chainlink-common v0.3.1-0.20241108204352-914b88b62cf2 h1:sm8dL6NSFHmu2Bl17KhhfIwLQYWauxAFpBZ/w8WHuAA= -github.com/smartcontractkit/chainlink-common v0.3.1-0.20241108204352-914b88b62cf2/go.mod h1:ny87uTW6hLjCTLiBqBRNFEhETSXhHWevYlPclT5lSco= +github.com/smartcontractkit/chainlink-ccip v0.0.0-20241112162219-e1e443d3e488 h1:tDEY6ATBOR6wQkP9AjE/5KNI0dkHNoiwAN/iOq0paTE= +github.com/smartcontractkit/chainlink-ccip v0.0.0-20241112162219-e1e443d3e488/go.mod h1:4adKaHNaxFsRvV/lYfqtbsWyyvIPUMLR0FdOJN/ljis= +github.com/smartcontractkit/chainlink-common v0.3.1-0.20241111184621-c61aebee0af9 h1:xjrbuLW28nJ661Hu9dodcCQm7ElB5AWnZjmqGiGLNZg= +github.com/smartcontractkit/chainlink-common v0.3.1-0.20241111184621-c61aebee0af9/go.mod h1:ny87uTW6hLjCTLiBqBRNFEhETSXhHWevYlPclT5lSco= github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241017133723-5277829bd53f h1:BwrIaQIx5Iy6eT+DfLhFfK2XqjxRm74mVdlX8gbu4dw= github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241017133723-5277829bd53f/go.mod h1:wHtwSR3F1CQSJJZDQKuqaqFYnvkT+kMyget7dl8Clvo= github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20241018134907-a00ba3729b5e h1:JiETqdNM0bktAUGMc62COwXIaw3rR3M77Me6bBLG0Fg= From e41c54545389bd74911795958466757c7513357d Mon Sep 17 00:00:00 2001 From: nogo <0xnogo@gmail.com> Date: Tue, 12 Nov 2024 21:46:08 +0400 Subject: [PATCH 03/21] merge and fix --- deployment/ccip/add_lane.go | 12 ++--- deployment/ccip/add_lane_test.go | 4 +- .../ccip/changeset/active_candidate_test.go | 2 +- deployment/ccip/changeset/add_chain_test.go | 2 +- .../ccip/changeset/fee_boosting_test.go | 9 ---- .../ccip/changeset/initial_deploy_test.go | 5 ++- deployment/ccip/changeset/messaging_test.go | 7 +-- deployment/ccip/test_helpers.go | 44 +++++++++++++++---- 8 files changed, 53 insertions(+), 32 deletions(-) diff --git a/deployment/ccip/add_lane.go b/deployment/ccip/add_lane.go index f2b9cb36e37..6cbf1ea6ccd 100644 --- a/deployment/ccip/add_lane.go +++ b/deployment/ccip/add_lane.go @@ -20,12 +20,14 @@ type InitialPrices struct { GasPrice *big.Int // uint224 packed gas price in USD (112 for exec // 112 for da) } +var DefaultInitialPrices = InitialPrices{ + LinkPrice: deployment.E18Mult(20), + WethPrice: deployment.E18Mult(4000), + GasPrice: big.NewInt(2e12), +} + func AddLaneWithDefaultPrices(e deployment.Environment, state CCIPOnChainState, from, to uint64) error { - return AddLane(e, state, from, to, InitialPrices{ - LinkPrice: deployment.E18Mult(20), - WethPrice: deployment.E18Mult(4000), - GasPrice: big.NewInt(2e12), - }) + return AddLane(e, state, from, to, DefaultInitialPrices) } func AddLane(e deployment.Environment, state CCIPOnChainState, from, to uint64, initialPrices InitialPrices) error { diff --git a/deployment/ccip/add_lane_test.go b/deployment/ccip/add_lane_test.go index 223d978b814..0caa9a30d7c 100644 --- a/deployment/ccip/add_lane_test.go +++ b/deployment/ccip/add_lane_test.go @@ -59,7 +59,7 @@ func TestAddLane(t *testing.T) { require.NoError(t, err) // Add one lane from chain1 to chain 2 and send traffic. - require.NoError(t, AddLane(e.Env, state, chain1, chain2)) + require.NoError(t, AddLaneWithDefaultPrices(e.Env, state, chain1, chain2)) ReplayLogs(t, e.Env.Offchain, replayBlocks) time.Sleep(30 * time.Second) @@ -105,7 +105,7 @@ func TestAddLane(t *testing.T) { require.Equal(t, uint64(1), seqNum1) // Add another lane - require.NoError(t, AddLane(e.Env, state, chain2, chain1)) + require.NoError(t, AddLaneWithDefaultPrices(e.Env, state, chain2, chain1)) // Send traffic on the second lane and it should succeed latesthdr, err = e.Env.Chains[chain1].Client.HeaderByNumber(testcontext.Get(t), nil) diff --git a/deployment/ccip/changeset/active_candidate_test.go b/deployment/ccip/changeset/active_candidate_test.go index 9daf383c971..3cbe1bf7f3b 100644 --- a/deployment/ccip/changeset/active_candidate_test.go +++ b/deployment/ccip/changeset/active_candidate_test.go @@ -28,7 +28,7 @@ func TestActiveCandidate(t *testing.T) { lggr := logger.TestLogger(t) ctx := ccdeploy.Context(t) - tenv := ccdeploy.NewMemoryEnvironment(t, lggr, 3, 5) + tenv := ccdeploy.NewMemoryEnvironment(t, lggr, 3, 5, ccdeploy.MockLinkPrice, ccdeploy.MockWethPrice) e := tenv.Env state, err := ccdeploy.LoadOnchainState(tenv.Env) diff --git a/deployment/ccip/changeset/add_chain_test.go b/deployment/ccip/changeset/add_chain_test.go index ff02430fd51..080c0668103 100644 --- a/deployment/ccip/changeset/add_chain_test.go +++ b/deployment/ccip/changeset/add_chain_test.go @@ -55,7 +55,7 @@ func TestAddChainInbound(t *testing.T) { for _, source := range initialDeploy { for _, dest := range initialDeploy { if source != dest { - require.NoError(t, ccipdeployment.AddLane(e.Env, state, source, dest)) + require.NoError(t, ccipdeployment.AddLaneWithDefaultPrices(e.Env, state, source, dest)) } } } diff --git a/deployment/ccip/changeset/fee_boosting_test.go b/deployment/ccip/changeset/fee_boosting_test.go index c1ce08d62b8..8ee23e78bd6 100644 --- a/deployment/ccip/changeset/fee_boosting_test.go +++ b/deployment/ccip/changeset/fee_boosting_test.go @@ -5,7 +5,6 @@ import ( "fmt" "math/big" "testing" - "time" "cosmossdk.io/errors" "github.com/ethereum/go-ethereum/accounts/abi/bind" @@ -161,14 +160,6 @@ func toPackedFee(execFee, daFee *big.Int) *big.Int { return new(big.Int).Or(daShifted, execFee) } -func sleepAndReplay(t *testing.T, e ccipdeployment.DeployedEnv, sourceChain, destChain uint64) { - time.Sleep(30 * time.Second) - replayBlocks := make(map[uint64]uint64) - replayBlocks[sourceChain] = 1 - replayBlocks[destChain] = 1 - ccipdeployment.ReplayLogs(t, e.Env.Offchain, replayBlocks) -} - func startGasPriceTicker(state ccipdeployment.CCIPOnChainState, src uint64, dest uint64) { fq := state.Chains[src].FeeQuoter gasPrice, err := fq.GetDestinationChainGasPrice(&bind.CallOpts{Context: context.Background()}, dest) diff --git a/deployment/ccip/changeset/initial_deploy_test.go b/deployment/ccip/changeset/initial_deploy_test.go index b30b2802258..1b8e96d36cb 100644 --- a/deployment/ccip/changeset/initial_deploy_test.go +++ b/deployment/ccip/changeset/initial_deploy_test.go @@ -22,7 +22,7 @@ import ( func TestInitialDeploy(t *testing.T) { lggr := logger.TestLogger(t) ctx := ccdeploy.Context(t) - tenv := ccdeploy.NewMemoryEnvironment(t, lggr, 3, 4) + tenv := ccdeploy.NewMemoryEnvironment(t, lggr, 3, 4, ccdeploy.MockLinkPrice, ccdeploy.MockWethPrice) e := tenv.Env state, err := ccdeploy.LoadOnchainState(tenv.Env) @@ -90,7 +90,8 @@ func TestInitialDeploy(t *testing.T) { ccdeploy.ConfirmCommitForAllWithExpectedSeqNums(t, e, state, expectedSeqNum, startBlocks) // Confirm token and gas prices are updated - ccdeploy.ConfirmTokenPriceUpdatedForAll(t, e, state, startBlocks) + ccdeploy.ConfirmTokenPriceUpdatedForAll(t, e, state, startBlocks, + ccdeploy.DefaultInitialPrices.LinkPrice, ccdeploy.DefaultInitialPrices.WethPrice) // TODO: Fix gas prices? //ccdeploy.ConfirmGasPriceUpdatedForAll(t, e, state, startBlocks) // diff --git a/deployment/ccip/changeset/messaging_test.go b/deployment/ccip/changeset/messaging_test.go index a5fde58742b..c71bb688a17 100644 --- a/deployment/ccip/changeset/messaging_test.go +++ b/deployment/ccip/changeset/messaging_test.go @@ -6,13 +6,14 @@ import ( "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" + "github.com/test-go/testify/require" + "golang.org/x/exp/maps" + "github.com/smartcontractkit/chainlink-common/pkg/utils/tests" "github.com/smartcontractkit/chainlink/deployment" ccipdeployment "github.com/smartcontractkit/chainlink/deployment/ccip" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/router" "github.com/smartcontractkit/chainlink/v2/core/logger" - "github.com/test-go/testify/require" - "golang.org/x/exp/maps" ) type testCaseSetup struct { @@ -69,7 +70,7 @@ func Test_Messaging(t *testing.T) { require.NoError(t, err) // connect a single lane, source to dest - require.NoError(t, ccipdeployment.AddLane(e.Env, state, sourceChain, destChain)) + require.NoError(t, ccipdeployment.AddLaneWithDefaultPrices(e.Env, state, sourceChain, destChain)) var ( replayed bool diff --git a/deployment/ccip/test_helpers.go b/deployment/ccip/test_helpers.go index 98cf2fc6a49..2df286b86dc 100644 --- a/deployment/ccip/test_helpers.go +++ b/deployment/ccip/test_helpers.go @@ -118,6 +118,8 @@ func DeployTestContracts(t *testing.T, homeChainSel, feedChainSel uint64, chains map[uint64]deployment.Chain, + linkPrice *big.Int, + wethPrice *big.Int, ) deployment.CapabilityRegistryConfig { capReg, err := DeployCapReg(lggr, // deploying cap reg for the first time on a blank chain state @@ -125,7 +127,7 @@ func DeployTestContracts(t *testing.T, Chains: make(map[uint64]CCIPChainState), }, ab, chains[homeChainSel]) require.NoError(t, err) - _, err = DeployFeeds(lggr, ab, chains[feedChainSel]) + _, err = DeployFeeds(lggr, ab, chains[feedChainSel], linkPrice, wethPrice) require.NoError(t, err) err = DeployFeeTokensToChains(lggr, ab, chains) require.NoError(t, err) @@ -166,7 +168,13 @@ func allocateCCIPChainSelectors(chains map[uint64]deployment.Chain) (homeChainSe // NewMemoryEnvironment creates a new CCIP environment // with capreg, fee tokens, feeds and nodes set up. -func NewMemoryEnvironment(t *testing.T, lggr logger.Logger, numChains int, numNodes int) DeployedEnv { +func NewMemoryEnvironment( + t *testing.T, + lggr logger.Logger, + numChains int, + numNodes int, + linkPrice *big.Int, + wethPrice *big.Int) DeployedEnv { require.GreaterOrEqual(t, numChains, 2, "numChains must be at least 2 for home and feed chains") require.GreaterOrEqual(t, numNodes, 4, "numNodes must be at least 4") ctx := testcontext.Get(t) @@ -176,7 +184,7 @@ func NewMemoryEnvironment(t *testing.T, lggr logger.Logger, numChains int, numNo require.NoError(t, err) ab := deployment.NewMemoryAddressBook() - crConfig := DeployTestContracts(t, lggr, ab, homeChainSel, feedSel, chains) + crConfig := DeployTestContracts(t, lggr, ab, homeChainSel, feedSel, chains, linkPrice, wethPrice) nodes := memory.NewNodes(t, zapcore.InfoLevel, evmChains, numNodes, 1, crConfig) for _, node := range nodes { require.NoError(t, node.App.Start(ctx)) @@ -209,7 +217,19 @@ func NewMemoryEnvironment(t *testing.T, lggr logger.Logger, numChains int, numNo // NewMemoryEnvironmentWithJobs creates a new CCIP environment // with capreg, fee tokens, feeds, nodes and jobs set up. func NewMemoryEnvironmentWithJobs(t *testing.T, lggr logger.Logger, numChains int, numNodes int) DeployedEnv { - e := NewMemoryEnvironment(t, lggr, numChains, numNodes) + e := NewMemoryEnvironment(t, lggr, numChains, numNodes, MockLinkPrice, MockWethPrice) + e.SetupJobs(t) + return e +} + +func NewMemoryEnvironmentWithJobsAndPrices( + t *testing.T, + lggr logger.Logger, + numChains int, + numNodes int, + linkPrice *big.Int, + wethPrice *big.Int) DeployedEnv { + e := NewMemoryEnvironment(t, lggr, numChains, numNodes, linkPrice, wethPrice) e.SetupJobs(t) return e } @@ -317,7 +337,7 @@ func AddLanesForAll(e deployment.Environment, state CCIPOnChainState) error { for source := range e.Chains { for dest := range e.Chains { if source != dest { - err := AddLane(e, state, source, dest) + err := AddLaneWithDefaultPrices(e, state, source, dest) if err != nil { return err } @@ -356,14 +376,20 @@ var ( } ) -func DeployFeeds(lggr logger.Logger, ab deployment.AddressBook, chain deployment.Chain) (map[string]common.Address, error) { +func DeployFeeds( + lggr logger.Logger, + ab deployment.AddressBook, + chain deployment.Chain, + linkPrice *big.Int, + wethPrice *big.Int, +) (map[string]common.Address, error) { linkTV := deployment.NewTypeAndVersion(PriceFeed, deployment.Version1_0_0) mockLinkFeed := func(chain deployment.Chain) ContractDeploy[*aggregator_v3_interface.AggregatorV3Interface] { linkFeed, tx, _, err1 := mock_v3_aggregator_contract.DeployMockV3Aggregator( chain.DeployerKey, chain.Client, - LinkDecimals, // decimals - MockLinkPrice, // initialAnswer + LinkDecimals, // decimals + linkPrice, // initialAnswer ) aggregatorCr, err2 := aggregator_v3_interface.NewAggregatorV3Interface(linkFeed, chain.Client) @@ -376,7 +402,7 @@ func DeployFeeds(lggr logger.Logger, ab deployment.AddressBook, chain deployment wethFeed, tx, _, err1 := mock_ethusd_aggregator_wrapper.DeployMockETHUSDAggregator( chain.DeployerKey, chain.Client, - MockWethPrice, // initialAnswer + wethPrice, // initialAnswer ) aggregatorCr, err2 := aggregator_v3_interface.NewAggregatorV3Interface(wethFeed, chain.Client) From a3c56eab1531141b4f0b5faf2967f300b3efa87c Mon Sep 17 00:00:00 2001 From: nogo <0xnogo@gmail.com> Date: Wed, 13 Nov 2024 11:39:20 +0400 Subject: [PATCH 04/21] price updates --- deployment/ccip/add_lane.go | 2 +- .../ccip/changeset/fee_boosting_test.go | 78 ++++++------------- deployment/ccip/test_helpers.go | 7 +- 3 files changed, 32 insertions(+), 55 deletions(-) diff --git a/deployment/ccip/add_lane.go b/deployment/ccip/add_lane.go index 6cbf1ea6ccd..deb2dfe9bc7 100644 --- a/deployment/ccip/add_lane.go +++ b/deployment/ccip/add_lane.go @@ -23,7 +23,7 @@ type InitialPrices struct { var DefaultInitialPrices = InitialPrices{ LinkPrice: deployment.E18Mult(20), WethPrice: deployment.E18Mult(4000), - GasPrice: big.NewInt(2e12), + GasPrice: ToPackedFee(big.NewInt(8e14), big.NewInt(0)), } func AddLaneWithDefaultPrices(e deployment.Environment, state CCIPOnChainState, from, to uint64) error { diff --git a/deployment/ccip/changeset/fee_boosting_test.go b/deployment/ccip/changeset/fee_boosting_test.go index 8ee23e78bd6..e41abb157d5 100644 --- a/deployment/ccip/changeset/fee_boosting_test.go +++ b/deployment/ccip/changeset/fee_boosting_test.go @@ -1,13 +1,9 @@ package changeset import ( - "context" - "fmt" "math/big" "testing" - "cosmossdk.io/errors" - "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" "github.com/test-go/testify/require" "golang.org/x/exp/maps" @@ -72,9 +68,6 @@ func Test_FeeBoosting(t *testing.T) { require.NoError(t, ccipdeployment.AddLane(e.Env, state, sourceChain, destChain, initialPrices)) - startGasPriceTicker(state, sourceChain, destChain) - startGasPriceTicker(state, destChain, sourceChain) - return e, state, sourceChain, destChain } @@ -101,43 +94,36 @@ func Test_FeeBoosting(t *testing.T) { } scenarios := []scenario{ - // { - // name: "boost needed due to WETH price increase", - // initialPrices: ccipdeployment.InitialPrices{ - // LinkPrice: deployment.E18Mult(5), - // WethPrice: deployment.E18Mult(9), - // GasPrice: big.NewInt(1.8e11), - // }, - // priceFeedPrices: priceFeedPrices{ - // linkPrice: deployment.E18Mult(5), - // wethPrice: big.NewInt(20.1e8), - // }, - // }, - // { - // name: "boost needed due to LINK price decrease", - // initialPrices: ccipdeployment.InitialPrices{ - // LinkPrice: deployment.E18Mult(5), - // WethPrice: deployment.E18Mult(9), - // GasPrice: big.NewInt(1.8e11), - // }, - // priceFeedPrices: priceFeedPrices{ - // linkPrice: big.NewInt(2.24e18), - // wethPrice: big.NewInt(9e8), - // }, - // }, + { + name: "boost needed due to WETH price increase", + initialPrices: ccipdeployment.InitialPrices{ + LinkPrice: deployment.E18Mult(5), + WethPrice: deployment.E18Mult(9), + GasPrice: ccipdeployment.ToPackedFee(big.NewInt(1.8e11), big.NewInt(0)), + }, + priceFeedPrices: priceFeedPrices{ + linkPrice: deployment.E18Mult(5), + wethPrice: big.NewInt(9.1e8), // 9 USD per ETH vs 9.1 USD per ETH during execution + }, + }, + { + name: "boost needed due to LINK price decrease", + initialPrices: ccipdeployment.InitialPrices{ + LinkPrice: deployment.E18Mult(5), + WethPrice: deployment.E18Mult(9), + GasPrice: ccipdeployment.ToPackedFee(big.NewInt(1.8e11), big.NewInt(0)), + }, + priceFeedPrices: priceFeedPrices{ + linkPrice: big.NewInt(4.9e18), // 5 USD per LINK vs 4.9 USD per LINK during execution + wethPrice: big.NewInt(9e8), + }, + }, { name: "boost needed due to gas price increase", initialPrices: ccipdeployment.InitialPrices{ LinkPrice: deployment.E18Mult(5), WethPrice: deployment.E18Mult(9), - GasPrice: toPackedFee(big.NewInt(1.8e11), big.NewInt(0)), - // GasPrice: new(big.Int).Or( - // new(big.Int).Lsh( - // big.NewInt(1.8e11), // 1.6e11 vs 1.8e11 as the gas is 20gwei with 1ETH = 9$ - // 112, - // ), - // big.NewInt(0), - // ), + GasPrice: ccipdeployment.ToPackedFee(big.NewInt(1.75e11), big.NewInt(0)), // 19 gwei vs 20 gwei during execution }, priceFeedPrices: priceFeedPrices{ linkPrice: deployment.E18Mult(5), @@ -154,17 +140,3 @@ func Test_FeeBoosting(t *testing.T) { }) } } - -func toPackedFee(execFee, daFee *big.Int) *big.Int { - daShifted := new(big.Int).Lsh(daFee, 112) - return new(big.Int).Or(daShifted, execFee) -} - -func startGasPriceTicker(state ccipdeployment.CCIPOnChainState, src uint64, dest uint64) { - fq := state.Chains[src].FeeQuoter - gasPrice, err := fq.GetDestinationChainGasPrice(&bind.CallOpts{Context: context.Background()}, dest) - if err != nil { - fmt.Println(errors.Wrap(err, "failed to get gas price")) - } - fmt.Println("Gas price for chain", dest, "is", gasPrice) -} diff --git a/deployment/ccip/test_helpers.go b/deployment/ccip/test_helpers.go index 2df286b86dc..9b13afbe164 100644 --- a/deployment/ccip/test_helpers.go +++ b/deployment/ccip/test_helpers.go @@ -347,6 +347,11 @@ func AddLanesForAll(e deployment.Environment, state CCIPOnChainState) error { return nil } +func ToPackedFee(execFee, daFee *big.Int) *big.Int { + daShifted := new(big.Int).Lsh(daFee, 112) + return new(big.Int).Or(daShifted, execFee) +} + const ( // MockLinkAggregatorDescription This is the description of the MockV3Aggregator.sol contract // nolint:lll @@ -359,7 +364,7 @@ const ( ) var ( - MockLinkPrice = big.NewInt(5e18) + MockLinkPrice = deployment.E18Mult(500) MockWethPrice = big.NewInt(9e8) // MockDescriptionToTokenSymbol maps a mock feed description to token descriptor MockDescriptionToTokenSymbol = map[string]TokenSymbol{ From a1e2eb95656ef968ee7ab9e4ae2e18319b2d4ff6 Mon Sep 17 00:00:00 2001 From: nogo <0xnogo@gmail.com> Date: Wed, 13 Nov 2024 11:47:11 +0400 Subject: [PATCH 05/21] adding price in integ-test helpers --- integration-tests/ccip-tests/testsetups/test_helpers.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/integration-tests/ccip-tests/testsetups/test_helpers.go b/integration-tests/ccip-tests/testsetups/test_helpers.go index 4de5d0988a2..fc7b976d942 100644 --- a/integration-tests/ccip-tests/testsetups/test_helpers.go +++ b/integration-tests/ccip-tests/testsetups/test_helpers.go @@ -88,7 +88,7 @@ func NewLocalDevEnvironment(t *testing.T, lggr logger.Logger) (ccipdeployment.De require.NoError(t, err) ab := deployment.NewMemoryAddressBook() - crConfig := ccipdeployment.DeployTestContracts(t, lggr, ab, homeChainSel, feedSel, chains) + crConfig := ccipdeployment.DeployTestContracts(t, lggr, ab, homeChainSel, feedSel, chains, ccipdeployment.MockLinkPrice, ccipdeployment.MockWethPrice) // start the chainlink nodes with the CR address err = StartChainlinkNodes(t, envConfig, From 2943efd6e63549d1ff35a77a46cb68189e97d90b Mon Sep 17 00:00:00 2001 From: nogo <0xnogo@gmail.com> Date: Wed, 13 Nov 2024 11:53:32 +0400 Subject: [PATCH 06/21] commong bump --- core/scripts/go.mod | 2 +- core/scripts/go.sum | 4 ++-- deployment/go.mod | 4 ++-- 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 ++-- 10 files changed, 16 insertions(+), 16 deletions(-) diff --git a/core/scripts/go.mod b/core/scripts/go.mod index 96bf1b55285..a3329111349 100644 --- a/core/scripts/go.mod +++ b/core/scripts/go.mod @@ -24,7 +24,7 @@ require ( github.com/prometheus/client_golang v1.20.5 github.com/shopspring/decimal v1.4.0 github.com/smartcontractkit/chainlink-automation v0.8.1 - github.com/smartcontractkit/chainlink-common v0.3.1-0.20241111184621-c61aebee0af9 + github.com/smartcontractkit/chainlink-common v0.3.1-0.20241112140826-0e2daed34ef6 github.com/smartcontractkit/chainlink/deployment v0.0.0-00010101000000-000000000000 github.com/smartcontractkit/chainlink/v2 v2.0.0-00010101000000-000000000000 github.com/smartcontractkit/libocr v0.0.0-20241007185508-adbe57025f12 diff --git a/core/scripts/go.sum b/core/scripts/go.sum index c57821bf0c3..08006ad2fdc 100644 --- a/core/scripts/go.sum +++ b/core/scripts/go.sum @@ -1094,8 +1094,8 @@ github.com/smartcontractkit/chainlink-automation v0.8.1 h1:sTc9LKpBvcKPc1JDYAmgB github.com/smartcontractkit/chainlink-automation v0.8.1/go.mod h1:Iij36PvWZ6blrdC5A/nrQUBuf3MH3JvsBB9sSyc9W08= github.com/smartcontractkit/chainlink-ccip v0.0.0-20241112162219-e1e443d3e488 h1:tDEY6ATBOR6wQkP9AjE/5KNI0dkHNoiwAN/iOq0paTE= github.com/smartcontractkit/chainlink-ccip v0.0.0-20241112162219-e1e443d3e488/go.mod h1:4adKaHNaxFsRvV/lYfqtbsWyyvIPUMLR0FdOJN/ljis= -github.com/smartcontractkit/chainlink-common v0.3.1-0.20241111184621-c61aebee0af9 h1:xjrbuLW28nJ661Hu9dodcCQm7ElB5AWnZjmqGiGLNZg= -github.com/smartcontractkit/chainlink-common v0.3.1-0.20241111184621-c61aebee0af9/go.mod h1:ny87uTW6hLjCTLiBqBRNFEhETSXhHWevYlPclT5lSco= +github.com/smartcontractkit/chainlink-common v0.3.1-0.20241112140826-0e2daed34ef6 h1:yJNBWCdNL/X8+wEs3TGTBe9gssMmw5FTFxxrlo+0mVo= +github.com/smartcontractkit/chainlink-common v0.3.1-0.20241112140826-0e2daed34ef6/go.mod h1:ny87uTW6hLjCTLiBqBRNFEhETSXhHWevYlPclT5lSco= github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241017133723-5277829bd53f h1:BwrIaQIx5Iy6eT+DfLhFfK2XqjxRm74mVdlX8gbu4dw= github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241017133723-5277829bd53f/go.mod h1:wHtwSR3F1CQSJJZDQKuqaqFYnvkT+kMyget7dl8Clvo= github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20241018134907-a00ba3729b5e h1:JiETqdNM0bktAUGMc62COwXIaw3rR3M77Me6bBLG0Fg= diff --git a/deployment/go.mod b/deployment/go.mod index 77879e52ac9..0528b73dd61 100644 --- a/deployment/go.mod +++ b/deployment/go.mod @@ -6,7 +6,6 @@ go 1.22.8 replace github.com/smartcontractkit/chainlink/v2 => ../ require ( - cosmossdk.io/errors v1.0.1 github.com/AlekSi/pointer v1.1.0 github.com/Khan/genqlient v0.7.0 github.com/Masterminds/semver/v3 v3.3.0 @@ -25,7 +24,7 @@ require ( github.com/smartcontractkit/ccip-owner-contracts v0.0.0-20240926212305-a6deabdfce86 github.com/smartcontractkit/chain-selectors v1.0.27 github.com/smartcontractkit/chainlink-ccip v0.0.0-20241112162219-e1e443d3e488 - github.com/smartcontractkit/chainlink-common v0.3.1-0.20241108204352-914b88b62cf2 + github.com/smartcontractkit/chainlink-common v0.3.1-0.20241112140826-0e2daed34ef6 github.com/smartcontractkit/chainlink-protos/job-distributor v0.4.0 github.com/smartcontractkit/chainlink-testing-framework/lib v1.50.13 github.com/smartcontractkit/chainlink/v2 v2.0.0-00010101000000-000000000000 @@ -48,6 +47,7 @@ require ( cosmossdk.io/api v0.3.1 // indirect cosmossdk.io/core v0.5.1 // indirect cosmossdk.io/depinject v1.0.0-alpha.4 // indirect + cosmossdk.io/errors v1.0.1 // indirect cosmossdk.io/math v1.3.0 // indirect dario.cat/mergo v1.0.1 // indirect filippo.io/edwards25519 v1.1.0 // indirect diff --git a/deployment/go.sum b/deployment/go.sum index 38fd91b9d7b..1a6480110f4 100644 --- a/deployment/go.sum +++ b/deployment/go.sum @@ -1384,8 +1384,8 @@ github.com/smartcontractkit/chainlink-automation v0.8.1 h1:sTc9LKpBvcKPc1JDYAmgB github.com/smartcontractkit/chainlink-automation v0.8.1/go.mod h1:Iij36PvWZ6blrdC5A/nrQUBuf3MH3JvsBB9sSyc9W08= github.com/smartcontractkit/chainlink-ccip v0.0.0-20241112162219-e1e443d3e488 h1:tDEY6ATBOR6wQkP9AjE/5KNI0dkHNoiwAN/iOq0paTE= github.com/smartcontractkit/chainlink-ccip v0.0.0-20241112162219-e1e443d3e488/go.mod h1:4adKaHNaxFsRvV/lYfqtbsWyyvIPUMLR0FdOJN/ljis= -github.com/smartcontractkit/chainlink-common v0.3.1-0.20241108204352-914b88b62cf2 h1:sm8dL6NSFHmu2Bl17KhhfIwLQYWauxAFpBZ/w8WHuAA= -github.com/smartcontractkit/chainlink-common v0.3.1-0.20241108204352-914b88b62cf2/go.mod h1:ny87uTW6hLjCTLiBqBRNFEhETSXhHWevYlPclT5lSco= +github.com/smartcontractkit/chainlink-common v0.3.1-0.20241112140826-0e2daed34ef6 h1:yJNBWCdNL/X8+wEs3TGTBe9gssMmw5FTFxxrlo+0mVo= +github.com/smartcontractkit/chainlink-common v0.3.1-0.20241112140826-0e2daed34ef6/go.mod h1:ny87uTW6hLjCTLiBqBRNFEhETSXhHWevYlPclT5lSco= github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241017133723-5277829bd53f h1:BwrIaQIx5Iy6eT+DfLhFfK2XqjxRm74mVdlX8gbu4dw= github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241017133723-5277829bd53f/go.mod h1:wHtwSR3F1CQSJJZDQKuqaqFYnvkT+kMyget7dl8Clvo= github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20241018134907-a00ba3729b5e h1:JiETqdNM0bktAUGMc62COwXIaw3rR3M77Me6bBLG0Fg= diff --git a/go.mod b/go.mod index c7640e84c16..c704bad0b49 100644 --- a/go.mod +++ b/go.mod @@ -77,7 +77,7 @@ require ( github.com/smartcontractkit/chain-selectors v1.0.27 github.com/smartcontractkit/chainlink-automation v0.8.1 github.com/smartcontractkit/chainlink-ccip v0.0.0-20241112162219-e1e443d3e488 - github.com/smartcontractkit/chainlink-common v0.3.1-0.20241108204352-914b88b62cf2 + github.com/smartcontractkit/chainlink-common v0.3.1-0.20241112140826-0e2daed34ef6 github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241017133723-5277829bd53f github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20241018134907-a00ba3729b5e github.com/smartcontractkit/chainlink-feeds v0.1.1 diff --git a/go.sum b/go.sum index c532b839fe9..4aec06ce7ab 100644 --- a/go.sum +++ b/go.sum @@ -1078,8 +1078,8 @@ github.com/smartcontractkit/chainlink-automation v0.8.1 h1:sTc9LKpBvcKPc1JDYAmgB github.com/smartcontractkit/chainlink-automation v0.8.1/go.mod h1:Iij36PvWZ6blrdC5A/nrQUBuf3MH3JvsBB9sSyc9W08= github.com/smartcontractkit/chainlink-ccip v0.0.0-20241112162219-e1e443d3e488 h1:tDEY6ATBOR6wQkP9AjE/5KNI0dkHNoiwAN/iOq0paTE= github.com/smartcontractkit/chainlink-ccip v0.0.0-20241112162219-e1e443d3e488/go.mod h1:4adKaHNaxFsRvV/lYfqtbsWyyvIPUMLR0FdOJN/ljis= -github.com/smartcontractkit/chainlink-common v0.3.1-0.20241108204352-914b88b62cf2 h1:sm8dL6NSFHmu2Bl17KhhfIwLQYWauxAFpBZ/w8WHuAA= -github.com/smartcontractkit/chainlink-common v0.3.1-0.20241108204352-914b88b62cf2/go.mod h1:ny87uTW6hLjCTLiBqBRNFEhETSXhHWevYlPclT5lSco= +github.com/smartcontractkit/chainlink-common v0.3.1-0.20241112140826-0e2daed34ef6 h1:yJNBWCdNL/X8+wEs3TGTBe9gssMmw5FTFxxrlo+0mVo= +github.com/smartcontractkit/chainlink-common v0.3.1-0.20241112140826-0e2daed34ef6/go.mod h1:ny87uTW6hLjCTLiBqBRNFEhETSXhHWevYlPclT5lSco= github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241017133723-5277829bd53f h1:BwrIaQIx5Iy6eT+DfLhFfK2XqjxRm74mVdlX8gbu4dw= github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241017133723-5277829bd53f/go.mod h1:wHtwSR3F1CQSJJZDQKuqaqFYnvkT+kMyget7dl8Clvo= github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20241018134907-a00ba3729b5e h1:JiETqdNM0bktAUGMc62COwXIaw3rR3M77Me6bBLG0Fg= diff --git a/integration-tests/go.mod b/integration-tests/go.mod index c42ff5b9b2e..5ef74e870f3 100644 --- a/integration-tests/go.mod +++ b/integration-tests/go.mod @@ -37,7 +37,7 @@ require ( github.com/smartcontractkit/chain-selectors v1.0.27 github.com/smartcontractkit/chainlink-automation v0.8.1 github.com/smartcontractkit/chainlink-ccip v0.0.0-20241112162219-e1e443d3e488 - github.com/smartcontractkit/chainlink-common v0.3.1-0.20241111184621-c61aebee0af9 + github.com/smartcontractkit/chainlink-common v0.3.1-0.20241112140826-0e2daed34ef6 github.com/smartcontractkit/chainlink-protos/job-distributor v0.4.0 github.com/smartcontractkit/chainlink-testing-framework/havoc v1.50.2 github.com/smartcontractkit/chainlink-testing-framework/lib v1.50.13 diff --git a/integration-tests/go.sum b/integration-tests/go.sum index 1574a874eb2..c3d885274cd 100644 --- a/integration-tests/go.sum +++ b/integration-tests/go.sum @@ -1405,8 +1405,8 @@ github.com/smartcontractkit/chainlink-automation v0.8.1 h1:sTc9LKpBvcKPc1JDYAmgB github.com/smartcontractkit/chainlink-automation v0.8.1/go.mod h1:Iij36PvWZ6blrdC5A/nrQUBuf3MH3JvsBB9sSyc9W08= github.com/smartcontractkit/chainlink-ccip v0.0.0-20241112162219-e1e443d3e488 h1:tDEY6ATBOR6wQkP9AjE/5KNI0dkHNoiwAN/iOq0paTE= github.com/smartcontractkit/chainlink-ccip v0.0.0-20241112162219-e1e443d3e488/go.mod h1:4adKaHNaxFsRvV/lYfqtbsWyyvIPUMLR0FdOJN/ljis= -github.com/smartcontractkit/chainlink-common v0.3.1-0.20241111184621-c61aebee0af9 h1:xjrbuLW28nJ661Hu9dodcCQm7ElB5AWnZjmqGiGLNZg= -github.com/smartcontractkit/chainlink-common v0.3.1-0.20241111184621-c61aebee0af9/go.mod h1:ny87uTW6hLjCTLiBqBRNFEhETSXhHWevYlPclT5lSco= +github.com/smartcontractkit/chainlink-common v0.3.1-0.20241112140826-0e2daed34ef6 h1:yJNBWCdNL/X8+wEs3TGTBe9gssMmw5FTFxxrlo+0mVo= +github.com/smartcontractkit/chainlink-common v0.3.1-0.20241112140826-0e2daed34ef6/go.mod h1:ny87uTW6hLjCTLiBqBRNFEhETSXhHWevYlPclT5lSco= github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241017133723-5277829bd53f h1:BwrIaQIx5Iy6eT+DfLhFfK2XqjxRm74mVdlX8gbu4dw= github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241017133723-5277829bd53f/go.mod h1:wHtwSR3F1CQSJJZDQKuqaqFYnvkT+kMyget7dl8Clvo= github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20241018134907-a00ba3729b5e h1:JiETqdNM0bktAUGMc62COwXIaw3rR3M77Me6bBLG0Fg= diff --git a/integration-tests/load/go.mod b/integration-tests/load/go.mod index 25c03e138df..0d40ce91057 100644 --- a/integration-tests/load/go.mod +++ b/integration-tests/load/go.mod @@ -17,7 +17,7 @@ require ( github.com/pkg/errors v0.9.1 github.com/rs/zerolog v1.33.0 github.com/slack-go/slack v0.15.0 - github.com/smartcontractkit/chainlink-common v0.3.1-0.20241111184621-c61aebee0af9 + github.com/smartcontractkit/chainlink-common v0.3.1-0.20241112140826-0e2daed34ef6 github.com/smartcontractkit/chainlink-testing-framework/lib v1.50.13 github.com/smartcontractkit/chainlink-testing-framework/seth v1.50.5 github.com/smartcontractkit/chainlink-testing-framework/wasp v1.50.2 diff --git a/integration-tests/load/go.sum b/integration-tests/load/go.sum index b657d753c51..fb617e26ace 100644 --- a/integration-tests/load/go.sum +++ b/integration-tests/load/go.sum @@ -1394,8 +1394,8 @@ github.com/smartcontractkit/chainlink-automation v0.8.1 h1:sTc9LKpBvcKPc1JDYAmgB github.com/smartcontractkit/chainlink-automation v0.8.1/go.mod h1:Iij36PvWZ6blrdC5A/nrQUBuf3MH3JvsBB9sSyc9W08= github.com/smartcontractkit/chainlink-ccip v0.0.0-20241112162219-e1e443d3e488 h1:tDEY6ATBOR6wQkP9AjE/5KNI0dkHNoiwAN/iOq0paTE= github.com/smartcontractkit/chainlink-ccip v0.0.0-20241112162219-e1e443d3e488/go.mod h1:4adKaHNaxFsRvV/lYfqtbsWyyvIPUMLR0FdOJN/ljis= -github.com/smartcontractkit/chainlink-common v0.3.1-0.20241111184621-c61aebee0af9 h1:xjrbuLW28nJ661Hu9dodcCQm7ElB5AWnZjmqGiGLNZg= -github.com/smartcontractkit/chainlink-common v0.3.1-0.20241111184621-c61aebee0af9/go.mod h1:ny87uTW6hLjCTLiBqBRNFEhETSXhHWevYlPclT5lSco= +github.com/smartcontractkit/chainlink-common v0.3.1-0.20241112140826-0e2daed34ef6 h1:yJNBWCdNL/X8+wEs3TGTBe9gssMmw5FTFxxrlo+0mVo= +github.com/smartcontractkit/chainlink-common v0.3.1-0.20241112140826-0e2daed34ef6/go.mod h1:ny87uTW6hLjCTLiBqBRNFEhETSXhHWevYlPclT5lSco= github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241017133723-5277829bd53f h1:BwrIaQIx5Iy6eT+DfLhFfK2XqjxRm74mVdlX8gbu4dw= github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241017133723-5277829bd53f/go.mod h1:wHtwSR3F1CQSJJZDQKuqaqFYnvkT+kMyget7dl8Clvo= github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20241018134907-a00ba3729b5e h1:JiETqdNM0bktAUGMc62COwXIaw3rR3M77Me6bBLG0Fg= From c0ecf6c66270437890aac1d8550b7c61fbd487d7 Mon Sep 17 00:00:00 2001 From: nogo <0xnogo@gmail.com> Date: Wed, 13 Nov 2024 15:10:07 +0400 Subject: [PATCH 07/21] messageMaxGas update --- .../ccip/ccipevm/gas_helpers_test.go | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/core/capabilities/ccip/ccipevm/gas_helpers_test.go b/core/capabilities/ccip/ccipevm/gas_helpers_test.go index bcc87867407..570e7377d34 100644 --- a/core/capabilities/ccip/ccipevm/gas_helpers_test.go +++ b/core/capabilities/ccip/ccipevm/gas_helpers_test.go @@ -26,17 +26,17 @@ func Test_calculateMessageMaxGas(t *testing.T) { { name: "base", args: args{dataLen: 5, numTokens: 2, extraArgs: makeExtraArgsV1(200_000), tokenGasOverhead: 10}, - want: 1_022_284, + want: 1_372_284, }, { name: "large", args: args{dataLen: 1000, numTokens: 1000, extraArgs: makeExtraArgsV1(200_000), tokenGasOverhead: 1}, - want: 346_678_520, + want: 347_028_520, }, { name: "overheadGas test 1", args: args{dataLen: 0, numTokens: 0, extraArgs: makeExtraArgsV1(200_000), tokenGasOverhead: 100}, - want: 319_920, + want: 669_920, }, { name: "overheadGas test 2", @@ -46,7 +46,7 @@ func Test_calculateMessageMaxGas(t *testing.T) { extraArgs: makeExtraArgsV1(200_000), tokenGasOverhead: 2, }, - want: 675_950, + want: 1_025_950, }, { name: "allowOOO set to true makes no difference to final gas estimate", @@ -56,7 +56,7 @@ func Test_calculateMessageMaxGas(t *testing.T) { extraArgs: makeExtraArgsV2(200_000, true), tokenGasOverhead: 100, }, - want: 1_022_464, + want: 1_372_464, }, { name: "allowOOO set to false makes no difference to final gas estimate", @@ -66,7 +66,7 @@ func Test_calculateMessageMaxGas(t *testing.T) { extraArgs: makeExtraArgsV2(200_000, false), tokenGasOverhead: 100, }, - want: 1_022_464, + want: 1_372_464, }, } @@ -104,7 +104,7 @@ func TestCalculateMaxGas(t *testing.T) { numberOfTokens: 0, extraArgs: makeExtraArgsV1(200_000), tokenGasOverhead: 10, - want: 322_992, + want: 672_992, }, { name: "maxGasOverheadGas 2", @@ -113,7 +113,7 @@ func TestCalculateMaxGas(t *testing.T) { numberOfTokens: 1, extraArgs: makeExtraArgsV1(200_000), tokenGasOverhead: 10, - want: 678_518, + want: 1_028_518, }, { name: "v2 extra args", @@ -122,7 +122,7 @@ func TestCalculateMaxGas(t *testing.T) { numberOfTokens: 1, extraArgs: makeExtraArgsV2(200_000, true), tokenGasOverhead: 10, - want: 678_518, + want: 1_028_518, }, } From 0450bb20475b98cb0c9a5de7efda4e4dda06e6ae Mon Sep 17 00:00:00 2001 From: nogo <0xnogo@gmail.com> Date: Thu, 14 Nov 2024 15:14:11 +0400 Subject: [PATCH 08/21] remodelling of fee boosting test --- .../ccip/changeset/fee_boosting_test.go | 173 ++++++++++-------- 1 file changed, 98 insertions(+), 75 deletions(-) diff --git a/deployment/ccip/changeset/fee_boosting_test.go b/deployment/ccip/changeset/fee_boosting_test.go index e41abb157d5..bc187eb13eb 100644 --- a/deployment/ccip/changeset/fee_boosting_test.go +++ b/deployment/ccip/changeset/fee_boosting_test.go @@ -8,48 +8,41 @@ import ( "github.com/test-go/testify/require" "golang.org/x/exp/maps" + "github.com/smartcontractkit/chainlink-ccip/pkg/types/ccipocr3" "github.com/smartcontractkit/chainlink/deployment" ccipdeployment "github.com/smartcontractkit/chainlink/deployment/ccip" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/router" "github.com/smartcontractkit/chainlink/v2/core/logger" ) -func Test_FeeBoosting(t *testing.T) { - t.Parallel() +type feeboostTestCase struct { + t *testing.T + sender []byte + deployedEnv ccipdeployment.DeployedEnv + onchainState ccipdeployment.CCIPOnChainState + initialPrices ccipdeployment.InitialPrices + priceFeedPrices priceFeedPrices + sourceChain, destChain uint64 +} - type priceFeedPrices struct { - linkPrice *big.Int - wethPrice *big.Int - } +type priceFeedPrices struct { + linkPrice *big.Int + wethPrice *big.Int +} - type scenario struct { - name string - initialPrices ccipdeployment.InitialPrices - priceFeedPrices priceFeedPrices - } +func Test_FeeBoosting(t *testing.T) { + t.Parallel() - setupTest := func(t *testing.T, initialPrices ccipdeployment.InitialPrices, priceFeedPrices priceFeedPrices) ( - ccipdeployment.DeployedEnv, - ccipdeployment.CCIPOnChainState, - uint64, - uint64, - ) { - e := ccipdeployment.NewMemoryEnvironmentWithJobsAndPrices(t, logger.TestLogger(t), 2, 4, - priceFeedPrices.linkPrice, priceFeedPrices.wethPrice) + setupTestEnv := func(t *testing.T, numChains int) (ccipdeployment.DeployedEnv, ccipdeployment.CCIPOnChainState, []uint64) { + e := ccipdeployment.NewMemoryEnvironmentWithJobsAndPrices( + t, logger.TestLogger(t), + numChains, 4, + deployment.E18Mult(5), big.NewInt(9e8)) state, err := ccipdeployment.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, - ) + require.Len(t, allChainSelectors, numChains) tokenConfig := ccipdeployment.NewTestTokenConfig(state.Chains[e.FeedChainSel].USDFeeds) newAddresses := deployment.NewMemoryAddressBook() @@ -66,36 +59,16 @@ func Test_FeeBoosting(t *testing.T) { state, err = ccipdeployment.LoadOnchainState(e.Env) require.NoError(t, err) - require.NoError(t, ccipdeployment.AddLane(e.Env, state, sourceChain, destChain, initialPrices)) - - return e, state, sourceChain, destChain - } - - runScenario := func(t *testing.T, s scenario) { - e, state, sourceChain, destChain := setupTest(t, s.initialPrices, s.priceFeedPrices) - - // Send message that should initially be too costly - seqNum := ccipdeployment.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, - }) - - sleepAndReplay(t, e, sourceChain, destChain) - - expectedSeqNum := make(map[uint64]uint64) - expectedSeqNum[destChain] = seqNum - startBlocks := make(map[uint64]*uint64) - - ccipdeployment.ConfirmCommitForAllWithExpectedSeqNums(t, e.Env, state, expectedSeqNum, startBlocks) - ccipdeployment.ConfirmExecWithSeqNrForAll(t, e.Env, state, expectedSeqNum, startBlocks) + return e, state, allChainSelectors } - scenarios := []scenario{ - { - name: "boost needed due to WETH price increase", + t.Run("boost needed due to WETH price increase", func(t *testing.T) { + e, state, chains := setupTestEnv(t, 2) + runFeeboostTestCase(feeboostTestCase{ + t: t, + sender: common.LeftPadBytes(e.Env.Chains[chains[0]].DeployerKey.From.Bytes(), 32), + deployedEnv: e, + onchainState: state, initialPrices: ccipdeployment.InitialPrices{ LinkPrice: deployment.E18Mult(5), WethPrice: deployment.E18Mult(9), @@ -103,40 +76,90 @@ func Test_FeeBoosting(t *testing.T) { }, priceFeedPrices: priceFeedPrices{ linkPrice: deployment.E18Mult(5), - wethPrice: big.NewInt(9.1e8), // 9 USD per ETH vs 9.1 USD per ETH during execution + wethPrice: big.NewInt(9.9e8), }, - }, - { - name: "boost needed due to LINK price decrease", + sourceChain: chains[0], + destChain: chains[1], + }) + }) + + t.Run("boost needed due to LINK price decrease", func(t *testing.T) { + e, state, chains := setupTestEnv(t, 2) + runFeeboostTestCase(feeboostTestCase{ + t: t, + sender: common.LeftPadBytes(e.Env.Chains[chains[0]].DeployerKey.From.Bytes(), 32), + deployedEnv: e, + onchainState: state, initialPrices: ccipdeployment.InitialPrices{ LinkPrice: deployment.E18Mult(5), WethPrice: deployment.E18Mult(9), GasPrice: ccipdeployment.ToPackedFee(big.NewInt(1.8e11), big.NewInt(0)), }, priceFeedPrices: priceFeedPrices{ - linkPrice: big.NewInt(4.9e18), // 5 USD per LINK vs 4.9 USD per LINK during execution + linkPrice: big.NewInt(4.5e18), wethPrice: big.NewInt(9e8), }, - }, - { - name: "boost needed due to gas price increase", + sourceChain: chains[0], + destChain: chains[1], + }) + }) + + t.Run("boost needed due to gas price increase", func(t *testing.T) { + e, state, chains := setupTestEnv(t, 2) + runFeeboostTestCase(feeboostTestCase{ + t: t, + sender: common.LeftPadBytes(e.Env.Chains[chains[0]].DeployerKey.From.Bytes(), 32), + deployedEnv: e, + onchainState: state, initialPrices: ccipdeployment.InitialPrices{ LinkPrice: deployment.E18Mult(5), WethPrice: deployment.E18Mult(9), - GasPrice: ccipdeployment.ToPackedFee(big.NewInt(1.75e11), big.NewInt(0)), // 19 gwei vs 20 gwei during execution + GasPrice: ccipdeployment.ToPackedFee(big.NewInt(1.75e11), big.NewInt(0)), }, priceFeedPrices: priceFeedPrices{ linkPrice: deployment.E18Mult(5), wethPrice: big.NewInt(9e8), }, - }, - } - - for _, s := range scenarios { - s := s // capture range variable - t.Run(s.name, func(t *testing.T) { - t.Parallel() - runScenario(t, s) + sourceChain: chains[0], + destChain: chains[1], }) - } + }) +} + +func runFeeboostTestCase(tc feeboostTestCase) { + require.NoError(tc.t, ccipdeployment.AddLane(tc.deployedEnv.Env, tc.onchainState, tc.sourceChain, tc.destChain, tc.initialPrices)) + + startBlocks := make(map[uint64]*uint64) + seqNum := ccipdeployment.TestSendRequest(tc.t, tc.deployedEnv.Env, tc.onchainState, tc.sourceChain, tc.destChain, false, router.ClientEVM2AnyMessage{ + Receiver: common.LeftPadBytes(tc.onchainState.Chains[tc.destChain].Receiver.Address().Bytes(), 32), + Data: []byte("message that needs fee boosting"), + TokenAmounts: nil, + FeeToken: common.HexToAddress("0x0"), + ExtraArgs: nil, + }) + + sleepAndReplay(tc.t, tc.deployedEnv, tc.sourceChain, tc.destChain) + + err := ccipdeployment.ConfirmCommitWithExpectedSeqNumRange( + tc.t, + tc.deployedEnv.Env.Chains[tc.sourceChain], + tc.deployedEnv.Env.Chains[tc.destChain], + tc.onchainState.Chains[tc.destChain].OffRamp, + startBlocks[tc.destChain], + ccipocr3.SeqNumRange{ + ccipocr3.SeqNum(seqNum), + ccipocr3.SeqNum(seqNum), + }, + ) + require.NoError(tc.t, err) + + err = ccipdeployment.ConfirmExecWithSeqNr( + tc.t, + tc.deployedEnv.Env.Chains[tc.sourceChain], + tc.deployedEnv.Env.Chains[tc.destChain], + tc.onchainState.Chains[tc.destChain].OffRamp, + startBlocks[tc.destChain], + seqNum, + ) + require.NoError(tc.t, err) } From da54b1aa594ae13d2dbad5aa4241d3dd9f7c39da Mon Sep 17 00:00:00 2001 From: nogo <0xnogo@gmail.com> Date: Thu, 14 Nov 2024 15:26:28 +0400 Subject: [PATCH 09/21] gomodtidy --- core/scripts/go.mod | 2 +- core/scripts/go.sum | 4 ++-- deployment/go.mod | 5 ++--- deployment/go.sum | 4 ++-- integration-tests/go.mod | 2 +- integration-tests/go.sum | 4 ++-- integration-tests/load/go.mod | 2 +- integration-tests/load/go.sum | 8 ++++---- 8 files changed, 15 insertions(+), 16 deletions(-) diff --git a/core/scripts/go.mod b/core/scripts/go.mod index 784f4b39dcf..435dbac7163 100644 --- a/core/scripts/go.mod +++ b/core/scripts/go.mod @@ -293,7 +293,7 @@ require ( github.com/shirou/gopsutil v3.21.11+incompatible // indirect github.com/shirou/gopsutil/v3 v3.24.3 // indirect github.com/smartcontractkit/ccip-owner-contracts v0.0.0-20240926212305-a6deabdfce86 // indirect - github.com/smartcontractkit/chain-selectors v1.0.27 // indirect + github.com/smartcontractkit/chain-selectors v1.0.29 // indirect github.com/smartcontractkit/chainlink-ccip v0.0.0-20241112162219-e1e443d3e488 // indirect github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241017133723-5277829bd53f // indirect github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20241018134907-a00ba3729b5e // indirect diff --git a/core/scripts/go.sum b/core/scripts/go.sum index c49bee21578..5f3d48d9f46 100644 --- a/core/scripts/go.sum +++ b/core/scripts/go.sum @@ -1094,8 +1094,8 @@ github.com/smartcontractkit/chainlink-automation v0.8.1 h1:sTc9LKpBvcKPc1JDYAmgB github.com/smartcontractkit/chainlink-automation v0.8.1/go.mod h1:Iij36PvWZ6blrdC5A/nrQUBuf3MH3JvsBB9sSyc9W08= github.com/smartcontractkit/chainlink-ccip v0.0.0-20241112162219-e1e443d3e488 h1:tDEY6ATBOR6wQkP9AjE/5KNI0dkHNoiwAN/iOq0paTE= github.com/smartcontractkit/chainlink-ccip v0.0.0-20241112162219-e1e443d3e488/go.mod h1:4adKaHNaxFsRvV/lYfqtbsWyyvIPUMLR0FdOJN/ljis= -github.com/smartcontractkit/chainlink-common v0.3.1-0.20241112140826-0e2daed34ef6 h1:yJNBWCdNL/X8+wEs3TGTBe9gssMmw5FTFxxrlo+0mVo= -github.com/smartcontractkit/chainlink-common v0.3.1-0.20241112140826-0e2daed34ef6/go.mod h1:ny87uTW6hLjCTLiBqBRNFEhETSXhHWevYlPclT5lSco= +github.com/smartcontractkit/chainlink-common v0.3.1-0.20241113142256-8a7a997a0371 h1:vnNqMaAvheZgR8IDMGw0QIV1Qen3XTh7IChwW40SNfU= +github.com/smartcontractkit/chainlink-common v0.3.1-0.20241113142256-8a7a997a0371/go.mod h1:ny87uTW6hLjCTLiBqBRNFEhETSXhHWevYlPclT5lSco= github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241017133723-5277829bd53f h1:BwrIaQIx5Iy6eT+DfLhFfK2XqjxRm74mVdlX8gbu4dw= github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241017133723-5277829bd53f/go.mod h1:wHtwSR3F1CQSJJZDQKuqaqFYnvkT+kMyget7dl8Clvo= github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20241018134907-a00ba3729b5e h1:JiETqdNM0bktAUGMc62COwXIaw3rR3M77Me6bBLG0Fg= diff --git a/deployment/go.mod b/deployment/go.mod index 0528b73dd61..da634c58a95 100644 --- a/deployment/go.mod +++ b/deployment/go.mod @@ -6,7 +6,6 @@ go 1.22.8 replace github.com/smartcontractkit/chainlink/v2 => ../ require ( - github.com/AlekSi/pointer v1.1.0 github.com/Khan/genqlient v0.7.0 github.com/Masterminds/semver/v3 v3.3.0 github.com/avast/retry-go/v4 v4.6.0 @@ -22,7 +21,7 @@ require ( github.com/rs/zerolog v1.33.0 github.com/sethvargo/go-retry v0.2.4 github.com/smartcontractkit/ccip-owner-contracts v0.0.0-20240926212305-a6deabdfce86 - github.com/smartcontractkit/chain-selectors v1.0.27 + github.com/smartcontractkit/chain-selectors v1.0.29 github.com/smartcontractkit/chainlink-ccip v0.0.0-20241112162219-e1e443d3e488 github.com/smartcontractkit/chainlink-common v0.3.1-0.20241112140826-0e2daed34ef6 github.com/smartcontractkit/chainlink-protos/job-distributor v0.4.0 @@ -35,6 +34,7 @@ require ( go.uber.org/multierr v1.11.0 go.uber.org/zap v1.27.0 golang.org/x/exp v0.0.0-20241009180824-f66d83c29e7c + golang.org/x/oauth2 v0.23.0 golang.org/x/sync v0.8.0 google.golang.org/grpc v1.67.1 google.golang.org/protobuf v1.35.1 @@ -490,7 +490,6 @@ require ( golang.org/x/crypto v0.28.0 // indirect golang.org/x/mod v0.21.0 // indirect golang.org/x/net v0.30.0 // indirect - golang.org/x/oauth2 v0.23.0 // indirect golang.org/x/sys v0.26.0 // indirect golang.org/x/term v0.25.0 // indirect golang.org/x/text v0.19.0 // indirect diff --git a/deployment/go.sum b/deployment/go.sum index 1a6480110f4..4eaf620dc85 100644 --- a/deployment/go.sum +++ b/deployment/go.sum @@ -1378,8 +1378,8 @@ github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/smartcontractkit/ccip-owner-contracts v0.0.0-20240926212305-a6deabdfce86 h1:qQH6fZZe31nBAG6INHph3z5ysDTPptyu0TR9uoJ1+ok= github.com/smartcontractkit/ccip-owner-contracts v0.0.0-20240926212305-a6deabdfce86/go.mod h1:WtWOoVQQEHxRHL2hNmuRrvDfYfQG/CioFNoa9Rr2mBE= -github.com/smartcontractkit/chain-selectors v1.0.27 h1:VE/ftX9Aae4gnw67yR1raKi+30iWKL/sWq8uyiLHM8k= -github.com/smartcontractkit/chain-selectors v1.0.27/go.mod h1:d4Hi+E1zqjy9HqMkjBE5q1vcG9VGgxf5VxiRHfzi2kE= +github.com/smartcontractkit/chain-selectors v1.0.29 h1:aZ9+OoUSMn4nqnissHtDvDoKR7JONfDqTHX3MHYIUIE= +github.com/smartcontractkit/chain-selectors v1.0.29/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-20241112162219-e1e443d3e488 h1:tDEY6ATBOR6wQkP9AjE/5KNI0dkHNoiwAN/iOq0paTE= diff --git a/integration-tests/go.mod b/integration-tests/go.mod index ab9d0e4eae5..98c33e38465 100644 --- a/integration-tests/go.mod +++ b/integration-tests/go.mod @@ -36,7 +36,7 @@ require ( github.com/slack-go/slack v0.15.0 github.com/smartcontractkit/chain-selectors v1.0.29 github.com/smartcontractkit/chainlink-automation v0.8.1 - github.com/smartcontractkit/chainlink-ccip v0.0.0-20241112095015-3e85d9f1898b + github.com/smartcontractkit/chainlink-ccip v0.0.0-20241112162219-e1e443d3e488 github.com/smartcontractkit/chainlink-common v0.3.1-0.20241112140826-0e2daed34ef6 github.com/smartcontractkit/chainlink-protos/job-distributor v0.4.0 github.com/smartcontractkit/chainlink-testing-framework/havoc v1.50.2 diff --git a/integration-tests/go.sum b/integration-tests/go.sum index 2d5385f60d7..276a2ad56b8 100644 --- a/integration-tests/go.sum +++ b/integration-tests/go.sum @@ -1417,8 +1417,8 @@ github.com/smartcontractkit/chainlink-protos/job-distributor v0.4.0 h1:1xTm8UGeD github.com/smartcontractkit/chainlink-protos/job-distributor v0.4.0/go.mod h1:/dVVLXrsp+V0AbcYGJo3XMzKg3CkELsweA/TTopCsKE= github.com/smartcontractkit/chainlink-protos/orchestrator v0.3.0 h1:PBUaFfPLm+Efq7H9kdfGBivH+QhJ6vB5EZTR/sCZsxI= github.com/smartcontractkit/chainlink-protos/orchestrator v0.3.0/go.mod h1:m/A3lqD7ms/RsQ9BT5P2uceYY0QX5mIt4KQxT2G6qEo= -github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241104202120-39cabce465f6 h1:YsE0uS6S10oAWnFbjNDc7tN9JrWYjvyqMnTSbTSgl00= -github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241104202120-39cabce465f6/go.mod h1:iZugccCLpPWtcGiR/8gurre2j3RtyKnqd1FcVR0NzQw= +github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241112145241-efd6780f6930 h1:blu++xbH/NSb+ii5hI4jczwojZ7Hc1ERXjpt/krYy9c= +github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241112145241-efd6780f6930/go.mod h1:mGmRvlk54ufCufV4EBWizOGtXoXfePoFAuYEVC8EwdY= github.com/smartcontractkit/chainlink-starknet/relayer v0.1.1-0.20241017135645-176a23722fd8 h1:B4DFdk6MGcQnoCjjMBCx7Z+GWQpxRWJ4O8W/dVJyWGA= github.com/smartcontractkit/chainlink-starknet/relayer v0.1.1-0.20241017135645-176a23722fd8/go.mod h1:WkBqgBo+g34Gm5vWkDDl8Fh3Mzd7bF5hXp7rryg0t5o= github.com/smartcontractkit/chainlink-testing-framework/havoc v1.50.2 h1:GDGrC5OGiV0RyM1znYWehSQXyZQWTOzrEeJRYmysPCE= diff --git a/integration-tests/load/go.mod b/integration-tests/load/go.mod index ffea2f01648..7a346e3a7d9 100644 --- a/integration-tests/load/go.mod +++ b/integration-tests/load/go.mod @@ -425,7 +425,7 @@ require ( github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20241018134907-a00ba3729b5e // indirect github.com/smartcontractkit/chainlink-feeds v0.1.1 // indirect github.com/smartcontractkit/chainlink-protos/orchestrator v0.3.0 // indirect - github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241104202120-39cabce465f6 // indirect + github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241112145241-efd6780f6930 // indirect github.com/smartcontractkit/chainlink-starknet/relayer v0.1.1-0.20241017135645-176a23722fd8 // indirect github.com/smartcontractkit/chainlink-testing-framework/lib/grafana v1.50.0 // indirect github.com/smartcontractkit/libocr v0.0.0-20241007185508-adbe57025f12 // indirect diff --git a/integration-tests/load/go.sum b/integration-tests/load/go.sum index 2a052602b8d..090a3d9477d 100644 --- a/integration-tests/load/go.sum +++ b/integration-tests/load/go.sum @@ -1394,8 +1394,8 @@ github.com/smartcontractkit/chainlink-automation v0.8.1 h1:sTc9LKpBvcKPc1JDYAmgB github.com/smartcontractkit/chainlink-automation v0.8.1/go.mod h1:Iij36PvWZ6blrdC5A/nrQUBuf3MH3JvsBB9sSyc9W08= github.com/smartcontractkit/chainlink-ccip v0.0.0-20241112162219-e1e443d3e488 h1:tDEY6ATBOR6wQkP9AjE/5KNI0dkHNoiwAN/iOq0paTE= github.com/smartcontractkit/chainlink-ccip v0.0.0-20241112162219-e1e443d3e488/go.mod h1:4adKaHNaxFsRvV/lYfqtbsWyyvIPUMLR0FdOJN/ljis= -github.com/smartcontractkit/chainlink-common v0.3.1-0.20241112140826-0e2daed34ef6 h1:yJNBWCdNL/X8+wEs3TGTBe9gssMmw5FTFxxrlo+0mVo= -github.com/smartcontractkit/chainlink-common v0.3.1-0.20241112140826-0e2daed34ef6/go.mod h1:ny87uTW6hLjCTLiBqBRNFEhETSXhHWevYlPclT5lSco= +github.com/smartcontractkit/chainlink-common v0.3.1-0.20241113142256-8a7a997a0371 h1:vnNqMaAvheZgR8IDMGw0QIV1Qen3XTh7IChwW40SNfU= +github.com/smartcontractkit/chainlink-common v0.3.1-0.20241113142256-8a7a997a0371/go.mod h1:ny87uTW6hLjCTLiBqBRNFEhETSXhHWevYlPclT5lSco= github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241017133723-5277829bd53f h1:BwrIaQIx5Iy6eT+DfLhFfK2XqjxRm74mVdlX8gbu4dw= github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241017133723-5277829bd53f/go.mod h1:wHtwSR3F1CQSJJZDQKuqaqFYnvkT+kMyget7dl8Clvo= github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20241018134907-a00ba3729b5e h1:JiETqdNM0bktAUGMc62COwXIaw3rR3M77Me6bBLG0Fg= @@ -1404,8 +1404,8 @@ github.com/smartcontractkit/chainlink-feeds v0.1.1 h1:JzvUOM/OgGQA1sOqTXXl52R6An github.com/smartcontractkit/chainlink-feeds v0.1.1/go.mod h1:55EZ94HlKCfAsUiKUTNI7QlE/3d3IwTlsU3YNa/nBb4= github.com/smartcontractkit/chainlink-protos/orchestrator v0.3.0 h1:PBUaFfPLm+Efq7H9kdfGBivH+QhJ6vB5EZTR/sCZsxI= github.com/smartcontractkit/chainlink-protos/orchestrator v0.3.0/go.mod h1:m/A3lqD7ms/RsQ9BT5P2uceYY0QX5mIt4KQxT2G6qEo= -github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241104202120-39cabce465f6 h1:YsE0uS6S10oAWnFbjNDc7tN9JrWYjvyqMnTSbTSgl00= -github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241104202120-39cabce465f6/go.mod h1:iZugccCLpPWtcGiR/8gurre2j3RtyKnqd1FcVR0NzQw= +github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241112145241-efd6780f6930 h1:blu++xbH/NSb+ii5hI4jczwojZ7Hc1ERXjpt/krYy9c= +github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241112145241-efd6780f6930/go.mod h1:mGmRvlk54ufCufV4EBWizOGtXoXfePoFAuYEVC8EwdY= github.com/smartcontractkit/chainlink-starknet/relayer v0.1.1-0.20241017135645-176a23722fd8 h1:B4DFdk6MGcQnoCjjMBCx7Z+GWQpxRWJ4O8W/dVJyWGA= github.com/smartcontractkit/chainlink-starknet/relayer v0.1.1-0.20241017135645-176a23722fd8/go.mod h1:WkBqgBo+g34Gm5vWkDDl8Fh3Mzd7bF5hXp7rryg0t5o= github.com/smartcontractkit/chainlink-testing-framework/havoc v1.50.2 h1:GDGrC5OGiV0RyM1znYWehSQXyZQWTOzrEeJRYmysPCE= From 1624e2e179a4ea8bd359bb12988eecf6aeb5c163 Mon Sep 17 00:00:00 2001 From: nogo <0xnogo@gmail.com> Date: Thu, 14 Nov 2024 15:31:51 +0400 Subject: [PATCH 10/21] fixing --- .../ccip/changeset/fee_boosting_test.go | 27 +++---------------- deployment/ccip/test_helpers.go | 2 +- 2 files changed, 5 insertions(+), 24 deletions(-) diff --git a/deployment/ccip/changeset/fee_boosting_test.go b/deployment/ccip/changeset/fee_boosting_test.go index bc187eb13eb..8a3ed4e7048 100644 --- a/deployment/ccip/changeset/fee_boosting_test.go +++ b/deployment/ccip/changeset/fee_boosting_test.go @@ -8,7 +8,6 @@ import ( "github.com/test-go/testify/require" "golang.org/x/exp/maps" - "github.com/smartcontractkit/chainlink-ccip/pkg/types/ccipocr3" "github.com/smartcontractkit/chainlink/deployment" ccipdeployment "github.com/smartcontractkit/chainlink/deployment/ccip" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/router" @@ -130,6 +129,7 @@ func runFeeboostTestCase(tc feeboostTestCase) { require.NoError(tc.t, ccipdeployment.AddLane(tc.deployedEnv.Env, tc.onchainState, tc.sourceChain, tc.destChain, tc.initialPrices)) startBlocks := make(map[uint64]*uint64) + expectedSeqNum := make(map[uint64]uint64) seqNum := ccipdeployment.TestSendRequest(tc.t, tc.deployedEnv.Env, tc.onchainState, tc.sourceChain, tc.destChain, false, router.ClientEVM2AnyMessage{ Receiver: common.LeftPadBytes(tc.onchainState.Chains[tc.destChain].Receiver.Address().Bytes(), 32), Data: []byte("message that needs fee boosting"), @@ -137,29 +137,10 @@ func runFeeboostTestCase(tc feeboostTestCase) { FeeToken: common.HexToAddress("0x0"), ExtraArgs: nil, }) + expectedSeqNum[tc.destChain] = seqNum sleepAndReplay(tc.t, tc.deployedEnv, tc.sourceChain, tc.destChain) - err := ccipdeployment.ConfirmCommitWithExpectedSeqNumRange( - tc.t, - tc.deployedEnv.Env.Chains[tc.sourceChain], - tc.deployedEnv.Env.Chains[tc.destChain], - tc.onchainState.Chains[tc.destChain].OffRamp, - startBlocks[tc.destChain], - ccipocr3.SeqNumRange{ - ccipocr3.SeqNum(seqNum), - ccipocr3.SeqNum(seqNum), - }, - ) - require.NoError(tc.t, err) - - err = ccipdeployment.ConfirmExecWithSeqNr( - tc.t, - tc.deployedEnv.Env.Chains[tc.sourceChain], - tc.deployedEnv.Env.Chains[tc.destChain], - tc.onchainState.Chains[tc.destChain].OffRamp, - startBlocks[tc.destChain], - seqNum, - ) - require.NoError(tc.t, err) + ccipdeployment.ConfirmCommitForAllWithExpectedSeqNums(tc.t, tc.deployedEnv.Env, tc.onchainState, expectedSeqNum, startBlocks) + ccipdeployment.ConfirmExecWithSeqNrForAll(tc.t, tc.deployedEnv.Env, tc.onchainState, expectedSeqNum, startBlocks) } diff --git a/deployment/ccip/test_helpers.go b/deployment/ccip/test_helpers.go index 64903d479a0..9f22de366c9 100644 --- a/deployment/ccip/test_helpers.go +++ b/deployment/ccip/test_helpers.go @@ -186,7 +186,7 @@ func NewMemoryEnvironment( ab := deployment.NewMemoryAddressBook() crConfig := DeployTestContracts(t, lggr, ab, homeChainSel, feedSel, chains, linkPrice, wethPrice) - nodes := memory.NewNodes(t, zapcore.InfoLevel, evmChains, numNodes, 1, crConfig) + nodes := memory.NewNodes(t, zapcore.InfoLevel, chains, numNodes, 1, crConfig) for _, node := range nodes { require.NoError(t, node.App.Start(ctx)) t.Cleanup(func() { From fa9ce1fe4bbfed076030201ea15921b5207dea7f Mon Sep 17 00:00:00 2001 From: nogo <0xnogo@gmail.com> Date: Thu, 14 Nov 2024 15:53:19 +0400 Subject: [PATCH 11/21] fixes --- deployment/ccip/changeset/fee_boosting_test.go | 9 +++++++++ deployment/go.mod | 2 +- deployment/go.sum | 4 ++-- go.mod | 2 +- go.sum | 4 ++-- integration-tests/go.mod | 2 +- integration-tests/go.sum | 4 ++-- 7 files changed, 18 insertions(+), 9 deletions(-) diff --git a/deployment/ccip/changeset/fee_boosting_test.go b/deployment/ccip/changeset/fee_boosting_test.go index 8a3ed4e7048..7db388aaac8 100644 --- a/deployment/ccip/changeset/fee_boosting_test.go +++ b/deployment/ccip/changeset/fee_boosting_test.go @@ -3,6 +3,7 @@ package changeset import ( "math/big" "testing" + "time" "github.com/ethereum/go-ethereum/common" "github.com/test-go/testify/require" @@ -144,3 +145,11 @@ func runFeeboostTestCase(tc feeboostTestCase) { ccipdeployment.ConfirmCommitForAllWithExpectedSeqNums(tc.t, tc.deployedEnv.Env, tc.onchainState, expectedSeqNum, startBlocks) ccipdeployment.ConfirmExecWithSeqNrForAll(tc.t, tc.deployedEnv.Env, tc.onchainState, expectedSeqNum, startBlocks) } + +func sleepAndReplay(t *testing.T, e ccipdeployment.DeployedEnv, sourceChain, destChain uint64) { + time.Sleep(30 * time.Second) + replayBlocks := make(map[uint64]uint64) + replayBlocks[sourceChain] = 1 + replayBlocks[destChain] = 1 + ccipdeployment.ReplayLogs(t, e.Env.Offchain, replayBlocks) +} diff --git a/deployment/go.mod b/deployment/go.mod index da634c58a95..73aaefb87b2 100644 --- a/deployment/go.mod +++ b/deployment/go.mod @@ -23,7 +23,7 @@ require ( github.com/smartcontractkit/ccip-owner-contracts v0.0.0-20240926212305-a6deabdfce86 github.com/smartcontractkit/chain-selectors v1.0.29 github.com/smartcontractkit/chainlink-ccip v0.0.0-20241112162219-e1e443d3e488 - github.com/smartcontractkit/chainlink-common v0.3.1-0.20241112140826-0e2daed34ef6 + github.com/smartcontractkit/chainlink-common v0.3.1-0.20241113142256-8a7a997a0371 github.com/smartcontractkit/chainlink-protos/job-distributor v0.4.0 github.com/smartcontractkit/chainlink-testing-framework/lib v1.50.13 github.com/smartcontractkit/chainlink/v2 v2.0.0-00010101000000-000000000000 diff --git a/deployment/go.sum b/deployment/go.sum index 4eaf620dc85..88820cee823 100644 --- a/deployment/go.sum +++ b/deployment/go.sum @@ -1384,8 +1384,8 @@ github.com/smartcontractkit/chainlink-automation v0.8.1 h1:sTc9LKpBvcKPc1JDYAmgB github.com/smartcontractkit/chainlink-automation v0.8.1/go.mod h1:Iij36PvWZ6blrdC5A/nrQUBuf3MH3JvsBB9sSyc9W08= github.com/smartcontractkit/chainlink-ccip v0.0.0-20241112162219-e1e443d3e488 h1:tDEY6ATBOR6wQkP9AjE/5KNI0dkHNoiwAN/iOq0paTE= github.com/smartcontractkit/chainlink-ccip v0.0.0-20241112162219-e1e443d3e488/go.mod h1:4adKaHNaxFsRvV/lYfqtbsWyyvIPUMLR0FdOJN/ljis= -github.com/smartcontractkit/chainlink-common v0.3.1-0.20241112140826-0e2daed34ef6 h1:yJNBWCdNL/X8+wEs3TGTBe9gssMmw5FTFxxrlo+0mVo= -github.com/smartcontractkit/chainlink-common v0.3.1-0.20241112140826-0e2daed34ef6/go.mod h1:ny87uTW6hLjCTLiBqBRNFEhETSXhHWevYlPclT5lSco= +github.com/smartcontractkit/chainlink-common v0.3.1-0.20241113142256-8a7a997a0371 h1:vnNqMaAvheZgR8IDMGw0QIV1Qen3XTh7IChwW40SNfU= +github.com/smartcontractkit/chainlink-common v0.3.1-0.20241113142256-8a7a997a0371/go.mod h1:ny87uTW6hLjCTLiBqBRNFEhETSXhHWevYlPclT5lSco= github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241017133723-5277829bd53f h1:BwrIaQIx5Iy6eT+DfLhFfK2XqjxRm74mVdlX8gbu4dw= github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241017133723-5277829bd53f/go.mod h1:wHtwSR3F1CQSJJZDQKuqaqFYnvkT+kMyget7dl8Clvo= github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20241018134907-a00ba3729b5e h1:JiETqdNM0bktAUGMc62COwXIaw3rR3M77Me6bBLG0Fg= diff --git a/go.mod b/go.mod index 93faad41eaf..8d875854935 100644 --- a/go.mod +++ b/go.mod @@ -77,7 +77,7 @@ require ( github.com/smartcontractkit/chain-selectors v1.0.29 github.com/smartcontractkit/chainlink-automation v0.8.1 github.com/smartcontractkit/chainlink-ccip v0.0.0-20241112162219-e1e443d3e488 - github.com/smartcontractkit/chainlink-common v0.3.1-0.20241112140826-0e2daed34ef6 + github.com/smartcontractkit/chainlink-common v0.3.1-0.20241113142256-8a7a997a0371 github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241017133723-5277829bd53f github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20241018134907-a00ba3729b5e github.com/smartcontractkit/chainlink-feeds v0.1.1 diff --git a/go.sum b/go.sum index baba0112b98..8ed6cbf99ac 100644 --- a/go.sum +++ b/go.sum @@ -1078,8 +1078,8 @@ github.com/smartcontractkit/chainlink-automation v0.8.1 h1:sTc9LKpBvcKPc1JDYAmgB github.com/smartcontractkit/chainlink-automation v0.8.1/go.mod h1:Iij36PvWZ6blrdC5A/nrQUBuf3MH3JvsBB9sSyc9W08= github.com/smartcontractkit/chainlink-ccip v0.0.0-20241112162219-e1e443d3e488 h1:tDEY6ATBOR6wQkP9AjE/5KNI0dkHNoiwAN/iOq0paTE= github.com/smartcontractkit/chainlink-ccip v0.0.0-20241112162219-e1e443d3e488/go.mod h1:4adKaHNaxFsRvV/lYfqtbsWyyvIPUMLR0FdOJN/ljis= -github.com/smartcontractkit/chainlink-common v0.3.1-0.20241112140826-0e2daed34ef6 h1:yJNBWCdNL/X8+wEs3TGTBe9gssMmw5FTFxxrlo+0mVo= -github.com/smartcontractkit/chainlink-common v0.3.1-0.20241112140826-0e2daed34ef6/go.mod h1:ny87uTW6hLjCTLiBqBRNFEhETSXhHWevYlPclT5lSco= +github.com/smartcontractkit/chainlink-common v0.3.1-0.20241113142256-8a7a997a0371 h1:vnNqMaAvheZgR8IDMGw0QIV1Qen3XTh7IChwW40SNfU= +github.com/smartcontractkit/chainlink-common v0.3.1-0.20241113142256-8a7a997a0371/go.mod h1:ny87uTW6hLjCTLiBqBRNFEhETSXhHWevYlPclT5lSco= github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241017133723-5277829bd53f h1:BwrIaQIx5Iy6eT+DfLhFfK2XqjxRm74mVdlX8gbu4dw= github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241017133723-5277829bd53f/go.mod h1:wHtwSR3F1CQSJJZDQKuqaqFYnvkT+kMyget7dl8Clvo= github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20241018134907-a00ba3729b5e h1:JiETqdNM0bktAUGMc62COwXIaw3rR3M77Me6bBLG0Fg= diff --git a/integration-tests/go.mod b/integration-tests/go.mod index 98c33e38465..670c5d87744 100644 --- a/integration-tests/go.mod +++ b/integration-tests/go.mod @@ -37,7 +37,7 @@ require ( github.com/smartcontractkit/chain-selectors v1.0.29 github.com/smartcontractkit/chainlink-automation v0.8.1 github.com/smartcontractkit/chainlink-ccip v0.0.0-20241112162219-e1e443d3e488 - github.com/smartcontractkit/chainlink-common v0.3.1-0.20241112140826-0e2daed34ef6 + github.com/smartcontractkit/chainlink-common v0.3.1-0.20241113142256-8a7a997a0371 github.com/smartcontractkit/chainlink-protos/job-distributor v0.4.0 github.com/smartcontractkit/chainlink-testing-framework/havoc v1.50.2 github.com/smartcontractkit/chainlink-testing-framework/lib v1.50.13 diff --git a/integration-tests/go.sum b/integration-tests/go.sum index 276a2ad56b8..6d37e7ab643 100644 --- a/integration-tests/go.sum +++ b/integration-tests/go.sum @@ -1405,8 +1405,8 @@ github.com/smartcontractkit/chainlink-automation v0.8.1 h1:sTc9LKpBvcKPc1JDYAmgB github.com/smartcontractkit/chainlink-automation v0.8.1/go.mod h1:Iij36PvWZ6blrdC5A/nrQUBuf3MH3JvsBB9sSyc9W08= github.com/smartcontractkit/chainlink-ccip v0.0.0-20241112162219-e1e443d3e488 h1:tDEY6ATBOR6wQkP9AjE/5KNI0dkHNoiwAN/iOq0paTE= github.com/smartcontractkit/chainlink-ccip v0.0.0-20241112162219-e1e443d3e488/go.mod h1:4adKaHNaxFsRvV/lYfqtbsWyyvIPUMLR0FdOJN/ljis= -github.com/smartcontractkit/chainlink-common v0.3.1-0.20241112140826-0e2daed34ef6 h1:yJNBWCdNL/X8+wEs3TGTBe9gssMmw5FTFxxrlo+0mVo= -github.com/smartcontractkit/chainlink-common v0.3.1-0.20241112140826-0e2daed34ef6/go.mod h1:ny87uTW6hLjCTLiBqBRNFEhETSXhHWevYlPclT5lSco= +github.com/smartcontractkit/chainlink-common v0.3.1-0.20241113142256-8a7a997a0371 h1:vnNqMaAvheZgR8IDMGw0QIV1Qen3XTh7IChwW40SNfU= +github.com/smartcontractkit/chainlink-common v0.3.1-0.20241113142256-8a7a997a0371/go.mod h1:ny87uTW6hLjCTLiBqBRNFEhETSXhHWevYlPclT5lSco= github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241017133723-5277829bd53f h1:BwrIaQIx5Iy6eT+DfLhFfK2XqjxRm74mVdlX8gbu4dw= github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241017133723-5277829bd53f/go.mod h1:wHtwSR3F1CQSJJZDQKuqaqFYnvkT+kMyget7dl8Clvo= github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20241018134907-a00ba3729b5e h1:JiETqdNM0bktAUGMc62COwXIaw3rR3M77Me6bBLG0Fg= From 5cf1c5c1dedb37d8b7c806ad27754fa8b28ade44 Mon Sep 17 00:00:00 2001 From: nogo <0xnogo@gmail.com> Date: Thu, 14 Nov 2024 16:05:28 +0400 Subject: [PATCH 12/21] reset gomod --- core/scripts/go.mod | 4 ++-- core/scripts/go.sum | 4 ++-- deployment/go.mod | 2 +- deployment/go.sum | 4 ++-- go.mod | 4 ++-- go.sum | 10 +++++----- integration-tests/go.mod | 2 +- integration-tests/go.sum | 4 ++-- integration-tests/load/go.mod | 2 +- integration-tests/load/go.sum | 4 ++-- 10 files changed, 20 insertions(+), 20 deletions(-) diff --git a/core/scripts/go.mod b/core/scripts/go.mod index 435dbac7163..c6f382bdb3f 100644 --- a/core/scripts/go.mod +++ b/core/scripts/go.mod @@ -26,7 +26,7 @@ require ( github.com/smartcontractkit/chainlink-automation v0.8.1 github.com/smartcontractkit/chainlink-common v0.3.1-0.20241113142256-8a7a997a0371 github.com/smartcontractkit/chainlink/deployment v0.0.0-00010101000000-000000000000 - github.com/smartcontractkit/chainlink/v2 v2.0.0-00010101000000-000000000000 + github.com/smartcontractkit/chainlink/v2 v2.14.0-mercury-20240807.0.20241106193309-5560cd76211a github.com/smartcontractkit/libocr v0.0.0-20241007185508-adbe57025f12 github.com/spf13/cobra v1.8.1 github.com/spf13/viper v1.19.0 @@ -300,7 +300,7 @@ require ( github.com/smartcontractkit/chainlink-feeds v0.1.1 // indirect github.com/smartcontractkit/chainlink-protos/job-distributor v0.4.0 // indirect github.com/smartcontractkit/chainlink-protos/orchestrator v0.3.0 // indirect - github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241104202120-39cabce465f6 // indirect + github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241112213949-65ae13752669 // indirect github.com/smartcontractkit/chainlink-starknet/relayer v0.1.1-0.20241017135645-176a23722fd8 // indirect github.com/smartcontractkit/grpc-proxy v0.0.0-20240830132753-a7e17fec5ab7 // indirect github.com/smartcontractkit/tdh2/go/ocr2/decryptionplugin v0.0.0-20241009055228-33d0c0bf38de // indirect diff --git a/core/scripts/go.sum b/core/scripts/go.sum index 5f3d48d9f46..e1620ea6db0 100644 --- a/core/scripts/go.sum +++ b/core/scripts/go.sum @@ -1106,8 +1106,8 @@ github.com/smartcontractkit/chainlink-protos/job-distributor v0.4.0 h1:1xTm8UGeD github.com/smartcontractkit/chainlink-protos/job-distributor v0.4.0/go.mod h1:/dVVLXrsp+V0AbcYGJo3XMzKg3CkELsweA/TTopCsKE= github.com/smartcontractkit/chainlink-protos/orchestrator v0.3.0 h1:PBUaFfPLm+Efq7H9kdfGBivH+QhJ6vB5EZTR/sCZsxI= github.com/smartcontractkit/chainlink-protos/orchestrator v0.3.0/go.mod h1:m/A3lqD7ms/RsQ9BT5P2uceYY0QX5mIt4KQxT2G6qEo= -github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241104202120-39cabce465f6 h1:YsE0uS6S10oAWnFbjNDc7tN9JrWYjvyqMnTSbTSgl00= -github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241104202120-39cabce465f6/go.mod h1:iZugccCLpPWtcGiR/8gurre2j3RtyKnqd1FcVR0NzQw= +github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241112213949-65ae13752669 h1:CBQ9ORUtGUvCr3dAm/qjpdHlYuB1SRIwtYw5LV8SLys= +github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241112213949-65ae13752669/go.mod h1:mGmRvlk54ufCufV4EBWizOGtXoXfePoFAuYEVC8EwdY= github.com/smartcontractkit/chainlink-starknet/relayer v0.1.1-0.20241017135645-176a23722fd8 h1:B4DFdk6MGcQnoCjjMBCx7Z+GWQpxRWJ4O8W/dVJyWGA= github.com/smartcontractkit/chainlink-starknet/relayer v0.1.1-0.20241017135645-176a23722fd8/go.mod h1:WkBqgBo+g34Gm5vWkDDl8Fh3Mzd7bF5hXp7rryg0t5o= github.com/smartcontractkit/grpc-proxy v0.0.0-20240830132753-a7e17fec5ab7 h1:12ijqMM9tvYVEm+nR826WsrNi6zCKpwBhuApq127wHs= diff --git a/deployment/go.mod b/deployment/go.mod index 73aaefb87b2..b76347695d6 100644 --- a/deployment/go.mod +++ b/deployment/go.mod @@ -405,7 +405,7 @@ require ( github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20241018134907-a00ba3729b5e // indirect github.com/smartcontractkit/chainlink-feeds v0.1.1 // indirect github.com/smartcontractkit/chainlink-protos/orchestrator v0.3.0 // indirect - github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241104202120-39cabce465f6 // indirect + github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241112213949-65ae13752669 // indirect github.com/smartcontractkit/chainlink-starknet/relayer v0.1.1-0.20241017135645-176a23722fd8 // indirect github.com/smartcontractkit/chainlink-testing-framework/lib/grafana v1.50.0 // indirect github.com/smartcontractkit/chainlink-testing-framework/seth v1.50.5 // indirect diff --git a/deployment/go.sum b/deployment/go.sum index 88820cee823..011dae51637 100644 --- a/deployment/go.sum +++ b/deployment/go.sum @@ -1396,8 +1396,8 @@ github.com/smartcontractkit/chainlink-protos/job-distributor v0.4.0 h1:1xTm8UGeD github.com/smartcontractkit/chainlink-protos/job-distributor v0.4.0/go.mod h1:/dVVLXrsp+V0AbcYGJo3XMzKg3CkELsweA/TTopCsKE= github.com/smartcontractkit/chainlink-protos/orchestrator v0.3.0 h1:PBUaFfPLm+Efq7H9kdfGBivH+QhJ6vB5EZTR/sCZsxI= github.com/smartcontractkit/chainlink-protos/orchestrator v0.3.0/go.mod h1:m/A3lqD7ms/RsQ9BT5P2uceYY0QX5mIt4KQxT2G6qEo= -github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241104202120-39cabce465f6 h1:YsE0uS6S10oAWnFbjNDc7tN9JrWYjvyqMnTSbTSgl00= -github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241104202120-39cabce465f6/go.mod h1:iZugccCLpPWtcGiR/8gurre2j3RtyKnqd1FcVR0NzQw= +github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241112213949-65ae13752669 h1:CBQ9ORUtGUvCr3dAm/qjpdHlYuB1SRIwtYw5LV8SLys= +github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241112213949-65ae13752669/go.mod h1:mGmRvlk54ufCufV4EBWizOGtXoXfePoFAuYEVC8EwdY= github.com/smartcontractkit/chainlink-starknet/relayer v0.1.1-0.20241017135645-176a23722fd8 h1:B4DFdk6MGcQnoCjjMBCx7Z+GWQpxRWJ4O8W/dVJyWGA= github.com/smartcontractkit/chainlink-starknet/relayer v0.1.1-0.20241017135645-176a23722fd8/go.mod h1:WkBqgBo+g34Gm5vWkDDl8Fh3Mzd7bF5hXp7rryg0t5o= github.com/smartcontractkit/chainlink-testing-framework/lib v1.50.13 h1:T0kbw07Vb6xUyA9MIJZfErMgWseWi1zf7cYvRpoq7ug= diff --git a/go.mod b/go.mod index 8d875854935..2b6f03333c0 100644 --- a/go.mod +++ b/go.mod @@ -76,13 +76,13 @@ require ( github.com/shopspring/decimal v1.4.0 github.com/smartcontractkit/chain-selectors v1.0.29 github.com/smartcontractkit/chainlink-automation v0.8.1 - github.com/smartcontractkit/chainlink-ccip v0.0.0-20241112162219-e1e443d3e488 + github.com/smartcontractkit/chainlink-ccip v0.0.0-20241112095015-3e85d9f1898b github.com/smartcontractkit/chainlink-common v0.3.1-0.20241113142256-8a7a997a0371 github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241017133723-5277829bd53f github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20241018134907-a00ba3729b5e github.com/smartcontractkit/chainlink-feeds v0.1.1 github.com/smartcontractkit/chainlink-protos/orchestrator v0.3.0 - github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241104202120-39cabce465f6 + github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241112213949-65ae13752669 github.com/smartcontractkit/chainlink-starknet/relayer v0.1.1-0.20241017135645-176a23722fd8 github.com/smartcontractkit/libocr v0.0.0-20241007185508-adbe57025f12 github.com/smartcontractkit/tdh2/go/ocr2/decryptionplugin v0.0.0-20241009055228-33d0c0bf38de diff --git a/go.sum b/go.sum index 8ed6cbf99ac..70e7eee0704 100644 --- a/go.sum +++ b/go.sum @@ -1076,8 +1076,8 @@ github.com/smartcontractkit/chain-selectors v1.0.29 h1:aZ9+OoUSMn4nqnissHtDvDoKR github.com/smartcontractkit/chain-selectors v1.0.29/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-20241112162219-e1e443d3e488 h1:tDEY6ATBOR6wQkP9AjE/5KNI0dkHNoiwAN/iOq0paTE= -github.com/smartcontractkit/chainlink-ccip v0.0.0-20241112162219-e1e443d3e488/go.mod h1:4adKaHNaxFsRvV/lYfqtbsWyyvIPUMLR0FdOJN/ljis= +github.com/smartcontractkit/chainlink-ccip v0.0.0-20241112095015-3e85d9f1898b h1:4kmZtaQ4fXwduHnw9xk5VmiIOW4nHg/Mx6iidlZJt5o= +github.com/smartcontractkit/chainlink-ccip v0.0.0-20241112095015-3e85d9f1898b/go.mod h1:4adKaHNaxFsRvV/lYfqtbsWyyvIPUMLR0FdOJN/ljis= github.com/smartcontractkit/chainlink-common v0.3.1-0.20241113142256-8a7a997a0371 h1:vnNqMaAvheZgR8IDMGw0QIV1Qen3XTh7IChwW40SNfU= github.com/smartcontractkit/chainlink-common v0.3.1-0.20241113142256-8a7a997a0371/go.mod h1:ny87uTW6hLjCTLiBqBRNFEhETSXhHWevYlPclT5lSco= github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241017133723-5277829bd53f h1:BwrIaQIx5Iy6eT+DfLhFfK2XqjxRm74mVdlX8gbu4dw= @@ -1088,8 +1088,8 @@ github.com/smartcontractkit/chainlink-feeds v0.1.1 h1:JzvUOM/OgGQA1sOqTXXl52R6An github.com/smartcontractkit/chainlink-feeds v0.1.1/go.mod h1:55EZ94HlKCfAsUiKUTNI7QlE/3d3IwTlsU3YNa/nBb4= github.com/smartcontractkit/chainlink-protos/orchestrator v0.3.0 h1:PBUaFfPLm+Efq7H9kdfGBivH+QhJ6vB5EZTR/sCZsxI= github.com/smartcontractkit/chainlink-protos/orchestrator v0.3.0/go.mod h1:m/A3lqD7ms/RsQ9BT5P2uceYY0QX5mIt4KQxT2G6qEo= -github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241104202120-39cabce465f6 h1:YsE0uS6S10oAWnFbjNDc7tN9JrWYjvyqMnTSbTSgl00= -github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241104202120-39cabce465f6/go.mod h1:iZugccCLpPWtcGiR/8gurre2j3RtyKnqd1FcVR0NzQw= +github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241112213949-65ae13752669 h1:CBQ9ORUtGUvCr3dAm/qjpdHlYuB1SRIwtYw5LV8SLys= +github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241112213949-65ae13752669/go.mod h1:mGmRvlk54ufCufV4EBWizOGtXoXfePoFAuYEVC8EwdY= github.com/smartcontractkit/chainlink-starknet/relayer v0.1.1-0.20241017135645-176a23722fd8 h1:B4DFdk6MGcQnoCjjMBCx7Z+GWQpxRWJ4O8W/dVJyWGA= github.com/smartcontractkit/chainlink-starknet/relayer v0.1.1-0.20241017135645-176a23722fd8/go.mod h1:WkBqgBo+g34Gm5vWkDDl8Fh3Mzd7bF5hXp7rryg0t5o= github.com/smartcontractkit/grpc-proxy v0.0.0-20240830132753-a7e17fec5ab7 h1:12ijqMM9tvYVEm+nR826WsrNi6zCKpwBhuApq127wHs= @@ -1791,4 +1791,4 @@ rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= rsc.io/tmplfunc v0.0.3 h1:53XFQh69AfOa8Tw0Jm7t+GV7KZhOi6jzsCzTtKbMvzU= rsc.io/tmplfunc v0.0.3/go.mod h1:AG3sTPzElb1Io3Yg4voV9AGZJuleGAwaVRxL9M49PhA= sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E= -sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY= +sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY= \ No newline at end of file diff --git a/integration-tests/go.mod b/integration-tests/go.mod index 670c5d87744..9f1f6d8a76e 100644 --- a/integration-tests/go.mod +++ b/integration-tests/go.mod @@ -418,7 +418,7 @@ require ( github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20241018134907-a00ba3729b5e // indirect github.com/smartcontractkit/chainlink-feeds v0.1.1 // indirect github.com/smartcontractkit/chainlink-protos/orchestrator v0.3.0 // indirect - github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241112145241-efd6780f6930 // indirect + github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241112213949-65ae13752669 // indirect github.com/smartcontractkit/chainlink-starknet/relayer v0.1.1-0.20241017135645-176a23722fd8 // indirect github.com/smartcontractkit/grpc-proxy v0.0.0-20240830132753-a7e17fec5ab7 // indirect github.com/smartcontractkit/tdh2/go/ocr2/decryptionplugin v0.0.0-20241009055228-33d0c0bf38de // indirect diff --git a/integration-tests/go.sum b/integration-tests/go.sum index 6d37e7ab643..d9e896b17f3 100644 --- a/integration-tests/go.sum +++ b/integration-tests/go.sum @@ -1417,8 +1417,8 @@ github.com/smartcontractkit/chainlink-protos/job-distributor v0.4.0 h1:1xTm8UGeD github.com/smartcontractkit/chainlink-protos/job-distributor v0.4.0/go.mod h1:/dVVLXrsp+V0AbcYGJo3XMzKg3CkELsweA/TTopCsKE= github.com/smartcontractkit/chainlink-protos/orchestrator v0.3.0 h1:PBUaFfPLm+Efq7H9kdfGBivH+QhJ6vB5EZTR/sCZsxI= github.com/smartcontractkit/chainlink-protos/orchestrator v0.3.0/go.mod h1:m/A3lqD7ms/RsQ9BT5P2uceYY0QX5mIt4KQxT2G6qEo= -github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241112145241-efd6780f6930 h1:blu++xbH/NSb+ii5hI4jczwojZ7Hc1ERXjpt/krYy9c= -github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241112145241-efd6780f6930/go.mod h1:mGmRvlk54ufCufV4EBWizOGtXoXfePoFAuYEVC8EwdY= +github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241112213949-65ae13752669 h1:CBQ9ORUtGUvCr3dAm/qjpdHlYuB1SRIwtYw5LV8SLys= +github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241112213949-65ae13752669/go.mod h1:mGmRvlk54ufCufV4EBWizOGtXoXfePoFAuYEVC8EwdY= github.com/smartcontractkit/chainlink-starknet/relayer v0.1.1-0.20241017135645-176a23722fd8 h1:B4DFdk6MGcQnoCjjMBCx7Z+GWQpxRWJ4O8W/dVJyWGA= github.com/smartcontractkit/chainlink-starknet/relayer v0.1.1-0.20241017135645-176a23722fd8/go.mod h1:WkBqgBo+g34Gm5vWkDDl8Fh3Mzd7bF5hXp7rryg0t5o= github.com/smartcontractkit/chainlink-testing-framework/havoc v1.50.2 h1:GDGrC5OGiV0RyM1znYWehSQXyZQWTOzrEeJRYmysPCE= diff --git a/integration-tests/load/go.mod b/integration-tests/load/go.mod index 7a346e3a7d9..031adbcd962 100644 --- a/integration-tests/load/go.mod +++ b/integration-tests/load/go.mod @@ -425,7 +425,7 @@ require ( github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20241018134907-a00ba3729b5e // indirect github.com/smartcontractkit/chainlink-feeds v0.1.1 // indirect github.com/smartcontractkit/chainlink-protos/orchestrator v0.3.0 // indirect - github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241112145241-efd6780f6930 // indirect + github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241112213949-65ae13752669 // indirect github.com/smartcontractkit/chainlink-starknet/relayer v0.1.1-0.20241017135645-176a23722fd8 // indirect github.com/smartcontractkit/chainlink-testing-framework/lib/grafana v1.50.0 // indirect github.com/smartcontractkit/libocr v0.0.0-20241007185508-adbe57025f12 // indirect diff --git a/integration-tests/load/go.sum b/integration-tests/load/go.sum index 090a3d9477d..5a44ad8037c 100644 --- a/integration-tests/load/go.sum +++ b/integration-tests/load/go.sum @@ -1404,8 +1404,8 @@ github.com/smartcontractkit/chainlink-feeds v0.1.1 h1:JzvUOM/OgGQA1sOqTXXl52R6An github.com/smartcontractkit/chainlink-feeds v0.1.1/go.mod h1:55EZ94HlKCfAsUiKUTNI7QlE/3d3IwTlsU3YNa/nBb4= github.com/smartcontractkit/chainlink-protos/orchestrator v0.3.0 h1:PBUaFfPLm+Efq7H9kdfGBivH+QhJ6vB5EZTR/sCZsxI= github.com/smartcontractkit/chainlink-protos/orchestrator v0.3.0/go.mod h1:m/A3lqD7ms/RsQ9BT5P2uceYY0QX5mIt4KQxT2G6qEo= -github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241112145241-efd6780f6930 h1:blu++xbH/NSb+ii5hI4jczwojZ7Hc1ERXjpt/krYy9c= -github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241112145241-efd6780f6930/go.mod h1:mGmRvlk54ufCufV4EBWizOGtXoXfePoFAuYEVC8EwdY= +github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241112213949-65ae13752669 h1:CBQ9ORUtGUvCr3dAm/qjpdHlYuB1SRIwtYw5LV8SLys= +github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241112213949-65ae13752669/go.mod h1:mGmRvlk54ufCufV4EBWizOGtXoXfePoFAuYEVC8EwdY= github.com/smartcontractkit/chainlink-starknet/relayer v0.1.1-0.20241017135645-176a23722fd8 h1:B4DFdk6MGcQnoCjjMBCx7Z+GWQpxRWJ4O8W/dVJyWGA= github.com/smartcontractkit/chainlink-starknet/relayer v0.1.1-0.20241017135645-176a23722fd8/go.mod h1:WkBqgBo+g34Gm5vWkDDl8Fh3Mzd7bF5hXp7rryg0t5o= github.com/smartcontractkit/chainlink-testing-framework/havoc v1.50.2 h1:GDGrC5OGiV0RyM1znYWehSQXyZQWTOzrEeJRYmysPCE= From 8b0acc21704ac1c390bb201e81ad57897ebf8584 Mon Sep 17 00:00:00 2001 From: nogo <0xnogo@gmail.com> Date: Thu, 14 Nov 2024 16:07:48 +0400 Subject: [PATCH 13/21] update cl-ccip --- go.mod | 2 +- go.sum | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/go.mod b/go.mod index 2b6f03333c0..2b97e9d1e9d 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.29 github.com/smartcontractkit/chainlink-automation v0.8.1 - github.com/smartcontractkit/chainlink-ccip v0.0.0-20241112095015-3e85d9f1898b + github.com/smartcontractkit/chainlink-ccip v0.0.0-20241112162219-e1e443d3e488 github.com/smartcontractkit/chainlink-common v0.3.1-0.20241113142256-8a7a997a0371 github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241017133723-5277829bd53f github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20241018134907-a00ba3729b5e diff --git a/go.sum b/go.sum index 70e7eee0704..1484d40a408 100644 --- a/go.sum +++ b/go.sum @@ -1076,8 +1076,8 @@ github.com/smartcontractkit/chain-selectors v1.0.29 h1:aZ9+OoUSMn4nqnissHtDvDoKR github.com/smartcontractkit/chain-selectors v1.0.29/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-20241112095015-3e85d9f1898b h1:4kmZtaQ4fXwduHnw9xk5VmiIOW4nHg/Mx6iidlZJt5o= -github.com/smartcontractkit/chainlink-ccip v0.0.0-20241112095015-3e85d9f1898b/go.mod h1:4adKaHNaxFsRvV/lYfqtbsWyyvIPUMLR0FdOJN/ljis= +github.com/smartcontractkit/chainlink-ccip v0.0.0-20241112162219-e1e443d3e488 h1:tDEY6ATBOR6wQkP9AjE/5KNI0dkHNoiwAN/iOq0paTE= +github.com/smartcontractkit/chainlink-ccip v0.0.0-20241112162219-e1e443d3e488/go.mod h1:4adKaHNaxFsRvV/lYfqtbsWyyvIPUMLR0FdOJN/ljis= github.com/smartcontractkit/chainlink-common v0.3.1-0.20241113142256-8a7a997a0371 h1:vnNqMaAvheZgR8IDMGw0QIV1Qen3XTh7IChwW40SNfU= github.com/smartcontractkit/chainlink-common v0.3.1-0.20241113142256-8a7a997a0371/go.mod h1:ny87uTW6hLjCTLiBqBRNFEhETSXhHWevYlPclT5lSco= github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241017133723-5277829bd53f h1:BwrIaQIx5Iy6eT+DfLhFfK2XqjxRm74mVdlX8gbu4dw= @@ -1791,4 +1791,4 @@ rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= rsc.io/tmplfunc v0.0.3 h1:53XFQh69AfOa8Tw0Jm7t+GV7KZhOi6jzsCzTtKbMvzU= rsc.io/tmplfunc v0.0.3/go.mod h1:AG3sTPzElb1Io3Yg4voV9AGZJuleGAwaVRxL9M49PhA= sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E= -sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY= \ No newline at end of file +sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY= From e71b653c2dd3ab94374277dedef9b0d853737a8d Mon Sep 17 00:00:00 2001 From: nogo <0xnogo@gmail.com> Date: Thu, 14 Nov 2024 18:46:41 +0400 Subject: [PATCH 14/21] smoke test --- .github/e2e-tests.yml | 14 ++++++ .../ccip-tests/testsetups/ccip.go | 9 ++++ .../ccip-tests/testsetups/test_helpers.go | 15 ++++-- .../smoke/ccip_messaging_test.go | 13 +---- integration-tests/smoke/ccip_test.go | 4 +- .../smoke}/fee_boosting_test.go | 50 ++++++++++++------- 6 files changed, 70 insertions(+), 35 deletions(-) rename {deployment/ccip/changeset => integration-tests/smoke}/fee_boosting_test.go (80%) diff --git a/.github/e2e-tests.yml b/.github/e2e-tests.yml index aee250420e0..f22949b723e 100644 --- a/.github/e2e-tests.yml +++ b/.github/e2e-tests.yml @@ -963,6 +963,20 @@ runner-test-matrix: E2E_TEST_SELECTED_NETWORK: SIMULATED_1,SIMULATED_2 E2E_JD_VERSION: 0.4.0 + - id: smoke/fee_boosting_test.go:* + path: integration-tests/smoke/fee_boosting_test.go + test_env_type: docker + runs_on: ubuntu-latest + triggers: + - PR E2E Core Tests + - Merge Queue E2E Core Tests + - Nightly E2E Tests + test_cmd: cd integration-tests/ && go test smoke/fee_boosting_test.go -timeout 12m -test.parallel=1 -count=1 -json + pyroscope_env: ci-smoke-ccipv1_6-evm-simulated + test_env_vars: + E2E_TEST_SELECTED_NETWORK: SIMULATED_1,SIMULATED_2 + E2E_JD_VERSION: 0.4.0 + # END: CCIPv1.6 tests # START: CCIP tests diff --git a/integration-tests/ccip-tests/testsetups/ccip.go b/integration-tests/ccip-tests/testsetups/ccip.go index eee424d50d1..a738904b281 100644 --- a/integration-tests/ccip-tests/testsetups/ccip.go +++ b/integration-tests/ccip-tests/testsetups/ccip.go @@ -37,6 +37,7 @@ import ( "github.com/smartcontractkit/chainlink-testing-framework/lib/networks" "github.com/smartcontractkit/chainlink-testing-framework/lib/utils/testcontext" + ccipdeployment "github.com/smartcontractkit/chainlink/deployment/ccip" integrationactions "github.com/smartcontractkit/chainlink/integration-tests/actions" "github.com/smartcontractkit/chainlink/integration-tests/ccip-tests/actions" "github.com/smartcontractkit/chainlink/integration-tests/ccip-tests/contracts" @@ -1434,3 +1435,11 @@ func createEnvironmentConfig(t *testing.T, envName string, testConfig *CCIPTestC } return envConfig } + +func SleepAndReplay(t *testing.T, e ccipdeployment.DeployedEnv, sourceChain, destChain uint64) { + time.Sleep(30 * time.Second) + replayBlocks := make(map[uint64]uint64) + replayBlocks[sourceChain] = 1 + replayBlocks[destChain] = 1 + ccipdeployment.ReplayLogs(t, e.Env.Offchain, replayBlocks) +} diff --git a/integration-tests/ccip-tests/testsetups/test_helpers.go b/integration-tests/ccip-tests/testsetups/test_helpers.go index fc7b976d942..eeae7f5f8c3 100644 --- a/integration-tests/ccip-tests/testsetups/test_helpers.go +++ b/integration-tests/ccip-tests/testsetups/test_helpers.go @@ -69,7 +69,16 @@ func (d DeployedLocalDevEnvironment) RestartChainlinkNodes(t *testing.T) error { return errGrp.Wait() } -func NewLocalDevEnvironment(t *testing.T, lggr logger.Logger) (ccipdeployment.DeployedEnv, *test_env.CLClusterTestEnv, testconfig.TestConfig) { +func NewLocalDevEnvironmentWithDefaultPrice( + t *testing.T, + lggr logger.Logger) (ccipdeployment.DeployedEnv, *test_env.CLClusterTestEnv, testconfig.TestConfig) { + return NewLocalDevEnvironment(t, lggr, ccipdeployment.MockLinkPrice, ccipdeployment.MockWethPrice) +} + +func NewLocalDevEnvironment( + t *testing.T, + lggr logger.Logger, + linkPrice, wethPrice *big.Int) (ccipdeployment.DeployedEnv, *test_env.CLClusterTestEnv, testconfig.TestConfig) { ctx := testcontext.Get(t) // create a local docker environment with simulated chains and job-distributor // we cannot create the chainlink nodes yet as we need to deploy the capability registry first @@ -88,7 +97,7 @@ func NewLocalDevEnvironment(t *testing.T, lggr logger.Logger) (ccipdeployment.De require.NoError(t, err) ab := deployment.NewMemoryAddressBook() - crConfig := ccipdeployment.DeployTestContracts(t, lggr, ab, homeChainSel, feedSel, chains, ccipdeployment.MockLinkPrice, ccipdeployment.MockWethPrice) + crConfig := ccipdeployment.DeployTestContracts(t, lggr, ab, homeChainSel, feedSel, chains, linkPrice, wethPrice) // start the chainlink nodes with the CR address err = StartChainlinkNodes(t, envConfig, @@ -128,7 +137,7 @@ func NewLocalDevEnvironmentWithRMN( lggr logger.Logger, numRmnNodes int, ) (ccipdeployment.DeployedEnv, devenv.RMNCluster) { - tenv, dockerenv, _ := NewLocalDevEnvironment(t, lggr) + tenv, dockerenv, _ := NewLocalDevEnvironmentWithDefaultPrice(t, lggr) state, err := ccipdeployment.LoadOnchainState(tenv.Env) require.NoError(t, err) diff --git a/integration-tests/smoke/ccip_messaging_test.go b/integration-tests/smoke/ccip_messaging_test.go index 2d53db25d7d..775466d4730 100644 --- a/integration-tests/smoke/ccip_messaging_test.go +++ b/integration-tests/smoke/ccip_messaging_test.go @@ -2,7 +2,6 @@ package smoke import ( "testing" - "time" "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" @@ -43,7 +42,7 @@ func Test_CCIPMessaging(t *testing.T) { // Setup 2 chains and a single lane. lggr := logger.TestLogger(t) ctx := ccdeploy.Context(t) - e, _, _ := testsetups.NewLocalDevEnvironment(t, lggr) + e, _, _ := testsetups.NewLocalDevEnvironmentWithDefaultPrice(t, lggr) state, err := ccdeploy.LoadOnchainState(e.Env) require.NoError(t, err) @@ -171,14 +170,6 @@ func Test_CCIPMessaging(t *testing.T) { }) } -func sleepAndReplay(t *testing.T, e ccipdeployment.DeployedEnv, sourceChain, destChain uint64) { - time.Sleep(30 * time.Second) - replayBlocks := make(map[uint64]uint64) - replayBlocks[sourceChain] = 1 - replayBlocks[destChain] = 1 - ccipdeployment.ReplayLogs(t, e.Env.Offchain, replayBlocks) -} - func runMessagingTestCase( tc messagingTestCase, receiver common.Address, @@ -207,7 +198,7 @@ func runMessagingTestCase( // hack if !tc.replayed { - sleepAndReplay(tc.t, tc.deployedEnv, tc.sourceChain, tc.destChain) + testsetups.SleepAndReplay(tc.t, tc.deployedEnv, tc.sourceChain, tc.destChain) out.replayed = true } diff --git a/integration-tests/smoke/ccip_test.go b/integration-tests/smoke/ccip_test.go index 5b0ba285527..31caf699f81 100644 --- a/integration-tests/smoke/ccip_test.go +++ b/integration-tests/smoke/ccip_test.go @@ -23,7 +23,7 @@ import ( func TestInitialDeployOnLocal(t *testing.T) { lggr := logger.TestLogger(t) ctx := ccdeploy.Context(t) - tenv, _, _ := testsetups.NewLocalDevEnvironment(t, lggr) + tenv, _, _ := testsetups.NewLocalDevEnvironmentWithDefaultPrice(t, lggr) e := tenv.Env state, err := ccdeploy.LoadOnchainState(tenv.Env) @@ -116,7 +116,7 @@ func TestInitialDeployOnLocal(t *testing.T) { func TestTokenTransfer(t *testing.T) { lggr := logger.TestLogger(t) ctx := ccdeploy.Context(t) - tenv, _, _ := testsetups.NewLocalDevEnvironment(t, lggr) + tenv, _, _ := testsetups.NewLocalDevEnvironmentWithDefaultPrice(t, lggr) e := tenv.Env state, err := ccdeploy.LoadOnchainState(e) diff --git a/deployment/ccip/changeset/fee_boosting_test.go b/integration-tests/smoke/fee_boosting_test.go similarity index 80% rename from deployment/ccip/changeset/fee_boosting_test.go rename to integration-tests/smoke/fee_boosting_test.go index 7db388aaac8..1732c47543f 100644 --- a/deployment/ccip/changeset/fee_boosting_test.go +++ b/integration-tests/smoke/fee_boosting_test.go @@ -1,16 +1,19 @@ -package changeset +package smoke import ( "math/big" "testing" - "time" "github.com/ethereum/go-ethereum/common" "github.com/test-go/testify/require" "golang.org/x/exp/maps" + jobv1 "github.com/smartcontractkit/chainlink-protos/job-distributor/v1/job" "github.com/smartcontractkit/chainlink/deployment" + ccdeploy "github.com/smartcontractkit/chainlink/deployment/ccip" ccipdeployment "github.com/smartcontractkit/chainlink/deployment/ccip" + "github.com/smartcontractkit/chainlink/deployment/ccip/changeset" + "github.com/smartcontractkit/chainlink/integration-tests/ccip-tests/testsetups" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/router" "github.com/smartcontractkit/chainlink/v2/core/logger" ) @@ -30,14 +33,15 @@ type priceFeedPrices struct { wethPrice *big.Int } -func Test_FeeBoosting(t *testing.T) { - t.Parallel() +func Test_CCIPFeeBoosting(t *testing.T) { + ctx := ccdeploy.Context(t) setupTestEnv := func(t *testing.T, numChains int) (ccipdeployment.DeployedEnv, ccipdeployment.CCIPOnChainState, []uint64) { - e := ccipdeployment.NewMemoryEnvironmentWithJobsAndPrices( + e, _, _ := testsetups.NewLocalDevEnvironment( t, logger.TestLogger(t), - numChains, 4, - deployment.E18Mult(5), big.NewInt(9e8)) + deployment.E18Mult(5), + big.NewInt(9e8)) + state, err := ccipdeployment.LoadOnchainState(e.Env) require.NoError(t, err) @@ -45,8 +49,8 @@ func Test_FeeBoosting(t *testing.T) { require.Len(t, allChainSelectors, numChains) tokenConfig := ccipdeployment.NewTestTokenConfig(state.Chains[e.FeedChainSel].USDFeeds) - newAddresses := deployment.NewMemoryAddressBook() - err = ccipdeployment.DeployCCIPContracts(e.Env, newAddresses, ccipdeployment.DeployCCIPContractConfig{ + // Apply migration + output, err := changeset.InitialDeploy(e.Env, ccdeploy.DeployCCIPContractConfig{ HomeChainSel: e.HomeChainSel, FeedChainSel: e.FeedChainSel, ChainsToDeploy: allChainSelectors, @@ -55,10 +59,26 @@ func Test_FeeBoosting(t *testing.T) { OCRSecrets: deployment.XXXGenerateTestOCRSecrets(), }) require.NoError(t, err) - require.NoError(t, e.Env.ExistingAddresses.Merge(newAddresses)) + require.NoError(t, e.Env.ExistingAddresses.Merge(output.AddressBook)) state, err = ccipdeployment.LoadOnchainState(e.Env) require.NoError(t, err) + // Ensure capreg logs are up to date. + ccdeploy.ReplayLogs(t, e.Env.Offchain, e.ReplayBlocks) + + // Apply the jobs. + for nodeID, jobs := range output.JobSpecs { + for _, job := range jobs { + // Note these auto-accept + _, err := e.Env.Offchain.ProposeJob(ctx, + &jobv1.ProposeJobRequest{ + NodeId: nodeID, + Spec: job, + }) + require.NoError(t, err) + } + } + return e, state, allChainSelectors } @@ -140,16 +160,8 @@ func runFeeboostTestCase(tc feeboostTestCase) { }) expectedSeqNum[tc.destChain] = seqNum - sleepAndReplay(tc.t, tc.deployedEnv, tc.sourceChain, tc.destChain) + testsetups.SleepAndReplay(tc.t, tc.deployedEnv, tc.sourceChain, tc.destChain) ccipdeployment.ConfirmCommitForAllWithExpectedSeqNums(tc.t, tc.deployedEnv.Env, tc.onchainState, expectedSeqNum, startBlocks) ccipdeployment.ConfirmExecWithSeqNrForAll(tc.t, tc.deployedEnv.Env, tc.onchainState, expectedSeqNum, startBlocks) } - -func sleepAndReplay(t *testing.T, e ccipdeployment.DeployedEnv, sourceChain, destChain uint64) { - time.Sleep(30 * time.Second) - replayBlocks := make(map[uint64]uint64) - replayBlocks[sourceChain] = 1 - replayBlocks[destChain] = 1 - ccipdeployment.ReplayLogs(t, e.Env.Offchain, replayBlocks) -} From b045ae49c68b3608908ae6ef4a7018aba6bf7186 Mon Sep 17 00:00:00 2001 From: nogo <0xnogo@gmail.com> Date: Thu, 14 Nov 2024 18:56:10 +0400 Subject: [PATCH 15/21] change timeout --- .github/e2e-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/e2e-tests.yml b/.github/e2e-tests.yml index f22949b723e..5a0d6d8e5ca 100644 --- a/.github/e2e-tests.yml +++ b/.github/e2e-tests.yml @@ -971,7 +971,7 @@ runner-test-matrix: - PR E2E Core Tests - Merge Queue E2E Core Tests - Nightly E2E Tests - test_cmd: cd integration-tests/ && go test smoke/fee_boosting_test.go -timeout 12m -test.parallel=1 -count=1 -json + test_cmd: cd integration-tests/ && go test smoke/fee_boosting_test.go -timeout 15m -test.parallel=1 -count=1 -json pyroscope_env: ci-smoke-ccipv1_6-evm-simulated test_env_vars: E2E_TEST_SELECTED_NETWORK: SIMULATED_1,SIMULATED_2 From 2a9191a6bf900832c9d14c8604b947612579828c Mon Sep 17 00:00:00 2001 From: nogo <0xnogo@gmail.com> Date: Thu, 14 Nov 2024 19:37:56 +0400 Subject: [PATCH 16/21] skip --- go.mod | 2 +- go.sum | 4 ++-- integration-tests/smoke/fee_boosting_test.go | 1 + 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 2b97e9d1e9d..2b6f03333c0 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.29 github.com/smartcontractkit/chainlink-automation v0.8.1 - github.com/smartcontractkit/chainlink-ccip v0.0.0-20241112162219-e1e443d3e488 + github.com/smartcontractkit/chainlink-ccip v0.0.0-20241112095015-3e85d9f1898b github.com/smartcontractkit/chainlink-common v0.3.1-0.20241113142256-8a7a997a0371 github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241017133723-5277829bd53f github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20241018134907-a00ba3729b5e diff --git a/go.sum b/go.sum index 1484d40a408..13217384ff6 100644 --- a/go.sum +++ b/go.sum @@ -1076,8 +1076,8 @@ github.com/smartcontractkit/chain-selectors v1.0.29 h1:aZ9+OoUSMn4nqnissHtDvDoKR github.com/smartcontractkit/chain-selectors v1.0.29/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-20241112162219-e1e443d3e488 h1:tDEY6ATBOR6wQkP9AjE/5KNI0dkHNoiwAN/iOq0paTE= -github.com/smartcontractkit/chainlink-ccip v0.0.0-20241112162219-e1e443d3e488/go.mod h1:4adKaHNaxFsRvV/lYfqtbsWyyvIPUMLR0FdOJN/ljis= +github.com/smartcontractkit/chainlink-ccip v0.0.0-20241112095015-3e85d9f1898b h1:4kmZtaQ4fXwduHnw9xk5VmiIOW4nHg/Mx6iidlZJt5o= +github.com/smartcontractkit/chainlink-ccip v0.0.0-20241112095015-3e85d9f1898b/go.mod h1:4adKaHNaxFsRvV/lYfqtbsWyyvIPUMLR0FdOJN/ljis= github.com/smartcontractkit/chainlink-common v0.3.1-0.20241113142256-8a7a997a0371 h1:vnNqMaAvheZgR8IDMGw0QIV1Qen3XTh7IChwW40SNfU= github.com/smartcontractkit/chainlink-common v0.3.1-0.20241113142256-8a7a997a0371/go.mod h1:ny87uTW6hLjCTLiBqBRNFEhETSXhHWevYlPclT5lSco= github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241017133723-5277829bd53f h1:BwrIaQIx5Iy6eT+DfLhFfK2XqjxRm74mVdlX8gbu4dw= diff --git a/integration-tests/smoke/fee_boosting_test.go b/integration-tests/smoke/fee_boosting_test.go index 1732c47543f..249f6194f6f 100644 --- a/integration-tests/smoke/fee_boosting_test.go +++ b/integration-tests/smoke/fee_boosting_test.go @@ -34,6 +34,7 @@ type priceFeedPrices struct { } func Test_CCIPFeeBoosting(t *testing.T) { + t.Skip("Skipping test as it is not fully implemented yet") ctx := ccdeploy.Context(t) setupTestEnv := func(t *testing.T, numChains int) (ccipdeployment.DeployedEnv, ccipdeployment.CCIPOnChainState, []uint64) { From 8eb6bedf93ac0befbc5a5e1880445fb41a949fc0 Mon Sep 17 00:00:00 2001 From: nogo <0xnogo@gmail.com> Date: Fri, 15 Nov 2024 06:45:45 +0400 Subject: [PATCH 17/21] reset go.mod --- core/scripts/go.mod | 2 +- integration-tests/go.mod | 2 +- integration-tests/load/go.mod | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/core/scripts/go.mod b/core/scripts/go.mod index 71a3d6283e3..028eb9fac9e 100644 --- a/core/scripts/go.mod +++ b/core/scripts/go.mod @@ -294,7 +294,7 @@ require ( github.com/shirou/gopsutil/v3 v3.24.3 // indirect github.com/smartcontractkit/ccip-owner-contracts v0.0.0-20240926212305-a6deabdfce86 // indirect github.com/smartcontractkit/chain-selectors v1.0.29 // indirect - github.com/smartcontractkit/chainlink-ccip v0.0.0-20241112162219-e1e443d3e488 // indirect + github.com/smartcontractkit/chainlink-ccip v0.0.0-20241112095015-3e85d9f1898b // indirect github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241017133723-5277829bd53f // indirect github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20241018134907-a00ba3729b5e // indirect github.com/smartcontractkit/chainlink-feeds v0.1.1 // indirect diff --git a/integration-tests/go.mod b/integration-tests/go.mod index 76b4c13f8f1..b5948028f32 100644 --- a/integration-tests/go.mod +++ b/integration-tests/go.mod @@ -45,7 +45,7 @@ require ( github.com/smartcontractkit/chainlink-testing-framework/seth v1.50.5 github.com/smartcontractkit/chainlink-testing-framework/wasp v1.50.2 github.com/smartcontractkit/chainlink/deployment v0.0.0-00010101000000-000000000000 - github.com/smartcontractkit/chainlink/v2 v2.0.0-00010101000000-000000000000 + github.com/smartcontractkit/chainlink/v2 v2.14.0-mercury-20240807.0.20241106193309-5560cd76211a github.com/smartcontractkit/libocr v0.0.0-20241007185508-adbe57025f12 github.com/spf13/cobra v1.8.1 github.com/stretchr/testify v1.9.0 diff --git a/integration-tests/load/go.mod b/integration-tests/load/go.mod index ef8eedbedae..7398abc5af9 100644 --- a/integration-tests/load/go.mod +++ b/integration-tests/load/go.mod @@ -23,7 +23,7 @@ require ( github.com/smartcontractkit/chainlink-testing-framework/wasp v1.50.2 github.com/smartcontractkit/chainlink/deployment v0.0.0-00010101000000-000000000000 github.com/smartcontractkit/chainlink/integration-tests v0.0.0-20241030133659-9ec788e78b4f - github.com/smartcontractkit/chainlink/v2 v2.9.0-beta0.0.20240216210048-da02459ddad8 + github.com/smartcontractkit/chainlink/v2 v2.14.0-mercury-20240807.0.20241106193309-5560cd76211a github.com/smartcontractkit/tdh2/go/tdh2 v0.0.0-20241009055228-33d0c0bf38de github.com/stretchr/testify v1.9.0 github.com/wiremock/go-wiremock v1.9.0 @@ -65,7 +65,7 @@ require ( github.com/russross/blackfriday/v2 v2.1.0 // indirect github.com/sagikazarmark/locafero v0.4.0 // indirect github.com/sagikazarmark/slog-shim v0.1.0 // indirect - github.com/smartcontractkit/chainlink-ccip v0.0.0-20241112162219-e1e443d3e488 // indirect + github.com/smartcontractkit/chainlink-ccip v0.0.0-20241112095015-3e85d9f1898b // indirect github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241017133723-5277829bd53f // indirect github.com/smartcontractkit/chainlink-testing-framework/havoc v1.50.2 // indirect github.com/smartcontractkit/grpc-proxy v0.0.0-20240830132753-a7e17fec5ab7 // indirect From 59c11b9b20dcb11ba322a439ca935f17fafb0cd4 Mon Sep 17 00:00:00 2001 From: nogo <0xnogo@gmail.com> Date: Fri, 15 Nov 2024 11:58:42 +0400 Subject: [PATCH 18/21] addressing comments --- core/capabilities/ccip/ccipevm/gas_helpers.go | 1 + deployment/ccip/add_lane.go | 7 ++++--- integration-tests/ccip-tests/testsetups/ccip.go | 9 --------- integration-tests/smoke/ccip_messaging_test.go | 11 ++++++++++- integration-tests/smoke/fee_boosting_test.go | 4 ++-- 5 files changed, 17 insertions(+), 15 deletions(-) diff --git a/core/capabilities/ccip/ccipevm/gas_helpers.go b/core/capabilities/ccip/ccipevm/gas_helpers.go index b0657a55da1..2706650f48e 100644 --- a/core/capabilities/ccip/ccipevm/gas_helpers.go +++ b/core/capabilities/ccip/ccipevm/gas_helpers.go @@ -27,6 +27,7 @@ const ( ExecutionStateProcessingOverheadGas = 2_100 + // COLD_SLOAD_COST for first reading the state 20_000 + // SSTORE_SET_GAS for writing from 0 (untouched) to non-zero (in-progress) 100 //# SLOAD_GAS = WARM_STORAGE_READ_COST for rewriting from non-zero (in-progress) to non-zero (success/failure) + // TODO: investigate the write overhead for v1.6 DestGasOverhead = 110_000 + 110_000 + 130_000 // 110K for commit, 110K for RMN, 130K for Exec ) diff --git a/deployment/ccip/add_lane.go b/deployment/ccip/add_lane.go index deb2dfe9bc7..8af96277fc2 100644 --- a/deployment/ccip/add_lane.go +++ b/deployment/ccip/add_lane.go @@ -7,6 +7,7 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/smartcontractkit/chainlink/deployment" + "github.com/smartcontractkit/chainlink/v2/core/capabilities/ccip/ccipevm" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/offramp" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/fee_quoter" @@ -122,15 +123,15 @@ func DefaultFeeQuoterDestChainConfig() fee_quoter.FeeQuoterDestChainConfig { MaxNumberOfTokensPerMsg: 10, MaxDataBytes: 256, MaxPerMsgGasLimit: 3_000_000, - DestGasOverhead: 350_000, + DestGasOverhead: ccipevm.DestGasOverhead, DefaultTokenFeeUSDCents: 1, - DestGasPerPayloadByte: 16, + DestGasPerPayloadByte: ccipevm.CalldataGasPerByte, DestDataAvailabilityOverheadGas: 100, DestGasPerDataAvailabilityByte: 100, DestDataAvailabilityMultiplierBps: 1, DefaultTokenDestGasOverhead: 125_000, DefaultTxGasLimit: 200_000, - GasMultiplierWeiPerEth: 11e17, + GasMultiplierWeiPerEth: 11e17, // Gas multiplier in wei per eth is scaled by 1e18, so 11e17 is 1.1 = 110% NetworkFeeUSDCents: 1, ChainFamilySelector: [4]byte(evmFamilySelector), } diff --git a/integration-tests/ccip-tests/testsetups/ccip.go b/integration-tests/ccip-tests/testsetups/ccip.go index a738904b281..eee424d50d1 100644 --- a/integration-tests/ccip-tests/testsetups/ccip.go +++ b/integration-tests/ccip-tests/testsetups/ccip.go @@ -37,7 +37,6 @@ import ( "github.com/smartcontractkit/chainlink-testing-framework/lib/networks" "github.com/smartcontractkit/chainlink-testing-framework/lib/utils/testcontext" - ccipdeployment "github.com/smartcontractkit/chainlink/deployment/ccip" integrationactions "github.com/smartcontractkit/chainlink/integration-tests/actions" "github.com/smartcontractkit/chainlink/integration-tests/ccip-tests/actions" "github.com/smartcontractkit/chainlink/integration-tests/ccip-tests/contracts" @@ -1435,11 +1434,3 @@ func createEnvironmentConfig(t *testing.T, envName string, testConfig *CCIPTestC } return envConfig } - -func SleepAndReplay(t *testing.T, e ccipdeployment.DeployedEnv, sourceChain, destChain uint64) { - time.Sleep(30 * time.Second) - replayBlocks := make(map[uint64]uint64) - replayBlocks[sourceChain] = 1 - replayBlocks[destChain] = 1 - ccipdeployment.ReplayLogs(t, e.Env.Offchain, replayBlocks) -} diff --git a/integration-tests/smoke/ccip_messaging_test.go b/integration-tests/smoke/ccip_messaging_test.go index 775466d4730..5fb5adf0c6f 100644 --- a/integration-tests/smoke/ccip_messaging_test.go +++ b/integration-tests/smoke/ccip_messaging_test.go @@ -2,6 +2,7 @@ package smoke import ( "testing" + "time" "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" @@ -170,6 +171,14 @@ func Test_CCIPMessaging(t *testing.T) { }) } +func sleepAndReplay(t *testing.T, e ccipdeployment.DeployedEnv, sourceChain, destChain uint64) { + time.Sleep(30 * time.Second) + replayBlocks := make(map[uint64]uint64) + replayBlocks[sourceChain] = 1 + replayBlocks[destChain] = 1 + ccipdeployment.ReplayLogs(t, e.Env.Offchain, replayBlocks) +} + func runMessagingTestCase( tc messagingTestCase, receiver common.Address, @@ -198,7 +207,7 @@ func runMessagingTestCase( // hack if !tc.replayed { - testsetups.SleepAndReplay(tc.t, tc.deployedEnv, tc.sourceChain, tc.destChain) + sleepAndReplay(tc.t, tc.deployedEnv, tc.sourceChain, tc.destChain) out.replayed = true } diff --git a/integration-tests/smoke/fee_boosting_test.go b/integration-tests/smoke/fee_boosting_test.go index 249f6194f6f..8b213a71277 100644 --- a/integration-tests/smoke/fee_boosting_test.go +++ b/integration-tests/smoke/fee_boosting_test.go @@ -33,8 +33,8 @@ type priceFeedPrices struct { wethPrice *big.Int } +// TODO: find a way to reuse the same test setup for all tests func Test_CCIPFeeBoosting(t *testing.T) { - t.Skip("Skipping test as it is not fully implemented yet") ctx := ccdeploy.Context(t) setupTestEnv := func(t *testing.T, numChains int) (ccipdeployment.DeployedEnv, ccipdeployment.CCIPOnChainState, []uint64) { @@ -161,7 +161,7 @@ func runFeeboostTestCase(tc feeboostTestCase) { }) expectedSeqNum[tc.destChain] = seqNum - testsetups.SleepAndReplay(tc.t, tc.deployedEnv, tc.sourceChain, tc.destChain) + sleepAndReplay(tc.t, tc.deployedEnv, tc.sourceChain, tc.destChain) ccipdeployment.ConfirmCommitForAllWithExpectedSeqNums(tc.t, tc.deployedEnv.Env, tc.onchainState, expectedSeqNum, startBlocks) ccipdeployment.ConfirmExecWithSeqNrForAll(tc.t, tc.deployedEnv.Env, tc.onchainState, expectedSeqNum, startBlocks) From bb18c940a3ee4a033b6e98fe1fb4c52c8cc39dd7 Mon Sep 17 00:00:00 2001 From: nogo <0xnogo@gmail.com> Date: Fri, 15 Nov 2024 12:21:55 +0400 Subject: [PATCH 19/21] go mod cl-ccip --- core/scripts/go.mod | 2 +- core/scripts/go.sum | 4 +-- 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 +-- integration-tests/smoke/fee_boosting_test.go | 31 +++++--------------- 11 files changed, 23 insertions(+), 38 deletions(-) diff --git a/core/scripts/go.mod b/core/scripts/go.mod index 028eb9fac9e..12e12a1156e 100644 --- a/core/scripts/go.mod +++ b/core/scripts/go.mod @@ -294,7 +294,7 @@ require ( github.com/shirou/gopsutil/v3 v3.24.3 // indirect github.com/smartcontractkit/ccip-owner-contracts v0.0.0-20240926212305-a6deabdfce86 // indirect github.com/smartcontractkit/chain-selectors v1.0.29 // indirect - github.com/smartcontractkit/chainlink-ccip v0.0.0-20241112095015-3e85d9f1898b // indirect + github.com/smartcontractkit/chainlink-ccip v0.0.0-20241115103032-ec39846b3436 // indirect github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241017133723-5277829bd53f // indirect github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20241018134907-a00ba3729b5e // indirect github.com/smartcontractkit/chainlink-feeds v0.1.1 // indirect diff --git a/core/scripts/go.sum b/core/scripts/go.sum index bdf3511c482..a123ae602d7 100644 --- a/core/scripts/go.sum +++ b/core/scripts/go.sum @@ -1092,8 +1092,8 @@ github.com/smartcontractkit/chain-selectors v1.0.29 h1:aZ9+OoUSMn4nqnissHtDvDoKR github.com/smartcontractkit/chain-selectors v1.0.29/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-20241112095015-3e85d9f1898b h1:4kmZtaQ4fXwduHnw9xk5VmiIOW4nHg/Mx6iidlZJt5o= -github.com/smartcontractkit/chainlink-ccip v0.0.0-20241112095015-3e85d9f1898b/go.mod h1:4adKaHNaxFsRvV/lYfqtbsWyyvIPUMLR0FdOJN/ljis= +github.com/smartcontractkit/chainlink-ccip v0.0.0-20241115103032-ec39846b3436 h1:n3wy96cqxsaJGoCDbFulFPHind6Etq0tiWZcwAnTs3Q= +github.com/smartcontractkit/chainlink-ccip v0.0.0-20241115103032-ec39846b3436/go.mod h1:4adKaHNaxFsRvV/lYfqtbsWyyvIPUMLR0FdOJN/ljis= github.com/smartcontractkit/chainlink-common v0.3.1-0.20241114134822-aadff98ef068 h1:2llRW4Tn9W/EZp2XvXclQ9IjeTBwwxVPrrqaerX+vCE= github.com/smartcontractkit/chainlink-common v0.3.1-0.20241114134822-aadff98ef068/go.mod h1:ny87uTW6hLjCTLiBqBRNFEhETSXhHWevYlPclT5lSco= github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241017133723-5277829bd53f h1:BwrIaQIx5Iy6eT+DfLhFfK2XqjxRm74mVdlX8gbu4dw= diff --git a/deployment/go.mod b/deployment/go.mod index 73e23aa83f3..27e171de651 100644 --- a/deployment/go.mod +++ b/deployment/go.mod @@ -22,7 +22,7 @@ require ( github.com/sethvargo/go-retry v0.2.4 github.com/smartcontractkit/ccip-owner-contracts v0.0.0-20240926212305-a6deabdfce86 github.com/smartcontractkit/chain-selectors v1.0.29 - github.com/smartcontractkit/chainlink-ccip v0.0.0-20241112095015-3e85d9f1898b + github.com/smartcontractkit/chainlink-ccip v0.0.0-20241115103032-ec39846b3436 github.com/smartcontractkit/chainlink-common v0.3.1-0.20241114134822-aadff98ef068 github.com/smartcontractkit/chainlink-protos/job-distributor v0.4.0 github.com/smartcontractkit/chainlink-testing-framework/lib v1.50.13 diff --git a/deployment/go.sum b/deployment/go.sum index 6c372de39f2..66487c2f9bc 100644 --- a/deployment/go.sum +++ b/deployment/go.sum @@ -1382,8 +1382,8 @@ github.com/smartcontractkit/chain-selectors v1.0.29 h1:aZ9+OoUSMn4nqnissHtDvDoKR github.com/smartcontractkit/chain-selectors v1.0.29/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-20241112095015-3e85d9f1898b h1:4kmZtaQ4fXwduHnw9xk5VmiIOW4nHg/Mx6iidlZJt5o= -github.com/smartcontractkit/chainlink-ccip v0.0.0-20241112095015-3e85d9f1898b/go.mod h1:4adKaHNaxFsRvV/lYfqtbsWyyvIPUMLR0FdOJN/ljis= +github.com/smartcontractkit/chainlink-ccip v0.0.0-20241115103032-ec39846b3436 h1:n3wy96cqxsaJGoCDbFulFPHind6Etq0tiWZcwAnTs3Q= +github.com/smartcontractkit/chainlink-ccip v0.0.0-20241115103032-ec39846b3436/go.mod h1:4adKaHNaxFsRvV/lYfqtbsWyyvIPUMLR0FdOJN/ljis= github.com/smartcontractkit/chainlink-common v0.3.1-0.20241114134822-aadff98ef068 h1:2llRW4Tn9W/EZp2XvXclQ9IjeTBwwxVPrrqaerX+vCE= github.com/smartcontractkit/chainlink-common v0.3.1-0.20241114134822-aadff98ef068/go.mod h1:ny87uTW6hLjCTLiBqBRNFEhETSXhHWevYlPclT5lSco= github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241017133723-5277829bd53f h1:BwrIaQIx5Iy6eT+DfLhFfK2XqjxRm74mVdlX8gbu4dw= diff --git a/go.mod b/go.mod index d9a65c16063..7655e472f7a 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.29 github.com/smartcontractkit/chainlink-automation v0.8.1 - github.com/smartcontractkit/chainlink-ccip v0.0.0-20241112095015-3e85d9f1898b + github.com/smartcontractkit/chainlink-ccip v0.0.0-20241115103032-ec39846b3436 github.com/smartcontractkit/chainlink-common v0.3.1-0.20241114134822-aadff98ef068 github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241017133723-5277829bd53f github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20241018134907-a00ba3729b5e diff --git a/go.sum b/go.sum index 885518d69aa..016997e62f5 100644 --- a/go.sum +++ b/go.sum @@ -1076,8 +1076,8 @@ github.com/smartcontractkit/chain-selectors v1.0.29 h1:aZ9+OoUSMn4nqnissHtDvDoKR github.com/smartcontractkit/chain-selectors v1.0.29/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-20241112095015-3e85d9f1898b h1:4kmZtaQ4fXwduHnw9xk5VmiIOW4nHg/Mx6iidlZJt5o= -github.com/smartcontractkit/chainlink-ccip v0.0.0-20241112095015-3e85d9f1898b/go.mod h1:4adKaHNaxFsRvV/lYfqtbsWyyvIPUMLR0FdOJN/ljis= +github.com/smartcontractkit/chainlink-ccip v0.0.0-20241115103032-ec39846b3436 h1:n3wy96cqxsaJGoCDbFulFPHind6Etq0tiWZcwAnTs3Q= +github.com/smartcontractkit/chainlink-ccip v0.0.0-20241115103032-ec39846b3436/go.mod h1:4adKaHNaxFsRvV/lYfqtbsWyyvIPUMLR0FdOJN/ljis= github.com/smartcontractkit/chainlink-common v0.3.1-0.20241114134822-aadff98ef068 h1:2llRW4Tn9W/EZp2XvXclQ9IjeTBwwxVPrrqaerX+vCE= github.com/smartcontractkit/chainlink-common v0.3.1-0.20241114134822-aadff98ef068/go.mod h1:ny87uTW6hLjCTLiBqBRNFEhETSXhHWevYlPclT5lSco= github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241017133723-5277829bd53f h1:BwrIaQIx5Iy6eT+DfLhFfK2XqjxRm74mVdlX8gbu4dw= diff --git a/integration-tests/go.mod b/integration-tests/go.mod index b5948028f32..d233f9efdc5 100644 --- a/integration-tests/go.mod +++ b/integration-tests/go.mod @@ -36,7 +36,7 @@ require ( github.com/slack-go/slack v0.15.0 github.com/smartcontractkit/chain-selectors v1.0.29 github.com/smartcontractkit/chainlink-automation v0.8.1 - github.com/smartcontractkit/chainlink-ccip v0.0.0-20241112095015-3e85d9f1898b + github.com/smartcontractkit/chainlink-ccip v0.0.0-20241115103032-ec39846b3436 github.com/smartcontractkit/chainlink-common v0.3.1-0.20241114134822-aadff98ef068 github.com/smartcontractkit/chainlink-protos/job-distributor v0.4.0 github.com/smartcontractkit/chainlink-testing-framework/havoc v1.50.2 diff --git a/integration-tests/go.sum b/integration-tests/go.sum index 5a4bcb648cd..5635684b688 100644 --- a/integration-tests/go.sum +++ b/integration-tests/go.sum @@ -1403,8 +1403,8 @@ github.com/smartcontractkit/chain-selectors v1.0.29 h1:aZ9+OoUSMn4nqnissHtDvDoKR github.com/smartcontractkit/chain-selectors v1.0.29/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-20241112095015-3e85d9f1898b h1:4kmZtaQ4fXwduHnw9xk5VmiIOW4nHg/Mx6iidlZJt5o= -github.com/smartcontractkit/chainlink-ccip v0.0.0-20241112095015-3e85d9f1898b/go.mod h1:4adKaHNaxFsRvV/lYfqtbsWyyvIPUMLR0FdOJN/ljis= +github.com/smartcontractkit/chainlink-ccip v0.0.0-20241115103032-ec39846b3436 h1:n3wy96cqxsaJGoCDbFulFPHind6Etq0tiWZcwAnTs3Q= +github.com/smartcontractkit/chainlink-ccip v0.0.0-20241115103032-ec39846b3436/go.mod h1:4adKaHNaxFsRvV/lYfqtbsWyyvIPUMLR0FdOJN/ljis= github.com/smartcontractkit/chainlink-common v0.3.1-0.20241114134822-aadff98ef068 h1:2llRW4Tn9W/EZp2XvXclQ9IjeTBwwxVPrrqaerX+vCE= github.com/smartcontractkit/chainlink-common v0.3.1-0.20241114134822-aadff98ef068/go.mod h1:ny87uTW6hLjCTLiBqBRNFEhETSXhHWevYlPclT5lSco= github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241017133723-5277829bd53f h1:BwrIaQIx5Iy6eT+DfLhFfK2XqjxRm74mVdlX8gbu4dw= diff --git a/integration-tests/load/go.mod b/integration-tests/load/go.mod index 7398abc5af9..30cdab1097d 100644 --- a/integration-tests/load/go.mod +++ b/integration-tests/load/go.mod @@ -65,7 +65,7 @@ require ( github.com/russross/blackfriday/v2 v2.1.0 // indirect github.com/sagikazarmark/locafero v0.4.0 // indirect github.com/sagikazarmark/slog-shim v0.1.0 // indirect - github.com/smartcontractkit/chainlink-ccip v0.0.0-20241112095015-3e85d9f1898b // indirect + github.com/smartcontractkit/chainlink-ccip v0.0.0-20241115103032-ec39846b3436 // indirect github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241017133723-5277829bd53f // indirect github.com/smartcontractkit/chainlink-testing-framework/havoc v1.50.2 // indirect github.com/smartcontractkit/grpc-proxy v0.0.0-20240830132753-a7e17fec5ab7 // indirect diff --git a/integration-tests/load/go.sum b/integration-tests/load/go.sum index 6ca863f3d08..b4eaf20b15b 100644 --- a/integration-tests/load/go.sum +++ b/integration-tests/load/go.sum @@ -1392,8 +1392,8 @@ github.com/smartcontractkit/chain-selectors v1.0.29 h1:aZ9+OoUSMn4nqnissHtDvDoKR github.com/smartcontractkit/chain-selectors v1.0.29/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-20241112095015-3e85d9f1898b h1:4kmZtaQ4fXwduHnw9xk5VmiIOW4nHg/Mx6iidlZJt5o= -github.com/smartcontractkit/chainlink-ccip v0.0.0-20241112095015-3e85d9f1898b/go.mod h1:4adKaHNaxFsRvV/lYfqtbsWyyvIPUMLR0FdOJN/ljis= +github.com/smartcontractkit/chainlink-ccip v0.0.0-20241115103032-ec39846b3436 h1:n3wy96cqxsaJGoCDbFulFPHind6Etq0tiWZcwAnTs3Q= +github.com/smartcontractkit/chainlink-ccip v0.0.0-20241115103032-ec39846b3436/go.mod h1:4adKaHNaxFsRvV/lYfqtbsWyyvIPUMLR0FdOJN/ljis= github.com/smartcontractkit/chainlink-common v0.3.1-0.20241114134822-aadff98ef068 h1:2llRW4Tn9W/EZp2XvXclQ9IjeTBwwxVPrrqaerX+vCE= github.com/smartcontractkit/chainlink-common v0.3.1-0.20241114134822-aadff98ef068/go.mod h1:ny87uTW6hLjCTLiBqBRNFEhETSXhHWevYlPclT5lSco= github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241017133723-5277829bd53f h1:BwrIaQIx5Iy6eT+DfLhFfK2XqjxRm74mVdlX8gbu4dw= diff --git a/integration-tests/smoke/fee_boosting_test.go b/integration-tests/smoke/fee_boosting_test.go index 8b213a71277..d74c09ecdad 100644 --- a/integration-tests/smoke/fee_boosting_test.go +++ b/integration-tests/smoke/fee_boosting_test.go @@ -3,6 +3,7 @@ package smoke import ( "math/big" "testing" + "time" "github.com/ethereum/go-ethereum/common" "github.com/test-go/testify/require" @@ -83,7 +84,7 @@ func Test_CCIPFeeBoosting(t *testing.T) { return e, state, allChainSelectors } - t.Run("boost needed due to WETH price increase", func(t *testing.T) { + t.Run("boost needed due to WETH price increase (also covering gas price inscrease)", func(t *testing.T) { e, state, chains := setupTestEnv(t, 2) runFeeboostTestCase(feeboostTestCase{ t: t, @@ -124,27 +125,6 @@ func Test_CCIPFeeBoosting(t *testing.T) { destChain: chains[1], }) }) - - t.Run("boost needed due to gas price increase", func(t *testing.T) { - e, state, chains := setupTestEnv(t, 2) - runFeeboostTestCase(feeboostTestCase{ - t: t, - sender: common.LeftPadBytes(e.Env.Chains[chains[0]].DeployerKey.From.Bytes(), 32), - deployedEnv: e, - onchainState: state, - initialPrices: ccipdeployment.InitialPrices{ - LinkPrice: deployment.E18Mult(5), - WethPrice: deployment.E18Mult(9), - GasPrice: ccipdeployment.ToPackedFee(big.NewInt(1.75e11), big.NewInt(0)), - }, - priceFeedPrices: priceFeedPrices{ - linkPrice: deployment.E18Mult(5), - wethPrice: big.NewInt(9e8), - }, - sourceChain: chains[0], - destChain: chains[1], - }) - }) } func runFeeboostTestCase(tc feeboostTestCase) { @@ -161,7 +141,12 @@ func runFeeboostTestCase(tc feeboostTestCase) { }) expectedSeqNum[tc.destChain] = seqNum - sleepAndReplay(tc.t, tc.deployedEnv, tc.sourceChain, tc.destChain) + // hack + time.Sleep(30 * time.Second) + replayBlocks := make(map[uint64]uint64) + replayBlocks[tc.sourceChain] = 1 + replayBlocks[tc.destChain] = 1 + ccipdeployment.ReplayLogs(tc.t, tc.deployedEnv.Env.Offchain, replayBlocks) ccipdeployment.ConfirmCommitForAllWithExpectedSeqNums(tc.t, tc.deployedEnv.Env, tc.onchainState, expectedSeqNum, startBlocks) ccipdeployment.ConfirmExecWithSeqNrForAll(tc.t, tc.deployedEnv.Env, tc.onchainState, expectedSeqNum, startBlocks) From 5c9a1a5dd337c049de47c0233de16839789371b1 Mon Sep 17 00:00:00 2001 From: nogo <0xnogo@gmail.com> Date: Sat, 16 Nov 2024 09:48:59 +0400 Subject: [PATCH 20/21] adding comments --- integration-tests/smoke/fee_boosting_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/integration-tests/smoke/fee_boosting_test.go b/integration-tests/smoke/fee_boosting_test.go index d74c09ecdad..bb2452a680e 100644 --- a/integration-tests/smoke/fee_boosting_test.go +++ b/integration-tests/smoke/fee_boosting_test.go @@ -98,7 +98,7 @@ func Test_CCIPFeeBoosting(t *testing.T) { }, priceFeedPrices: priceFeedPrices{ linkPrice: deployment.E18Mult(5), - wethPrice: big.NewInt(9.9e8), + wethPrice: big.NewInt(9.9e8), // increase from 9e8 to 9.9e8 }, sourceChain: chains[0], destChain: chains[1], @@ -118,7 +118,7 @@ func Test_CCIPFeeBoosting(t *testing.T) { GasPrice: ccipdeployment.ToPackedFee(big.NewInt(1.8e11), big.NewInt(0)), }, priceFeedPrices: priceFeedPrices{ - linkPrice: big.NewInt(4.5e18), + linkPrice: big.NewInt(4.5e18), // decrease from 5e18 to 4.5e18 wethPrice: big.NewInt(9e8), }, sourceChain: chains[0], From 29944c4d833be0283d73155a49a09d526d42025e Mon Sep 17 00:00:00 2001 From: nogo <0xnogo@gmail.com> Date: Sat, 16 Nov 2024 12:56:55 +0400 Subject: [PATCH 21/21] update after last rebase --- integration-tests/go.mod | 3 +- .../smoke/ccip_messaging_test.go | 6 +-- integration-tests/smoke/fee_boosting_test.go | 45 ++++++++++--------- 3 files changed, 27 insertions(+), 27 deletions(-) diff --git a/integration-tests/go.mod b/integration-tests/go.mod index 60e4b2c7801..9e07bd4f7cb 100644 --- a/integration-tests/go.mod +++ b/integration-tests/go.mod @@ -36,7 +36,6 @@ require ( github.com/slack-go/slack v0.15.0 github.com/smartcontractkit/chain-selectors v1.0.29 github.com/smartcontractkit/chainlink-automation v0.8.1 - github.com/smartcontractkit/chainlink-ccip v0.0.0-20241115103032-ec39846b3436 github.com/smartcontractkit/chainlink-common v0.3.1-0.20241114134822-aadff98ef068 github.com/smartcontractkit/chainlink-protos/job-distributor v0.4.0 github.com/smartcontractkit/chainlink-testing-framework/havoc v1.50.2 @@ -414,7 +413,7 @@ require ( github.com/shoenig/go-m1cpu v0.1.6 // indirect github.com/sirupsen/logrus v1.9.3 // indirect github.com/smartcontractkit/ccip-owner-contracts v0.0.0-20240926212305-a6deabdfce86 // indirect - github.com/smartcontractkit/chainlink-ccip v0.0.0-20241112095015-3e85d9f1898b // indirect + github.com/smartcontractkit/chainlink-ccip v0.0.0-20241115103032-ec39846b3436 // indirect github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241017133723-5277829bd53f // indirect github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20241018134907-a00ba3729b5e // indirect github.com/smartcontractkit/chainlink-feeds v0.1.1 // indirect diff --git a/integration-tests/smoke/ccip_messaging_test.go b/integration-tests/smoke/ccip_messaging_test.go index 317fb9721b2..4aa9ba34229 100644 --- a/integration-tests/smoke/ccip_messaging_test.go +++ b/integration-tests/smoke/ccip_messaging_test.go @@ -105,11 +105,7 @@ func Test_CCIPMessaging(t *testing.T) { } // connect a single lane, source to dest -<<<<<<< HEAD - require.NoError(t, ccipdeployment.AddLaneWithDefaultPrices(e.Env, state, sourceChain, destChain)) -======= - require.NoError(t, ccdeploy.AddLane(e.Env, state, sourceChain, destChain)) ->>>>>>> develop + require.NoError(t, ccdeploy.AddLaneWithDefaultPrices(e.Env, state, sourceChain, destChain)) var ( replayed bool diff --git a/integration-tests/smoke/fee_boosting_test.go b/integration-tests/smoke/fee_boosting_test.go index bb2452a680e..625200360e8 100644 --- a/integration-tests/smoke/fee_boosting_test.go +++ b/integration-tests/smoke/fee_boosting_test.go @@ -12,7 +12,6 @@ import ( jobv1 "github.com/smartcontractkit/chainlink-protos/job-distributor/v1/job" "github.com/smartcontractkit/chainlink/deployment" ccdeploy "github.com/smartcontractkit/chainlink/deployment/ccip" - ccipdeployment "github.com/smartcontractkit/chainlink/deployment/ccip" "github.com/smartcontractkit/chainlink/deployment/ccip/changeset" "github.com/smartcontractkit/chainlink/integration-tests/ccip-tests/testsetups" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/router" @@ -22,9 +21,9 @@ import ( type feeboostTestCase struct { t *testing.T sender []byte - deployedEnv ccipdeployment.DeployedEnv - onchainState ccipdeployment.CCIPOnChainState - initialPrices ccipdeployment.InitialPrices + deployedEnv ccdeploy.DeployedEnv + onchainState ccdeploy.CCIPOnChainState + initialPrices ccdeploy.InitialPrices priceFeedPrices priceFeedPrices sourceChain, destChain uint64 } @@ -38,31 +37,37 @@ type priceFeedPrices struct { func Test_CCIPFeeBoosting(t *testing.T) { ctx := ccdeploy.Context(t) - setupTestEnv := func(t *testing.T, numChains int) (ccipdeployment.DeployedEnv, ccipdeployment.CCIPOnChainState, []uint64) { + setupTestEnv := func(t *testing.T, numChains int) (ccdeploy.DeployedEnv, ccdeploy.CCIPOnChainState, []uint64) { e, _, _ := testsetups.NewLocalDevEnvironment( t, logger.TestLogger(t), deployment.E18Mult(5), big.NewInt(9e8)) - state, err := ccipdeployment.LoadOnchainState(e.Env) + state, err := ccdeploy.LoadOnchainState(e.Env) require.NoError(t, err) allChainSelectors := maps.Keys(e.Env.Chains) require.Len(t, allChainSelectors, numChains) - tokenConfig := ccipdeployment.NewTestTokenConfig(state.Chains[e.FeedChainSel].USDFeeds) + output, err := changeset.DeployPrerequisites(e.Env, changeset.DeployPrerequisiteConfig{ + ChainSelectors: e.Env.AllChainSelectors(), + }) + require.NoError(t, err) + require.NoError(t, e.Env.ExistingAddresses.Merge(output.AddressBook)) + + tokenConfig := ccdeploy.NewTestTokenConfig(state.Chains[e.FeedChainSel].USDFeeds) // Apply migration - output, err := changeset.InitialDeploy(e.Env, ccdeploy.DeployCCIPContractConfig{ + output, err = changeset.InitialDeploy(e.Env, ccdeploy.DeployCCIPContractConfig{ HomeChainSel: e.HomeChainSel, FeedChainSel: e.FeedChainSel, ChainsToDeploy: allChainSelectors, TokenConfig: tokenConfig, - MCMSConfig: ccipdeployment.NewTestMCMSConfig(t, e.Env), + MCMSConfig: ccdeploy.NewTestMCMSConfig(t, e.Env), OCRSecrets: deployment.XXXGenerateTestOCRSecrets(), }) require.NoError(t, err) require.NoError(t, e.Env.ExistingAddresses.Merge(output.AddressBook)) - state, err = ccipdeployment.LoadOnchainState(e.Env) + state, err = ccdeploy.LoadOnchainState(e.Env) require.NoError(t, err) // Ensure capreg logs are up to date. @@ -91,10 +96,10 @@ func Test_CCIPFeeBoosting(t *testing.T) { sender: common.LeftPadBytes(e.Env.Chains[chains[0]].DeployerKey.From.Bytes(), 32), deployedEnv: e, onchainState: state, - initialPrices: ccipdeployment.InitialPrices{ + initialPrices: ccdeploy.InitialPrices{ LinkPrice: deployment.E18Mult(5), WethPrice: deployment.E18Mult(9), - GasPrice: ccipdeployment.ToPackedFee(big.NewInt(1.8e11), big.NewInt(0)), + GasPrice: ccdeploy.ToPackedFee(big.NewInt(1.8e11), big.NewInt(0)), }, priceFeedPrices: priceFeedPrices{ linkPrice: deployment.E18Mult(5), @@ -112,10 +117,10 @@ func Test_CCIPFeeBoosting(t *testing.T) { sender: common.LeftPadBytes(e.Env.Chains[chains[0]].DeployerKey.From.Bytes(), 32), deployedEnv: e, onchainState: state, - initialPrices: ccipdeployment.InitialPrices{ + initialPrices: ccdeploy.InitialPrices{ LinkPrice: deployment.E18Mult(5), WethPrice: deployment.E18Mult(9), - GasPrice: ccipdeployment.ToPackedFee(big.NewInt(1.8e11), big.NewInt(0)), + GasPrice: ccdeploy.ToPackedFee(big.NewInt(1.8e11), big.NewInt(0)), }, priceFeedPrices: priceFeedPrices{ linkPrice: big.NewInt(4.5e18), // decrease from 5e18 to 4.5e18 @@ -128,26 +133,26 @@ func Test_CCIPFeeBoosting(t *testing.T) { } func runFeeboostTestCase(tc feeboostTestCase) { - require.NoError(tc.t, ccipdeployment.AddLane(tc.deployedEnv.Env, tc.onchainState, tc.sourceChain, tc.destChain, tc.initialPrices)) + require.NoError(tc.t, ccdeploy.AddLane(tc.deployedEnv.Env, tc.onchainState, tc.sourceChain, tc.destChain, tc.initialPrices)) startBlocks := make(map[uint64]*uint64) expectedSeqNum := make(map[uint64]uint64) - seqNum := ccipdeployment.TestSendRequest(tc.t, tc.deployedEnv.Env, tc.onchainState, tc.sourceChain, tc.destChain, false, router.ClientEVM2AnyMessage{ + msgSentEvent := ccdeploy.TestSendRequest(tc.t, tc.deployedEnv.Env, tc.onchainState, tc.sourceChain, tc.destChain, false, router.ClientEVM2AnyMessage{ Receiver: common.LeftPadBytes(tc.onchainState.Chains[tc.destChain].Receiver.Address().Bytes(), 32), Data: []byte("message that needs fee boosting"), TokenAmounts: nil, FeeToken: common.HexToAddress("0x0"), ExtraArgs: nil, }) - expectedSeqNum[tc.destChain] = seqNum + expectedSeqNum[tc.destChain] = msgSentEvent.SequenceNumber // hack time.Sleep(30 * time.Second) replayBlocks := make(map[uint64]uint64) replayBlocks[tc.sourceChain] = 1 replayBlocks[tc.destChain] = 1 - ccipdeployment.ReplayLogs(tc.t, tc.deployedEnv.Env.Offchain, replayBlocks) + ccdeploy.ReplayLogs(tc.t, tc.deployedEnv.Env.Offchain, replayBlocks) - ccipdeployment.ConfirmCommitForAllWithExpectedSeqNums(tc.t, tc.deployedEnv.Env, tc.onchainState, expectedSeqNum, startBlocks) - ccipdeployment.ConfirmExecWithSeqNrForAll(tc.t, tc.deployedEnv.Env, tc.onchainState, expectedSeqNum, startBlocks) + ccdeploy.ConfirmCommitForAllWithExpectedSeqNums(tc.t, tc.deployedEnv.Env, tc.onchainState, expectedSeqNum, startBlocks) + ccdeploy.ConfirmExecWithSeqNrForAll(tc.t, tc.deployedEnv.Env, tc.onchainState, expectedSeqNum, startBlocks) }