From 396fe0a845495cfb74eda9cd0673be2e9b770f50 Mon Sep 17 00:00:00 2001 From: Pablo Estrada <139084212+ecPablo@users.noreply.github.com> Date: Tue, 25 Feb 2025 18:44:41 -0600 Subject: [PATCH 01/12] feat: update mcms lib with new timelock converter and update BuildProposalFromBatches() for solana chain metadata (#16528) * feat: update mcms lib with new timelock converter and update BuildProposalFromBatchesV2() to accept env for extracting solana metadata. * feat: update go mod to new mcms and ccip-solana version * feat: update go mod to new mcms and ccip-solana version * fix: go mod * fix: go mod * fix: go mod core scripts * chore: add changeset * fix: update tx field name to RawData * fix: more cleanup - update tests - go mod tidy - delete comments - other bug fixes * fix: break dep cycle for state package, stop relying on proposalutils package so the `buildProposalMetadataV2` can call `MaybeLoadMCMSWithTimelockChainStateSolana` * fix: merge conflicts develop * fix: go sum * fix: update lib * fix: upgrade ccip solana * fix: downgrade ccip solana for rest of core packages and chainlink/deployment * fix: go mod core scripts add replace * fix: downgrade solana from mcms lib * fix: merge conflicts develop * fix: merge conflicts develop * fix: go mod deps * fix: params in solana utils --------- Co-authored-by: Graham Goh --- .changeset/brave-geese-build.md | 5 ++ core/scripts/go.mod | 3 +- core/scripts/go.sum | 4 +- deployment/ccip/changeset/deployer_group.go | 2 +- .../ccip/changeset/solana/cs_deploy_chain.go | 2 +- .../transfer_ccip_to_mcms_with_timelock.go | 2 +- deployment/ccip/changeset/solana/utils.go | 2 +- deployment/ccip/changeset/v1_5/cs_rmn.go | 2 +- .../ccip/changeset/v1_6/cs_ccip_home.go | 10 +-- .../ccip/changeset/v1_6/cs_chain_contracts.go | 30 +++---- .../ccip/changeset/v1_6/cs_home_chain.go | 2 +- .../changeset/v1_6/cs_update_rmn_config.go | 8 +- .../deploy_mcms_with_timelock_test.go | 17 +--- .../common/changeset/example/link_transfer.go | 2 +- .../changeset/example/solana_transfer_mcm.go | 2 +- .../common/changeset/set_config_mcms.go | 4 +- deployment/common/changeset/state/evm.go | 32 +++++-- deployment/common/changeset/state/evm_test.go | 7 +- .../common/changeset/state/solana_test.go | 17 +--- deployment/common/changeset/test_helpers.go | 15 ++++ .../transfer_to_mcms_with_timelock.go | 2 +- .../common/proposalutils/mcms_helpers.go | 8 +- .../common/proposalutils/mcms_test_helpers.go | 8 +- deployment/common/proposalutils/propose.go | 64 ++++++++++---- .../common/proposalutils/propose_test.go | 85 +++++++++++++++---- deployment/go.mod | 2 +- deployment/go.sum | 4 +- .../keystone/changeset/add_capabilities.go | 2 +- deployment/keystone/changeset/add_nodes.go | 2 +- .../changeset/append_node_capabilities.go | 2 +- deployment/keystone/changeset/deploy_ocr3.go | 2 +- .../changeset/update_node_capabilities.go | 2 +- deployment/keystone/changeset/update_nodes.go | 2 +- .../changeset/workflowregistry/strategies.go | 2 +- integration-tests/go.mod | 2 +- integration-tests/go.sum | 4 +- integration-tests/load/go.mod | 2 +- integration-tests/load/go.sum | 4 +- system-tests/lib/go.mod | 2 +- system-tests/lib/go.sum | 4 +- system-tests/tests/go.mod | 2 +- system-tests/tests/go.sum | 4 +- 42 files changed, 238 insertions(+), 141 deletions(-) create mode 100644 .changeset/brave-geese-build.md diff --git a/.changeset/brave-geese-build.md b/.changeset/brave-geese-build.md new file mode 100644 index 00000000000..9b542ad9188 --- /dev/null +++ b/.changeset/brave-geese-build.md @@ -0,0 +1,5 @@ +--- +"chainlink": minor +--- + +#updated update mcms lib dependency. diff --git a/core/scripts/go.mod b/core/scripts/go.mod index 26490e4fb2e..50eb43c9f9c 100644 --- a/core/scripts/go.mod +++ b/core/scripts/go.mod @@ -352,7 +352,7 @@ require ( github.com/smartcontractkit/chainlink-solana v1.1.2-0.20250213203720-e15b1333a14a // indirect github.com/smartcontractkit/chainlink-testing-framework/framework v0.5.3 // indirect github.com/smartcontractkit/grpc-proxy v0.0.0-20240830132753-a7e17fec5ab7 // indirect - github.com/smartcontractkit/mcms v0.10.0 // indirect + github.com/smartcontractkit/mcms v0.12.2 // indirect github.com/smartcontractkit/tdh2/go/ocr2/decryptionplugin v0.0.0-20241009055228-33d0c0bf38de // indirect github.com/smartcontractkit/tdh2/go/tdh2 v0.0.0-20241009055228-33d0c0bf38de // indirect github.com/smartcontractkit/wsrpc v0.8.3 // indirect @@ -454,6 +454,5 @@ replace ( github.com/btcsuite/btcd/btcec/v2 => github.com/btcsuite/btcd/btcec/v2 v2.3.2 // replicating the replace directive on cosmos SDK github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1 - github.com/sourcegraph/sourcegraph/lib => github.com/sourcegraph/sourcegraph-public-snapshot/lib v0.0.0-20240822153003-c864f15af264 ) diff --git a/core/scripts/go.sum b/core/scripts/go.sum index ff891a5050c..56f76930831 100644 --- a/core/scripts/go.sum +++ b/core/scripts/go.sum @@ -1123,8 +1123,8 @@ github.com/smartcontractkit/grpc-proxy v0.0.0-20240830132753-a7e17fec5ab7 h1:12i github.com/smartcontractkit/grpc-proxy v0.0.0-20240830132753-a7e17fec5ab7/go.mod h1:FX7/bVdoep147QQhsOPkYsPEXhGZjeYx6lBSaSXtZOA= github.com/smartcontractkit/libocr v0.0.0-20250220133800-f3b940c4f298 h1:PKiqnVOTChlH4a4ljJKL3OKGRgYfIpJS4YD1daAIKks= github.com/smartcontractkit/libocr v0.0.0-20250220133800-f3b940c4f298/go.mod h1:Mb7+/LC4edz7HyHxX4QkE42pSuov4AV68+AxBXAap0o= -github.com/smartcontractkit/mcms v0.10.0 h1:wkBAr8HLyHKwejdwsDOMvIwmzT83tKr3jjB9senLahM= -github.com/smartcontractkit/mcms v0.10.0/go.mod h1:3N7+yvkO3hIFXYRYm3hxKCE6qDWdOC/rZdvIrwzlLKk= +github.com/smartcontractkit/mcms v0.12.2 h1:CTeQmtdYOdqWLuiGHNS67qqEdtJO8r8AygOYN/VpaZM= +github.com/smartcontractkit/mcms v0.12.2/go.mod h1:RKo4v2ClzKPHyllstwVeqdPP7Bb5v+qMMPgO8iMq0Qc= github.com/smartcontractkit/tdh2/go/ocr2/decryptionplugin v0.0.0-20241009055228-33d0c0bf38de h1:n0w0rKF+SVM+S3WNlup6uabXj2zFlFNfrlsKCMMb/co= github.com/smartcontractkit/tdh2/go/ocr2/decryptionplugin v0.0.0-20241009055228-33d0c0bf38de/go.mod h1:Sl2MF/Fp3fgJIVzhdGhmZZX2BlnM0oUUyBP4s4xYb6o= github.com/smartcontractkit/tdh2/go/tdh2 v0.0.0-20241009055228-33d0c0bf38de h1:66VQxXx3lvTaAZrMBkIcdH9VEjujUEvmBQdnyOJnkOc= diff --git a/deployment/ccip/changeset/deployer_group.go b/deployment/ccip/changeset/deployer_group.go index e389de0325a..cc35e329846 100644 --- a/deployment/ccip/changeset/deployer_group.go +++ b/deployment/ccip/changeset/deployer_group.go @@ -285,7 +285,7 @@ func (d *DeployerGroup) enactMcms() (deployment.ChangesetOutput, error) { } proposal, err := proposalutils.BuildProposalFromBatchesV2( - d.e.GetContext(), + d.e, timelocks, proposerMcms, inspectors, diff --git a/deployment/ccip/changeset/solana/cs_deploy_chain.go b/deployment/ccip/changeset/solana/cs_deploy_chain.go index f9aefd5ef33..00260f10f1c 100644 --- a/deployment/ccip/changeset/solana/cs_deploy_chain.go +++ b/deployment/ccip/changeset/solana/cs_deploy_chain.go @@ -174,7 +174,7 @@ func DeployChainContractsChangeset(e deployment.Environment, c DeployChainContra if len(batches) > 0 { proposal, err := proposalutils.BuildProposalFromBatchesV2( - e.GetContext(), + e, timelocks, proposers, inspectors, diff --git a/deployment/ccip/changeset/solana/transfer_ccip_to_mcms_with_timelock.go b/deployment/ccip/changeset/solana/transfer_ccip_to_mcms_with_timelock.go index 6a71f10f8c8..07da0358659 100644 --- a/deployment/ccip/changeset/solana/transfer_ccip_to_mcms_with_timelock.go +++ b/deployment/ccip/changeset/solana/transfer_ccip_to_mcms_with_timelock.go @@ -203,7 +203,7 @@ func TransferCCIPToMCMSWithTimelockSolana( } proposal, err := proposalutils.BuildProposalFromBatchesV2( - e.GetContext(), + e, timelocks, proposers, inspectors, diff --git a/deployment/ccip/changeset/solana/utils.go b/deployment/ccip/changeset/solana/utils.go index e79ee3e5f8f..6cb8bb12622 100644 --- a/deployment/ccip/changeset/solana/utils.go +++ b/deployment/ccip/changeset/solana/utils.go @@ -81,7 +81,7 @@ func BuildProposalsForTxns( Transactions: txns, }) proposal, err := proposalutils.BuildProposalFromBatchesV2( - e.GetContext(), + e, timelocks, proposers, inspectors, diff --git a/deployment/ccip/changeset/v1_5/cs_rmn.go b/deployment/ccip/changeset/v1_5/cs_rmn.go index 7f9e2cdc092..3b3d14af6bb 100644 --- a/deployment/ccip/changeset/v1_5/cs_rmn.go +++ b/deployment/ccip/changeset/v1_5/cs_rmn.go @@ -167,7 +167,7 @@ func PermaBlessCommitStoreChangeset(env deployment.Environment, c PermaBlessComm } timelockProposal, err := proposalutils.BuildProposalFromBatchesV2( - env.GetContext(), + env, timelocks, proposerMcms, inspectors, diff --git a/deployment/ccip/changeset/v1_6/cs_ccip_home.go b/deployment/ccip/changeset/v1_6/cs_ccip_home.go index 01ce9f4224b..ca8fe58e13b 100644 --- a/deployment/ccip/changeset/v1_6/cs_ccip_home.go +++ b/deployment/ccip/changeset/v1_6/cs_ccip_home.go @@ -437,7 +437,7 @@ func PromoteCandidateChangeset( batches := []mcmstypes.BatchOperation{{ChainSelector: mcmstypes.ChainSelector(cfg.HomeChainSelector), Transactions: mcmsTxs}} prop, err := proposalutils.BuildProposalFromBatchesV2( - e.GetContext(), + e, timelocks, proposers, inspectors, @@ -686,7 +686,7 @@ func AddDonAndSetCandidateChangeset( batches := []mcmstypes.BatchOperation{{ChainSelector: mcmstypes.ChainSelector(cfg.HomeChainSelector), Transactions: donMcmsTxs}} prop, err := proposalutils.BuildProposalFromBatchesV2( - e.GetContext(), + e, timelocks, proposers, inspectors, @@ -875,7 +875,7 @@ func SetCandidateChangeset( batches := []mcmstypes.BatchOperation{{ChainSelector: mcmstypes.ChainSelector(cfg.HomeChainSelector), Transactions: setCandidateMcmsTxs}} prop, err := proposalutils.BuildProposalFromBatchesV2( - e.GetContext(), + e, timelocks, proposers, inspectors, @@ -1163,7 +1163,7 @@ func RevokeCandidateChangeset(e deployment.Environment, cfg RevokeCandidateChang batches := []mcmstypes.BatchOperation{{ChainSelector: mcmstypes.ChainSelector(cfg.HomeChainSelector), Transactions: ops}} prop, err := proposalutils.BuildProposalFromBatchesV2( - e.GetContext(), + e, timelocks, proposers, inspectors, @@ -1369,7 +1369,7 @@ func UpdateChainConfigChangeset(e deployment.Environment, cfg UpdateChainConfigC } prop, err := proposalutils.BuildProposalFromBatchesV2( - e.GetContext(), + e, timelocks, proposers, inspectors, diff --git a/deployment/ccip/changeset/v1_6/cs_chain_contracts.go b/deployment/ccip/changeset/v1_6/cs_chain_contracts.go index 0d0f6c5f959..a7f1989da35 100644 --- a/deployment/ccip/changeset/v1_6/cs_chain_contracts.go +++ b/deployment/ccip/changeset/v1_6/cs_chain_contracts.go @@ -249,7 +249,7 @@ func UpdateNonceManagersChangeset(e deployment.Environment, cfg UpdateNonceManag } proposal, err := proposalutils.BuildProposalFromBatchesV2( - e.GetContext(), + e, timelocks, proposers, inspectors, @@ -393,7 +393,7 @@ func UpdateOnRampsDestsChangeset(e deployment.Environment, cfg UpdateOnRampDests } proposal, err := proposalutils.BuildProposalFromBatchesV2( - e.GetContext(), + e, timelocks, proposers, inspectors, @@ -508,7 +508,7 @@ func UpdateOnRampDynamicConfigChangeset(e deployment.Environment, cfg UpdateOnRa } proposal, err := proposalutils.BuildProposalFromBatchesV2( - e.GetContext(), timelocks, proposers, inspectors, batches, + e, timelocks, proposers, inspectors, batches, "update onramp dynamic config", cfg.MCMS.MinDelay) if err != nil { @@ -666,7 +666,7 @@ func UpdateOnRampAllowListChangeset(e deployment.Environment, cfg UpdateOnRampAl } proposal, err := proposalutils.BuildProposalFromBatchesV2( - e.GetContext(), + e, timelocks, proposers, inspectors, @@ -768,7 +768,7 @@ func WithdrawOnRampFeeTokensChangeset(e deployment.Environment, cfg WithdrawOnRa } proposal, err := proposalutils.BuildProposalFromBatchesV2( - e.GetContext(), + e, timelocks, proposers, inspectors, @@ -935,7 +935,7 @@ func UpdateFeeQuoterPricesChangeset(e deployment.Environment, cfg UpdateFeeQuote } proposal, err := proposalutils.BuildProposalFromBatchesV2( - e.GetContext(), + e, timelocks, proposers, inspectors, @@ -1056,7 +1056,7 @@ func UpdateFeeQuoterDestsChangeset(e deployment.Environment, cfg UpdateFeeQuoter } proposal, err := proposalutils.BuildProposalFromBatchesV2( - e.GetContext(), + e, timelocks, proposers, inspectors, @@ -1196,7 +1196,7 @@ func UpdateOffRampSourcesChangeset(e deployment.Environment, cfg UpdateOffRampSo } proposal, err := proposalutils.BuildProposalFromBatchesV2( - e.GetContext(), + e, timelocks, proposers, inspectors, @@ -1376,7 +1376,7 @@ func UpdateRouterRampsChangeset(e deployment.Environment, cfg UpdateRouterRampsC } proposal, err := proposalutils.BuildProposalFromBatchesV2( - e.GetContext(), + e, timelocks, proposers, inspectors, @@ -1518,7 +1518,7 @@ func SetOCR3OffRampChangeset(e deployment.Environment, cfg SetOCR3OffRampConfig) } proposal, err := proposalutils.BuildProposalFromBatchesV2( - e.GetContext(), + e, timelocks, proposers, inspectors, @@ -1632,7 +1632,7 @@ func UpdateDynamicConfigOffRampChangeset(e deployment.Environment, cfg UpdateDyn } proposal, err := proposalutils.BuildProposalFromBatchesV2( - e.GetContext(), + e, timelocks, proposers, inspectors, @@ -1854,7 +1854,7 @@ func ApplyFeeTokensUpdatesFeeQuoterChangeset(e deployment.Environment, cfg Apply return deployment.ChangesetOutput{}, nil } p, err := proposalutils.BuildProposalFromBatchesV2( - e.GetContext(), + e, timelocks, proposers, inspectorPerChain, @@ -2007,7 +2007,7 @@ func UpdateTokenPriceFeedsFeeQuoterChangeset(e deployment.Environment, cfg Updat return deployment.ChangesetOutput{}, nil } p, err := proposalutils.BuildProposalFromBatchesV2( - e.GetContext(), + e, timelocks, proposers, inspectorPerChain, @@ -2131,7 +2131,7 @@ func ApplyPremiumMultiplierWeiPerEthUpdatesFeeQuoterChangeset(e deployment.Envir return deployment.ChangesetOutput{}, nil } p, err := proposalutils.BuildProposalFromBatchesV2( - e.GetContext(), + e, timelocks, proposers, inspectorPerChain, @@ -2311,7 +2311,7 @@ func ApplyTokenTransferFeeConfigUpdatesFeeQuoterChangeset(e deployment.Environme return deployment.ChangesetOutput{}, nil } p, err := proposalutils.BuildProposalFromBatchesV2( - e.GetContext(), + e, timelocks, proposers, inspectorPerChain, diff --git a/deployment/ccip/changeset/v1_6/cs_home_chain.go b/deployment/ccip/changeset/v1_6/cs_home_chain.go index 62f14432d22..649b25b9848 100644 --- a/deployment/ccip/changeset/v1_6/cs_home_chain.go +++ b/deployment/ccip/changeset/v1_6/cs_home_chain.go @@ -514,7 +514,7 @@ func RemoveDONs(e deployment.Environment, cfg RemoveDONsConfig) (deployment.Chan inspectors := map[uint64]mcmssdk.Inspector{cfg.HomeChainSel: mcmsevmsdk.NewInspector(homeChain.Client)} proposal, err := proposalutils.BuildProposalFromBatchesV2( - e.GetContext(), + e, timelocks, proposerMcms, inspectors, diff --git a/deployment/ccip/changeset/v1_6/cs_update_rmn_config.go b/deployment/ccip/changeset/v1_6/cs_update_rmn_config.go index e6a452b7d96..257ddf5753e 100644 --- a/deployment/ccip/changeset/v1_6/cs_update_rmn_config.go +++ b/deployment/ccip/changeset/v1_6/cs_update_rmn_config.go @@ -101,7 +101,7 @@ func SetRMNRemoteOnRMNProxyChangeset(e deployment.Environment, cfg SetRMNRemoteO } prop, err := proposalutils.BuildProposalFromBatchesV2( - e.GetContext(), + e, timelocks, proposerMcms, inspectors, @@ -381,7 +381,7 @@ func SetRMNHomeCandidateConfigChangeset(e deployment.Environment, config SetRMNH } proposal, err := proposalutils.BuildProposalFromBatchesV2( - e.GetContext(), + e, timelocks, proposerMcms, inspectors, @@ -460,7 +460,7 @@ func PromoteRMNHomeCandidateConfigChangeset(e deployment.Environment, config Pro } proposal, err := proposalutils.BuildProposalFromBatchesV2( - e.GetContext(), + e, timelocks, proposerMcms, inspectors, @@ -757,7 +757,7 @@ func SetRMNRemoteConfigChangeset(e deployment.Environment, config SetRMNRemoteCo } proposal, err := proposalutils.BuildProposalFromBatchesV2( - e.GetContext(), + e, timelocks, proposerMcms, inspectors, diff --git a/deployment/common/changeset/deploy_mcms_with_timelock_test.go b/deployment/common/changeset/deploy_mcms_with_timelock_test.go index 77e33ed42a3..b76736bad35 100644 --- a/deployment/common/changeset/deploy_mcms_with_timelock_test.go +++ b/deployment/common/changeset/deploy_mcms_with_timelock_test.go @@ -16,6 +16,7 @@ import ( "go.uber.org/zap/zapcore" timelockBindings "github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings/timelock" + "github.com/smartcontractkit/chainlink/deployment" commonchangeset "github.com/smartcontractkit/chainlink/deployment/common/changeset" mcmschangesetstate "github.com/smartcontractkit/chainlink/deployment/common/changeset/state" @@ -127,7 +128,7 @@ func TestDeployMCMSWithTimelockV2(t *testing.T) { deployment.CreateLegacyChangeSet(commonchangeset.DeployMCMSWithTimelockV2), changesetConfig, ) - setPreloadedSolanaAddresses(t, env, solanaSelectors[0]) + commonchangeset.SetPreloadedSolanaAddresses(t, env, solanaSelectors[0]) // --- act --- updatedEnv, err := commonchangeset.Apply(t, env, nil, configuredChangeset) @@ -275,20 +276,6 @@ func timelockSignerPDA(programID solana.PublicKey, seed mcmschangesetstate.PDASe return mcmschangesetstate.GetTimelockSignerPDA(programID, seed).String() } -func setPreloadedSolanaAddresses(t *testing.T, env deployment.Environment, selector uint64) { - typeAndVersion := deployment.NewTypeAndVersion(commontypes.ManyChainMultisigProgram, deployment.Version1_0_0) - err := env.ExistingAddresses.Save(selector, memory.SolanaProgramIDs["mcm"], typeAndVersion) - require.NoError(t, err) - - typeAndVersion = deployment.NewTypeAndVersion(commontypes.AccessControllerProgram, deployment.Version1_0_0) - err = env.ExistingAddresses.Save(selector, memory.SolanaProgramIDs["access_controller"], typeAndVersion) - require.NoError(t, err) - - typeAndVersion = deployment.NewTypeAndVersion(commontypes.RBACTimelockProgram, deployment.Version1_0_0) - err = env.ExistingAddresses.Save(selector, memory.SolanaProgramIDs["timelock"], typeAndVersion) - require.NoError(t, err) -} - func solanaTimelockConfig( ctx context.Context, t *testing.T, chain deployment.SolChain, programID solana.PublicKey, seed mcmschangesetstate.PDASeed, ) timelockBindings.Config { diff --git a/deployment/common/changeset/example/link_transfer.go b/deployment/common/changeset/example/link_transfer.go index 5f0de197084..fbdca840ae6 100644 --- a/deployment/common/changeset/example/link_transfer.go +++ b/deployment/common/changeset/example/link_transfer.go @@ -291,7 +291,7 @@ func LinkTransferV2(e deployment.Environment, cfg *LinkTransferConfig) (deployme if cfg.McmsConfig != nil { proposal, err := proposalutils.BuildProposalFromBatchesV2( - e.GetContext(), + e, timelockAddressesPerChain, proposerAddressPerChain, inspectorPerChain, diff --git a/deployment/common/changeset/example/solana_transfer_mcm.go b/deployment/common/changeset/example/solana_transfer_mcm.go index 6fdc197fe73..8a164099515 100644 --- a/deployment/common/changeset/example/solana_transfer_mcm.go +++ b/deployment/common/changeset/example/solana_transfer_mcm.go @@ -119,7 +119,7 @@ func (f TransferFromTimelock) Apply(e deployment.Environment, config TransferFro }) } proposal, err := proposalutils.BuildProposalFromBatchesV2( - e.GetContext(), + e, timelocks, proposers, inspectors, diff --git a/deployment/common/changeset/set_config_mcms.go b/deployment/common/changeset/set_config_mcms.go index 01ebe005ed6..b70656a92da 100644 --- a/deployment/common/changeset/set_config_mcms.go +++ b/deployment/common/changeset/set_config_mcms.go @@ -170,7 +170,7 @@ func setConfigOrTxDataV2(ctx context.Context, lggr logger.Logger, chain deployme return nil, err } - transaction := res.RawTransaction.(*types.Transaction) + transaction := res.RawData.(*types.Transaction) if !useMCMS { _, err = deployment.ConfirmIfNoErrorWithABI(chain, transaction, gethwrappers.ManyChainMultiSigABI, err) if err != nil { @@ -357,7 +357,7 @@ func SetConfigMCMSV2(e deployment.Environment, cfg MCMSConfigV2) (deployment.Cha } if useMCMS { - proposal, err := proposalutils.BuildProposalFromBatchesV2(e.GetContext(), timelockAddressesPerChain, + proposal, err := proposalutils.BuildProposalFromBatchesV2(e, timelockAddressesPerChain, proposerMcmsPerChain, inspectorPerChain, batches, "Set config proposal", cfg.ProposalConfig.MinDelay) if err != nil { return deployment.ChangesetOutput{}, fmt.Errorf("failed to build proposal from batch: %w", err) diff --git a/deployment/common/changeset/state/evm.go b/deployment/common/changeset/state/evm.go index 56aec845339..9bac1c4b963 100644 --- a/deployment/common/changeset/state/evm.go +++ b/deployment/common/changeset/state/evm.go @@ -8,7 +8,6 @@ import ( bindings "github.com/smartcontractkit/ccip-owner-contracts/pkg/gethwrappers" "github.com/smartcontractkit/chainlink/deployment" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" "github.com/smartcontractkit/chainlink/deployment/common/types" view "github.com/smartcontractkit/chainlink/deployment/common/view/v1_0" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/link_token_interface" @@ -20,7 +19,32 @@ import ( // It is public for use in product specific packages. // Either all fields are nil or all fields are non-nil. type MCMSWithTimelockState struct { - *proposalutils.MCMSWithTimelockContracts + CancellerMcm *bindings.ManyChainMultiSig + BypasserMcm *bindings.ManyChainMultiSig + ProposerMcm *bindings.ManyChainMultiSig + Timelock *bindings.RBACTimelock + CallProxy *bindings.CallProxy +} + +// Validate checks that all fields are non-nil, ensuring it's ready +// for use generating views or interactions. +func (state MCMSWithTimelockState) Validate() error { + if state.Timelock == nil { + return errors.New("timelock not found") + } + if state.CancellerMcm == nil { + return errors.New("canceller not found") + } + if state.ProposerMcm == nil { + return errors.New("proposer not found") + } + if state.BypasserMcm == nil { + return errors.New("bypasser not found") + } + if state.CallProxy == nil { + return errors.New("call proxy not found") + } + return nil } func (state MCMSWithTimelockState) GenerateMCMSWithTimelockView() (view.MCMSWithTimelockView, error) { @@ -61,9 +85,7 @@ func MaybeLoadMCMSWithTimelockState(env deployment.Environment, chainSelectors [ // - It only found part of the bundle of contracts // - If found more than one instance of a contract (we expect one bundle in the given addresses) func MaybeLoadMCMSWithTimelockChainState(chain deployment.Chain, addresses map[string]deployment.TypeAndVersion) (*MCMSWithTimelockState, error) { - state := MCMSWithTimelockState{ - MCMSWithTimelockContracts: &proposalutils.MCMSWithTimelockContracts{}, - } + state := MCMSWithTimelockState{} // We expect one of each contract on the chain. timelock := deployment.NewTypeAndVersion(types.RBACTimelock, deployment.Version1_0_0) callProxy := deployment.NewTypeAndVersion(types.CallProxy, deployment.Version1_0_0) diff --git a/deployment/common/changeset/state/evm_test.go b/deployment/common/changeset/state/evm_test.go index 0a5a639ece8..62e0b457be3 100644 --- a/deployment/common/changeset/state/evm_test.go +++ b/deployment/common/changeset/state/evm_test.go @@ -15,7 +15,6 @@ import ( "go.uber.org/zap/zapcore" "github.com/smartcontractkit/chainlink/deployment" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" "github.com/smartcontractkit/chainlink/deployment/environment/memory" "github.com/smartcontractkit/chainlink/v2/core/logger" ) @@ -46,13 +45,13 @@ func TestMCMSWithTimelockState_GenerateMCMSWithTimelockViewV2(t *testing.T) { tests := []struct { name string - contracts *proposalutils.MCMSWithTimelockContracts + contracts *MCMSWithTimelockState want string wantErr string }{ { name: "success", - contracts: &proposalutils.MCMSWithTimelockContracts{ + contracts: &MCMSWithTimelockState{ ProposerMcm: proposerMcm, CancellerMcm: cancellerMcm, BypasserMcm: bypasserMcm, @@ -110,7 +109,7 @@ func TestMCMSWithTimelockState_GenerateMCMSWithTimelockViewV2(t *testing.T) { } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - state := MCMSWithTimelockState{tt.contracts} + state := tt.contracts got, err := state.GenerateMCMSWithTimelockView() diff --git a/deployment/common/changeset/state/solana_test.go b/deployment/common/changeset/state/solana_test.go index fea1a458701..cb87523acee 100644 --- a/deployment/common/changeset/state/solana_test.go +++ b/deployment/common/changeset/state/solana_test.go @@ -14,6 +14,7 @@ import ( "go.uber.org/zap/zapcore" "github.com/smartcontractkit/chainlink/deployment" + "github.com/smartcontractkit/chainlink/deployment/common/changeset" solanainternal "github.com/smartcontractkit/chainlink/deployment/common/changeset/internal/solana" "github.com/smartcontractkit/chainlink/deployment/common/changeset/state" commontypes "github.com/smartcontractkit/chainlink/deployment/common/types" @@ -50,7 +51,7 @@ func TestMCMSWithTimelockState_GenerateMCMSWithTimelockViewSolana(t *testing.T) return chainState } - setPreloadedSolanaAddresses(t, env, chainSelector) + changeset.SetPreloadedSolanaAddresses(t, env, chainSelector) tests := []struct { name string @@ -140,20 +141,6 @@ func toJSON[T any](t *testing.T, value T) string { return string(bytes) } -func setPreloadedSolanaAddresses(t *testing.T, env deployment.Environment, selector uint64) { - typeAndVersion := deployment.NewTypeAndVersion(commontypes.ManyChainMultisigProgram, deployment.Version1_0_0) - err := env.ExistingAddresses.Save(selector, memory.SolanaProgramIDs["mcm"], typeAndVersion) - require.NoError(t, err) - - typeAndVersion = deployment.NewTypeAndVersion(commontypes.AccessControllerProgram, deployment.Version1_0_0) - err = env.ExistingAddresses.Save(selector, memory.SolanaProgramIDs["access_controller"], typeAndVersion) - require.NoError(t, err) - - typeAndVersion = deployment.NewTypeAndVersion(commontypes.RBACTimelockProgram, deployment.Version1_0_0) - err = env.ExistingAddresses.Save(selector, memory.SolanaProgramIDs["timelock"], typeAndVersion) - require.NoError(t, err) -} - func signerPDA(programID solana.PublicKey, seed state.PDASeed) string { return state.GetMCMSignerPDA(programID, seed).String() } diff --git a/deployment/common/changeset/test_helpers.go b/deployment/common/changeset/test_helpers.go index 4b21803b069..45b85a3fd45 100644 --- a/deployment/common/changeset/test_helpers.go +++ b/deployment/common/changeset/test_helpers.go @@ -13,6 +13,7 @@ import ( "github.com/smartcontractkit/chainlink/deployment" commonState "github.com/smartcontractkit/chainlink/deployment/common/changeset/state" "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" + commontypes "github.com/smartcontractkit/chainlink/deployment/common/types" "github.com/smartcontractkit/chainlink/deployment/environment/memory" ) @@ -236,3 +237,17 @@ func DeployLinkTokenTest(t *testing.T, solChains int) { require.NotEmpty(t, addrs) } } + +func SetPreloadedSolanaAddresses(t *testing.T, env deployment.Environment, selector uint64) { + typeAndVersion := deployment.NewTypeAndVersion(commontypes.ManyChainMultisigProgram, deployment.Version1_0_0) + err := env.ExistingAddresses.Save(selector, memory.SolanaProgramIDs["mcm"], typeAndVersion) + require.NoError(t, err) + + typeAndVersion = deployment.NewTypeAndVersion(commontypes.AccessControllerProgram, deployment.Version1_0_0) + err = env.ExistingAddresses.Save(selector, memory.SolanaProgramIDs["access_controller"], typeAndVersion) + require.NoError(t, err) + + typeAndVersion = deployment.NewTypeAndVersion(commontypes.RBACTimelockProgram, deployment.Version1_0_0) + err = env.ExistingAddresses.Save(selector, memory.SolanaProgramIDs["timelock"], typeAndVersion) + require.NoError(t, err) +} diff --git a/deployment/common/changeset/transfer_to_mcms_with_timelock.go b/deployment/common/changeset/transfer_to_mcms_with_timelock.go index 2387a67e5b4..7b5b43f99d0 100644 --- a/deployment/common/changeset/transfer_to_mcms_with_timelock.go +++ b/deployment/common/changeset/transfer_to_mcms_with_timelock.go @@ -203,7 +203,7 @@ func TransferToMCMSWithTimelockV2( }) } proposal, err := proposalutils.BuildProposalFromBatchesV2( - e.GetContext(), + e, timelockAddressByChain, proposerAddressByChain, inspectorPerChain, batches, "Transfer ownership to timelock", cfg.MinDelay) if err != nil { diff --git a/deployment/common/proposalutils/mcms_helpers.go b/deployment/common/proposalutils/mcms_helpers.go index 2d9f28d7ef9..7fdb40e6f2f 100644 --- a/deployment/common/proposalutils/mcms_helpers.go +++ b/deployment/common/proposalutils/mcms_helpers.go @@ -281,7 +281,7 @@ func MaybeLoadMCMSWithTimelockContracts(chain deployment.Chain, addresses map[st return &state, nil } -func McmsTimelockConverterForChain(env deployment.Environment, chain uint64) (mcmssdk.TimelockConverter, error) { +func McmsTimelockConverterForChain(chain uint64) (mcmssdk.TimelockConverter, error) { chainFamily, err := mcmstypes.GetChainSelectorFamily(mcmstypes.ChainSelector(chain)) if err != nil { return nil, fmt.Errorf("failed to get chain family for chain %d: %w", chain, err) @@ -291,7 +291,7 @@ func McmsTimelockConverterForChain(env deployment.Environment, chain uint64) (mc case chain_selectors.FamilyEVM: return &mcmsevmsdk.TimelockConverter{}, nil case chain_selectors.FamilySolana: - return mcmssolanasdk.NewTimelockConverter(env.SolChains[chain].Client), nil + return mcmssolanasdk.TimelockConverter{}, nil default: return nil, fmt.Errorf("unsupported chain family %s", chainFamily) } @@ -302,7 +302,7 @@ func McmsTimelockConverters(env deployment.Environment) (map[uint64]mcmssdk.Time for _, chain := range env.Chains { var err error - converters[chain.Selector], err = McmsTimelockConverterForChain(env, chain.Selector) + converters[chain.Selector], err = McmsTimelockConverterForChain(chain.Selector) if err != nil { return nil, fmt.Errorf("failed to get mcms inspector for chain %s: %w", chain.String(), err) } @@ -310,7 +310,7 @@ func McmsTimelockConverters(env deployment.Environment) (map[uint64]mcmssdk.Time for _, chain := range env.SolChains { var err error - converters[chain.Selector], err = McmsTimelockConverterForChain(env, chain.Selector) + converters[chain.Selector], err = McmsTimelockConverterForChain(chain.Selector) if err != nil { return nil, fmt.Errorf("failed to get mcms inspector for chain %s: %w", chain.String(), err) } diff --git a/deployment/common/proposalutils/mcms_test_helpers.go b/deployment/common/proposalutils/mcms_test_helpers.go index c5a62193872..4e31011a1d9 100644 --- a/deployment/common/proposalutils/mcms_test_helpers.go +++ b/deployment/common/proposalutils/mcms_test_helpers.go @@ -118,7 +118,7 @@ func SignMCMSTimelockProposal(t *testing.T, env deployment.Environment, proposal _, err := chainsel.SolanaChainIdFromSelector(chainSelector) require.NoError(t, err) chainSel := mcmstypes.ChainSelector(chainSelector) - converters[chainSel] = mcmssolanasdk.NewTimelockConverter(chain.Client) + converters[chainSel] = mcmssolanasdk.TimelockConverter{} inspectorsMap[chainSel] = mcmssolanasdk.NewInspector(chain.Client) } @@ -238,7 +238,7 @@ func ExecuteMCMSProposalV2(t *testing.T, env deployment.Environment, proposal *m // no need to confirm transaction on solana as the MCMS sdk confirms it internally if family == chainsel.FamilyEVM { chain := env.Chains[uint64(chainSelector)] - evmTransaction := root.RawTransaction.(*gethtypes.Transaction) + evmTransaction := root.RawData.(*gethtypes.Transaction) t.Logf("[ExecuteMCMSProposalV2] SetRoot EVM tx hash: %s", evmTransaction.Hash().String()) _, err = chain.Confirm(evmTransaction) if err != nil { @@ -260,7 +260,7 @@ func ExecuteMCMSProposalV2(t *testing.T, env deployment.Environment, proposal *m if family == chainsel.FamilyEVM { chain := env.Chains[uint64(op.ChainSelector)] - evmTransaction := result.RawTransaction.(*gethtypes.Transaction) + evmTransaction := result.RawData.(*gethtypes.Transaction) t.Logf("[ExecuteMCMSProposalV2] Operation %d EVM tx hash: %s", i, evmTransaction.Hash().String()) _, err = chain.Confirm(evmTransaction) if err != nil { @@ -327,7 +327,7 @@ func ExecuteMCMSTimelockProposalV2(t *testing.T, env deployment.Environment, tim // no need to confirm transaction on solana as the MCMS sdk confirms it internally if family == chainsel.FamilyEVM { chain := env.Chains[uint64(op.ChainSelector)] - evmTransaction := tx.RawTransaction.(*gethtypes.Transaction) + evmTransaction := tx.RawData.(*gethtypes.Transaction) _, err = chain.Confirm(evmTransaction) if err != nil { return fmt.Errorf("[ExecuteMCMSTimelockProposalV2] Confirm failed: %w", err) diff --git a/deployment/common/proposalutils/propose.go b/deployment/common/proposalutils/propose.go index 14c1489da9b..3ee1d2490c8 100644 --- a/deployment/common/proposalutils/propose.go +++ b/deployment/common/proposalutils/propose.go @@ -1,7 +1,6 @@ package proposalutils import ( - "context" "errors" "fmt" "time" @@ -11,9 +10,14 @@ import ( "github.com/smartcontractkit/ccip-owner-contracts/pkg/gethwrappers" "github.com/smartcontractkit/ccip-owner-contracts/pkg/proposal/mcms" "github.com/smartcontractkit/ccip-owner-contracts/pkg/proposal/timelock" + chain_selectors "github.com/smartcontractkit/chain-selectors" mcmslib "github.com/smartcontractkit/mcms" - "github.com/smartcontractkit/mcms/sdk" + mcmssdk "github.com/smartcontractkit/mcms/sdk" + mcmssolanasdk "github.com/smartcontractkit/mcms/sdk/solana" "github.com/smartcontractkit/mcms/types" + + "github.com/smartcontractkit/chainlink/deployment" + "github.com/smartcontractkit/chainlink/deployment/common/changeset/state" ) const ( @@ -94,10 +98,11 @@ func BuildProposalFromBatches( // BuildProposalFromBatchesV2 uses the new MCMS library which replaces the implementation in BuildProposalFromBatches. func BuildProposalFromBatchesV2( - ctx context.Context, + e deployment.Environment, timelockAddressPerChain map[uint64]string, proposerAddressPerChain map[uint64]string, - inspectorPerChain map[uint64]sdk.Inspector, + inspectorPerChain map[uint64]mcmssdk.Inspector, + batches []types.BatchOperation, description string, minDelay time.Duration, @@ -110,17 +115,15 @@ func BuildProposalFromBatchesV2( for _, op := range batches { chains.Add(uint64(op.ChainSelector)) } - - mcmsMd, err := buildProposalMetadataV2(ctx, chains.ToSlice(), - inspectorPerChain, proposerAddressPerChain) - if err != nil { - return nil, err - } - tlsPerChainID := make(map[types.ChainSelector]string) for chainID, tl := range timelockAddressPerChain { tlsPerChainID[types.ChainSelector(chainID)] = tl } + mcmsMd, err := buildProposalMetadataV2(e, chains.ToSlice(), inspectorPerChain, proposerAddressPerChain) + if err != nil { + return nil, err + } + validUntil := time.Now().Unix() + int64(DefaultValidUntil.Seconds()) builder := mcmslib.NewTimelockProposalBuilder() @@ -144,9 +147,9 @@ func BuildProposalFromBatchesV2( } func buildProposalMetadataV2( - ctx context.Context, + env deployment.Environment, chainSelectors []uint64, - inspectorPerChain map[uint64]sdk.Inspector, + inspectorPerChain map[uint64]mcmssdk.Inspector, proposerMcmsesPerChain map[uint64]string, ) (map[types.ChainSelector]types.ChainMetadata, error) { metaDataPerChain := make(map[types.ChainSelector]types.ChainMetadata) @@ -156,14 +159,41 @@ func buildProposalMetadataV2( return nil, fmt.Errorf("missing proposer mcm for chain %d", selector) } chainID := types.ChainSelector(selector) - opCount, err := inspectorPerChain[selector].GetOpCount(ctx, proposerMcms) + opCount, err := inspectorPerChain[selector].GetOpCount(env.GetContext(), proposerMcms) if err != nil { return nil, fmt.Errorf("failed to get op count for chain %d: %w", selector, err) } - metaDataPerChain[chainID] = types.ChainMetadata{ - StartingOpCount: opCount, - MCMAddress: proposerMcms, + family, err := chain_selectors.GetSelectorFamily(selector) + if err != nil { + return nil, fmt.Errorf("failed to get family for chain %d: %w", selector, err) + } + switch family { + case chain_selectors.FamilyEVM: + metaDataPerChain[chainID] = types.ChainMetadata{ + StartingOpCount: opCount, + MCMAddress: proposerMcms, + } + case chain_selectors.FamilySolana: + addresses, err := env.ExistingAddresses.AddressesForChain(selector) + if err != nil { + return nil, fmt.Errorf("failed to load addresses for chain %d: %w", selector, err) + } + solanaState, err := state.MaybeLoadMCMSWithTimelockChainStateSolana(env.SolChains[selector], addresses) + if err != nil { + return nil, fmt.Errorf("failed to load solana state: %w", err) + } + metaDataPerChain[chainID], err = mcmssolanasdk.NewChainMetadata( + opCount, + solanaState.McmProgram, + mcmssolanasdk.PDASeed(solanaState.ProposerMcmSeed), + solanaState.ProposerAccessControllerAccount, + solanaState.CancellerAccessControllerAccount, + solanaState.BypasserAccessControllerAccount) + if err != nil { + return nil, fmt.Errorf("failed to create chain metadata: %w", err) + } } } + return metaDataPerChain, nil } diff --git a/deployment/common/proposalutils/propose_test.go b/deployment/common/proposalutils/propose_test.go index 352428ae0ed..a5816fa5f8d 100644 --- a/deployment/common/proposalutils/propose_test.go +++ b/deployment/common/proposalutils/propose_test.go @@ -1,14 +1,13 @@ package proposalutils_test import ( - "context" "encoding/json" "math/big" "testing" "time" - "github.com/smartcontractkit/mcms/sdk" - "github.com/smartcontractkit/mcms/sdk/evm" + solanasdk "github.com/gagliardetto/solana-go" + "github.com/smartcontractkit/mcms/sdk/solana" "github.com/smartcontractkit/mcms/types" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" @@ -16,8 +15,9 @@ import ( "github.com/smartcontractkit/chainlink/deployment" "github.com/smartcontractkit/chainlink/deployment/common/changeset" + "github.com/smartcontractkit/chainlink/deployment/common/changeset/state" "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" - types2 "github.com/smartcontractkit/chainlink/deployment/common/types" + commontypes "github.com/smartcontractkit/chainlink/deployment/common/types" "github.com/smartcontractkit/chainlink/deployment/environment/memory" "github.com/smartcontractkit/chainlink/v2/core/logger" ) @@ -25,23 +25,32 @@ import ( func TestBuildProposalFromBatchesV2(t *testing.T) { lggr := logger.TestLogger(t) cfg := memory.MemoryEnvironmentConfig{ - Nodes: 1, - Chains: 2, + Nodes: 1, + SolChains: 1, + Chains: 2, } env := memory.NewMemoryEnvironment(t, lggr, zapcore.DebugLevel, cfg) chainSelector := env.AllChainSelectors()[0] + chainSelectorSolana := env.AllChainSelectorsSolana()[0] config := proposalutils.SingleGroupMCMSV2(t) + changeset.SetPreloadedSolanaAddresses(t, env, chainSelectorSolana) env, err := changeset.Apply(t, env, nil, changeset.Configure( deployment.CreateLegacyChangeSet(changeset.DeployMCMSWithTimelockV2), - map[uint64]types2.MCMSWithTimelockConfigV2{ + map[uint64]commontypes.MCMSWithTimelockConfigV2{ chainSelector: { Canceller: config, Bypasser: config, Proposer: config, TimelockMinDelay: big.NewInt(0), }, + chainSelectorSolana: { + Canceller: config, + Bypasser: config, + Proposer: config, + TimelockMinDelay: big.NewInt(0), + }, }, ), ) @@ -55,19 +64,40 @@ func TestBuildProposalFromBatchesV2(t *testing.T) { timelockAddress := mcmsState.Timelock.Address() require.NoError(t, err) + solChain := env.SolChains[chainSelectorSolana] + addrs, err = env.ExistingAddresses.AddressesForChain(chainSelectorSolana) + require.NoError(t, err) + solState, err := state.MaybeLoadMCMSWithTimelockChainStateSolana(solChain, addrs) + require.NoError(t, err) + + solpk := solanasdk.NewWallet().PublicKey() + timelockAddressPerChain := map[uint64]string{ - chainSelector: timelockAddress.Hex(), + chainSelector: timelockAddress.Hex(), + chainSelectorSolana: solana.ContractAddress(solState.TimelockProgram, solana.PDASeed(solState.TimelockSeed)), } proposerAddressPerChain := map[uint64]string{ - chainSelector: mcmsState.ProposerMcm.Address().Hex(), - } - inspectorPerChain := map[uint64]sdk.Inspector{ - chainSelector: evm.NewInspector(chain.Client), + chainSelector: mcmsState.ProposerMcm.Address().Hex(), + chainSelectorSolana: solana.ContractAddress(solState.McmProgram, solana.PDASeed(solState.ProposerMcmSeed)), } + inspectorPerChain, err := proposalutils.McmsInspectors(env) + require.NoError(t, err) description := "Test Proposal" minDelay := 24 * time.Hour + solTx, err := solana.NewTransaction(solpk.String(), []byte("data1"), big.NewInt(0), []*solanasdk.AccountMeta{}, "", []string{}) + require.NoError(t, err) + + solMetadata, err := solana.NewChainMetadata( + 0, + solState.McmProgram, + solana.PDASeed(solState.ProposerMcmSeed), + solState.ProposerAccessControllerAccount, + solState.CancellerAccessControllerAccount, + solState.BypasserAccessControllerAccount) + require.NoError(t, err) + tests := []struct { name string batches []types.BatchOperation @@ -79,7 +109,17 @@ func TestBuildProposalFromBatchesV2(t *testing.T) { batches: []types.BatchOperation{ { ChainSelector: types.ChainSelector(chainSelector), - Transactions: []types.Transaction{{To: "0xRecipient1", Data: []byte("data1"), AdditionalFields: json.RawMessage(`{"value": 0}`)}}, + Transactions: []types.Transaction{ + { + To: "0xRecipient1", + Data: []byte("data1"), + AdditionalFields: json.RawMessage(`{"value": 0}`), + }, + }, + }, + { + ChainSelector: types.ChainSelector(chainSelectorSolana), + Transactions: []types.Transaction{solTx}, }, }, wantErr: false, @@ -105,7 +145,7 @@ func TestBuildProposalFromBatchesV2(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - proposal, err := proposalutils.BuildProposalFromBatchesV2(context.Background(), timelockAddressPerChain, + proposal, err := proposalutils.BuildProposalFromBatchesV2(env, timelockAddressPerChain, proposerAddressPerChain, inspectorPerChain, tt.batches, description, minDelay) if tt.wantErr { require.Error(t, err) @@ -120,8 +160,21 @@ func TestBuildProposalFromBatchesV2(t *testing.T) { assert.InEpsilon(t, uint32(time.Now().Unix()+int64(proposalutils.DefaultValidUntil.Seconds())), proposal.ValidUntil, 1) assert.Equal(t, description, proposal.Description) assert.InEpsilon(t, minDelay.Seconds(), proposal.Delay.Seconds(), 0) - assert.Equal(t, map[types.ChainSelector]types.ChainMetadata{0xc9f9284461c852b: {StartingOpCount: 0x0, MCMAddress: mcmsState.ProposerMcm.Address().String()}}, proposal.ChainMetadata) - assert.Equal(t, timelockAddress.String(), proposal.TimelockAddresses[types.ChainSelector(chainSelector)]) + assert.Equal(t, map[types.ChainSelector]types.ChainMetadata{ + types.ChainSelector(chainSelector): { + StartingOpCount: 0x0, + MCMAddress: proposerAddressPerChain[chainSelector], + }, + types.ChainSelector(chainSelectorSolana): { + StartingOpCount: 0x0, + MCMAddress: proposerAddressPerChain[chainSelectorSolana], + AdditionalFields: solMetadata.AdditionalFields, + }, + }, proposal.ChainMetadata) + assert.Equal(t, map[types.ChainSelector]string{ + types.ChainSelector(chainSelector): timelockAddressPerChain[chainSelector], + types.ChainSelector(chainSelectorSolana): timelockAddressPerChain[chainSelectorSolana], + }, proposal.TimelockAddresses) assert.Equal(t, tt.batches, proposal.Operations) } }) diff --git a/deployment/go.mod b/deployment/go.mod index 2bd18e5ac37..3bfb5c278c4 100644 --- a/deployment/go.mod +++ b/deployment/go.mod @@ -42,7 +42,7 @@ require ( github.com/smartcontractkit/chainlink-testing-framework/framework v0.5.3 github.com/smartcontractkit/chainlink-testing-framework/lib v1.50.22 github.com/smartcontractkit/libocr v0.0.0-20250220133800-f3b940c4f298 - github.com/smartcontractkit/mcms v0.10.0 + github.com/smartcontractkit/mcms v0.12.2 github.com/stretchr/testify v1.10.0 github.com/testcontainers/testcontainers-go v0.35.0 go.uber.org/multierr v1.11.0 diff --git a/deployment/go.sum b/deployment/go.sum index 9953c5ba608..a967856cf84 100644 --- a/deployment/go.sum +++ b/deployment/go.sum @@ -1172,8 +1172,8 @@ github.com/smartcontractkit/grpc-proxy v0.0.0-20240830132753-a7e17fec5ab7 h1:12i github.com/smartcontractkit/grpc-proxy v0.0.0-20240830132753-a7e17fec5ab7/go.mod h1:FX7/bVdoep147QQhsOPkYsPEXhGZjeYx6lBSaSXtZOA= github.com/smartcontractkit/libocr v0.0.0-20250220133800-f3b940c4f298 h1:PKiqnVOTChlH4a4ljJKL3OKGRgYfIpJS4YD1daAIKks= github.com/smartcontractkit/libocr v0.0.0-20250220133800-f3b940c4f298/go.mod h1:Mb7+/LC4edz7HyHxX4QkE42pSuov4AV68+AxBXAap0o= -github.com/smartcontractkit/mcms v0.10.0 h1:wkBAr8HLyHKwejdwsDOMvIwmzT83tKr3jjB9senLahM= -github.com/smartcontractkit/mcms v0.10.0/go.mod h1:3N7+yvkO3hIFXYRYm3hxKCE6qDWdOC/rZdvIrwzlLKk= +github.com/smartcontractkit/mcms v0.12.2 h1:CTeQmtdYOdqWLuiGHNS67qqEdtJO8r8AygOYN/VpaZM= +github.com/smartcontractkit/mcms v0.12.2/go.mod h1:RKo4v2ClzKPHyllstwVeqdPP7Bb5v+qMMPgO8iMq0Qc= github.com/smartcontractkit/tdh2/go/ocr2/decryptionplugin v0.0.0-20241009055228-33d0c0bf38de h1:n0w0rKF+SVM+S3WNlup6uabXj2zFlFNfrlsKCMMb/co= github.com/smartcontractkit/tdh2/go/ocr2/decryptionplugin v0.0.0-20241009055228-33d0c0bf38de/go.mod h1:Sl2MF/Fp3fgJIVzhdGhmZZX2BlnM0oUUyBP4s4xYb6o= github.com/smartcontractkit/tdh2/go/tdh2 v0.0.0-20241009055228-33d0c0bf38de h1:66VQxXx3lvTaAZrMBkIcdH9VEjujUEvmBQdnyOJnkOc= diff --git a/deployment/keystone/changeset/add_capabilities.go b/deployment/keystone/changeset/add_capabilities.go index cb792939858..59143b238a0 100644 --- a/deployment/keystone/changeset/add_capabilities.go +++ b/deployment/keystone/changeset/add_capabilities.go @@ -73,7 +73,7 @@ func AddCapabilities(env deployment.Environment, req *AddCapabilitiesRequest) (d } proposal, err := proposalutils.BuildProposalFromBatchesV2( - env.GetContext(), + env, timelocksPerChain, proposerMCMSes, inspectorPerChain, diff --git a/deployment/keystone/changeset/add_nodes.go b/deployment/keystone/changeset/add_nodes.go index b5bd7448026..1291181207d 100644 --- a/deployment/keystone/changeset/add_nodes.go +++ b/deployment/keystone/changeset/add_nodes.go @@ -254,7 +254,7 @@ func AddNodes(env deployment.Environment, req *AddNodesRequest) (deployment.Chan } proposal, err := proposalutils.BuildProposalFromBatchesV2( - env.GetContext(), + env, timelocksPerChain, proposerMCMSes, inspectorPerChain, diff --git a/deployment/keystone/changeset/append_node_capabilities.go b/deployment/keystone/changeset/append_node_capabilities.go index c2c3739a566..a5ebada230e 100644 --- a/deployment/keystone/changeset/append_node_capabilities.go +++ b/deployment/keystone/changeset/append_node_capabilities.go @@ -49,7 +49,7 @@ func AppendNodeCapabilities(env deployment.Environment, req *AppendNodeCapabilit } proposal, err := proposalutils.BuildProposalFromBatchesV2( - env.GetContext(), + env, timelocksPerChain, proposerMCMSes, inspectorPerChain, diff --git a/deployment/keystone/changeset/deploy_ocr3.go b/deployment/keystone/changeset/deploy_ocr3.go index 070c7ef59ce..07d9345030d 100644 --- a/deployment/keystone/changeset/deploy_ocr3.go +++ b/deployment/keystone/changeset/deploy_ocr3.go @@ -107,7 +107,7 @@ func ConfigureOCR3Contract(env deployment.Environment, cfg ConfigureOCR3Config) cfg.ChainSel: inspector, } proposal, err := proposalutils.BuildProposalFromBatchesV2( - env.GetContext(), + env, timelocksPerChain, proposerMCMSes, inspectorPerChain, diff --git a/deployment/keystone/changeset/update_node_capabilities.go b/deployment/keystone/changeset/update_node_capabilities.go index 6a9a22a78a9..97816d272ae 100644 --- a/deployment/keystone/changeset/update_node_capabilities.go +++ b/deployment/keystone/changeset/update_node_capabilities.go @@ -136,7 +136,7 @@ func UpdateNodeCapabilities(env deployment.Environment, req *UpdateNodeCapabilit req.RegistryChainSel: inspector, } proposal, err := proposalutils.BuildProposalFromBatchesV2( - env.GetContext(), + env, timelocksPerChain, proposerMCMSes, inspectorPerChain, diff --git a/deployment/keystone/changeset/update_nodes.go b/deployment/keystone/changeset/update_nodes.go index 70857ef41c7..fc6b1cef310 100644 --- a/deployment/keystone/changeset/update_nodes.go +++ b/deployment/keystone/changeset/update_nodes.go @@ -105,7 +105,7 @@ func UpdateNodes(env deployment.Environment, req *UpdateNodesRequest) (deploymen } proposal, err := proposalutils.BuildProposalFromBatchesV2( - env.GetContext(), + env, timelocksPerChain, proposerMCMSes, inspectorPerChain, diff --git a/deployment/keystone/changeset/workflowregistry/strategies.go b/deployment/keystone/changeset/workflowregistry/strategies.go index 12ef748c4ec..91be8d64af1 100644 --- a/deployment/keystone/changeset/workflowregistry/strategies.go +++ b/deployment/keystone/changeset/workflowregistry/strategies.go @@ -70,7 +70,7 @@ func (m *mcmsTransaction) Apply(callFn func(opts *bind.TransactOpts) (*types.Tra } proposal, err := proposalutils.BuildProposalFromBatchesV2( - m.Env.GetContext(), + m.Env, timelocksPerChain, proposerMCMSes, inspectorPerChain, diff --git a/integration-tests/go.mod b/integration-tests/go.mod index 205575d9793..114b9fa54e6 100644 --- a/integration-tests/go.mod +++ b/integration-tests/go.mod @@ -450,7 +450,7 @@ require ( github.com/smartcontractkit/chainlink-solana v1.1.2-0.20250213203720-e15b1333a14a // indirect github.com/smartcontractkit/chainlink-testing-framework/framework v0.5.8-0.20250225210020-fc215b29321e // indirect github.com/smartcontractkit/grpc-proxy v0.0.0-20240830132753-a7e17fec5ab7 // indirect - github.com/smartcontractkit/mcms v0.10.0 // indirect + github.com/smartcontractkit/mcms v0.12.2 // indirect github.com/smartcontractkit/tdh2/go/ocr2/decryptionplugin v0.0.0-20241009055228-33d0c0bf38de // indirect github.com/smartcontractkit/tdh2/go/tdh2 v0.0.0-20241009055228-33d0c0bf38de // indirect github.com/smartcontractkit/wsrpc v0.8.3 // indirect diff --git a/integration-tests/go.sum b/integration-tests/go.sum index 5246e7d1a22..5c335396988 100644 --- a/integration-tests/go.sum +++ b/integration-tests/go.sum @@ -1474,8 +1474,8 @@ github.com/smartcontractkit/grpc-proxy v0.0.0-20240830132753-a7e17fec5ab7 h1:12i github.com/smartcontractkit/grpc-proxy v0.0.0-20240830132753-a7e17fec5ab7/go.mod h1:FX7/bVdoep147QQhsOPkYsPEXhGZjeYx6lBSaSXtZOA= github.com/smartcontractkit/libocr v0.0.0-20250220133800-f3b940c4f298 h1:PKiqnVOTChlH4a4ljJKL3OKGRgYfIpJS4YD1daAIKks= github.com/smartcontractkit/libocr v0.0.0-20250220133800-f3b940c4f298/go.mod h1:Mb7+/LC4edz7HyHxX4QkE42pSuov4AV68+AxBXAap0o= -github.com/smartcontractkit/mcms v0.10.0 h1:wkBAr8HLyHKwejdwsDOMvIwmzT83tKr3jjB9senLahM= -github.com/smartcontractkit/mcms v0.10.0/go.mod h1:3N7+yvkO3hIFXYRYm3hxKCE6qDWdOC/rZdvIrwzlLKk= +github.com/smartcontractkit/mcms v0.12.2 h1:CTeQmtdYOdqWLuiGHNS67qqEdtJO8r8AygOYN/VpaZM= +github.com/smartcontractkit/mcms v0.12.2/go.mod h1:RKo4v2ClzKPHyllstwVeqdPP7Bb5v+qMMPgO8iMq0Qc= github.com/smartcontractkit/tdh2/go/ocr2/decryptionplugin v0.0.0-20241009055228-33d0c0bf38de h1:n0w0rKF+SVM+S3WNlup6uabXj2zFlFNfrlsKCMMb/co= github.com/smartcontractkit/tdh2/go/ocr2/decryptionplugin v0.0.0-20241009055228-33d0c0bf38de/go.mod h1:Sl2MF/Fp3fgJIVzhdGhmZZX2BlnM0oUUyBP4s4xYb6o= github.com/smartcontractkit/tdh2/go/tdh2 v0.0.0-20241009055228-33d0c0bf38de h1:66VQxXx3lvTaAZrMBkIcdH9VEjujUEvmBQdnyOJnkOc= diff --git a/integration-tests/load/go.mod b/integration-tests/load/go.mod index 3606271b8a6..b52c7d71b36 100644 --- a/integration-tests/load/go.mod +++ b/integration-tests/load/go.mod @@ -444,7 +444,7 @@ require ( github.com/smartcontractkit/chainlink-testing-framework/lib/grafana v1.50.1-0.20250225210020-fc215b29321e // indirect github.com/smartcontractkit/grpc-proxy v0.0.0-20240830132753-a7e17fec5ab7 // indirect github.com/smartcontractkit/libocr v0.0.0-20250220133800-f3b940c4f298 // indirect - github.com/smartcontractkit/mcms v0.10.0 // indirect + github.com/smartcontractkit/mcms v0.12.2 // indirect github.com/smartcontractkit/tdh2/go/ocr2/decryptionplugin v0.0.0-20241009055228-33d0c0bf38de // indirect github.com/smartcontractkit/wsrpc v0.8.3 // indirect github.com/sony/gobreaker/v2 v2.1.0 // indirect diff --git a/integration-tests/load/go.sum b/integration-tests/load/go.sum index 568609184bb..d3140dcdecb 100644 --- a/integration-tests/load/go.sum +++ b/integration-tests/load/go.sum @@ -1457,8 +1457,8 @@ github.com/smartcontractkit/grpc-proxy v0.0.0-20240830132753-a7e17fec5ab7 h1:12i github.com/smartcontractkit/grpc-proxy v0.0.0-20240830132753-a7e17fec5ab7/go.mod h1:FX7/bVdoep147QQhsOPkYsPEXhGZjeYx6lBSaSXtZOA= github.com/smartcontractkit/libocr v0.0.0-20250220133800-f3b940c4f298 h1:PKiqnVOTChlH4a4ljJKL3OKGRgYfIpJS4YD1daAIKks= github.com/smartcontractkit/libocr v0.0.0-20250220133800-f3b940c4f298/go.mod h1:Mb7+/LC4edz7HyHxX4QkE42pSuov4AV68+AxBXAap0o= -github.com/smartcontractkit/mcms v0.10.0 h1:wkBAr8HLyHKwejdwsDOMvIwmzT83tKr3jjB9senLahM= -github.com/smartcontractkit/mcms v0.10.0/go.mod h1:3N7+yvkO3hIFXYRYm3hxKCE6qDWdOC/rZdvIrwzlLKk= +github.com/smartcontractkit/mcms v0.12.2 h1:CTeQmtdYOdqWLuiGHNS67qqEdtJO8r8AygOYN/VpaZM= +github.com/smartcontractkit/mcms v0.12.2/go.mod h1:RKo4v2ClzKPHyllstwVeqdPP7Bb5v+qMMPgO8iMq0Qc= github.com/smartcontractkit/tdh2/go/ocr2/decryptionplugin v0.0.0-20241009055228-33d0c0bf38de h1:n0w0rKF+SVM+S3WNlup6uabXj2zFlFNfrlsKCMMb/co= github.com/smartcontractkit/tdh2/go/ocr2/decryptionplugin v0.0.0-20241009055228-33d0c0bf38de/go.mod h1:Sl2MF/Fp3fgJIVzhdGhmZZX2BlnM0oUUyBP4s4xYb6o= github.com/smartcontractkit/tdh2/go/tdh2 v0.0.0-20241009055228-33d0c0bf38de h1:66VQxXx3lvTaAZrMBkIcdH9VEjujUEvmBQdnyOJnkOc= diff --git a/system-tests/lib/go.mod b/system-tests/lib/go.mod index ab95c146d37..35227b34da1 100644 --- a/system-tests/lib/go.mod +++ b/system-tests/lib/go.mod @@ -353,7 +353,7 @@ require ( github.com/smartcontractkit/chainlink-solana v1.1.2-0.20250213203720-e15b1333a14a // indirect github.com/smartcontractkit/grpc-proxy v0.0.0-20240830132753-a7e17fec5ab7 // indirect github.com/smartcontractkit/libocr v0.0.0-20250220133800-f3b940c4f298 // indirect - github.com/smartcontractkit/mcms v0.10.0 // indirect + github.com/smartcontractkit/mcms v0.12.2 // indirect github.com/smartcontractkit/tdh2/go/ocr2/decryptionplugin v0.0.0-20241009055228-33d0c0bf38de // indirect github.com/smartcontractkit/tdh2/go/tdh2 v0.0.0-20241009055228-33d0c0bf38de // indirect github.com/smartcontractkit/wsrpc v0.8.3 // indirect diff --git a/system-tests/lib/go.sum b/system-tests/lib/go.sum index ee9533a8fdb..7c26e1f4bdd 100644 --- a/system-tests/lib/go.sum +++ b/system-tests/lib/go.sum @@ -1160,8 +1160,8 @@ github.com/smartcontractkit/grpc-proxy v0.0.0-20240830132753-a7e17fec5ab7 h1:12i github.com/smartcontractkit/grpc-proxy v0.0.0-20240830132753-a7e17fec5ab7/go.mod h1:FX7/bVdoep147QQhsOPkYsPEXhGZjeYx6lBSaSXtZOA= github.com/smartcontractkit/libocr v0.0.0-20250220133800-f3b940c4f298 h1:PKiqnVOTChlH4a4ljJKL3OKGRgYfIpJS4YD1daAIKks= github.com/smartcontractkit/libocr v0.0.0-20250220133800-f3b940c4f298/go.mod h1:Mb7+/LC4edz7HyHxX4QkE42pSuov4AV68+AxBXAap0o= -github.com/smartcontractkit/mcms v0.10.0 h1:wkBAr8HLyHKwejdwsDOMvIwmzT83tKr3jjB9senLahM= -github.com/smartcontractkit/mcms v0.10.0/go.mod h1:3N7+yvkO3hIFXYRYm3hxKCE6qDWdOC/rZdvIrwzlLKk= +github.com/smartcontractkit/mcms v0.12.2 h1:CTeQmtdYOdqWLuiGHNS67qqEdtJO8r8AygOYN/VpaZM= +github.com/smartcontractkit/mcms v0.12.2/go.mod h1:RKo4v2ClzKPHyllstwVeqdPP7Bb5v+qMMPgO8iMq0Qc= github.com/smartcontractkit/tdh2/go/ocr2/decryptionplugin v0.0.0-20241009055228-33d0c0bf38de h1:n0w0rKF+SVM+S3WNlup6uabXj2zFlFNfrlsKCMMb/co= github.com/smartcontractkit/tdh2/go/ocr2/decryptionplugin v0.0.0-20241009055228-33d0c0bf38de/go.mod h1:Sl2MF/Fp3fgJIVzhdGhmZZX2BlnM0oUUyBP4s4xYb6o= github.com/smartcontractkit/tdh2/go/tdh2 v0.0.0-20241009055228-33d0c0bf38de h1:66VQxXx3lvTaAZrMBkIcdH9VEjujUEvmBQdnyOJnkOc= diff --git a/system-tests/tests/go.mod b/system-tests/tests/go.mod index 41cd23bb6bd..cab810d1f99 100644 --- a/system-tests/tests/go.mod +++ b/system-tests/tests/go.mod @@ -358,7 +358,7 @@ require ( github.com/smartcontractkit/chainlink-solana v1.1.2-0.20250213203720-e15b1333a14a // indirect github.com/smartcontractkit/grpc-proxy v0.0.0-20240830132753-a7e17fec5ab7 // indirect github.com/smartcontractkit/libocr v0.0.0-20250220133800-f3b940c4f298 // indirect - github.com/smartcontractkit/mcms v0.10.0 // indirect + github.com/smartcontractkit/mcms v0.12.2 // indirect github.com/smartcontractkit/tdh2/go/ocr2/decryptionplugin v0.0.0-20241009055228-33d0c0bf38de // indirect github.com/smartcontractkit/tdh2/go/tdh2 v0.0.0-20241009055228-33d0c0bf38de // indirect github.com/smartcontractkit/wsrpc v0.8.3 // indirect diff --git a/system-tests/tests/go.sum b/system-tests/tests/go.sum index 79d3ba1ad86..a139a30ed1f 100644 --- a/system-tests/tests/go.sum +++ b/system-tests/tests/go.sum @@ -1160,8 +1160,8 @@ github.com/smartcontractkit/grpc-proxy v0.0.0-20240830132753-a7e17fec5ab7 h1:12i github.com/smartcontractkit/grpc-proxy v0.0.0-20240830132753-a7e17fec5ab7/go.mod h1:FX7/bVdoep147QQhsOPkYsPEXhGZjeYx6lBSaSXtZOA= github.com/smartcontractkit/libocr v0.0.0-20250220133800-f3b940c4f298 h1:PKiqnVOTChlH4a4ljJKL3OKGRgYfIpJS4YD1daAIKks= github.com/smartcontractkit/libocr v0.0.0-20250220133800-f3b940c4f298/go.mod h1:Mb7+/LC4edz7HyHxX4QkE42pSuov4AV68+AxBXAap0o= -github.com/smartcontractkit/mcms v0.10.0 h1:wkBAr8HLyHKwejdwsDOMvIwmzT83tKr3jjB9senLahM= -github.com/smartcontractkit/mcms v0.10.0/go.mod h1:3N7+yvkO3hIFXYRYm3hxKCE6qDWdOC/rZdvIrwzlLKk= +github.com/smartcontractkit/mcms v0.12.2 h1:CTeQmtdYOdqWLuiGHNS67qqEdtJO8r8AygOYN/VpaZM= +github.com/smartcontractkit/mcms v0.12.2/go.mod h1:RKo4v2ClzKPHyllstwVeqdPP7Bb5v+qMMPgO8iMq0Qc= github.com/smartcontractkit/tdh2/go/ocr2/decryptionplugin v0.0.0-20241009055228-33d0c0bf38de h1:n0w0rKF+SVM+S3WNlup6uabXj2zFlFNfrlsKCMMb/co= github.com/smartcontractkit/tdh2/go/ocr2/decryptionplugin v0.0.0-20241009055228-33d0c0bf38de/go.mod h1:Sl2MF/Fp3fgJIVzhdGhmZZX2BlnM0oUUyBP4s4xYb6o= github.com/smartcontractkit/tdh2/go/tdh2 v0.0.0-20241009055228-33d0c0bf38de h1:66VQxXx3lvTaAZrMBkIcdH9VEjujUEvmBQdnyOJnkOc= From fab3f9643182eba9621b3ee07b2f902ee787fbbb Mon Sep 17 00:00:00 2001 From: Will Winder Date: Wed, 26 Feb 2025 02:29:05 -0500 Subject: [PATCH 02/12] Add README that tells you how to run a CCIP test. (#16233) --- integration-tests/smoke/ccip/README.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 integration-tests/smoke/ccip/README.md diff --git a/integration-tests/smoke/ccip/README.md b/integration-tests/smoke/ccip/README.md new file mode 100644 index 00000000000..23057e989b1 --- /dev/null +++ b/integration-tests/smoke/ccip/README.md @@ -0,0 +1,17 @@ +# Run a test + +1. Start a postgres container. +``` +docker run -d --rm --name chainlink-postgres -e POSTGRES_PASSWORD=postgres -e POSTGRES_HOST_AUTH_METHOD=trust -v $HOME/chainlink-pg-data/:/var/lib/postgresql/data -p 5432:5432 postgres:14 postgres -N 500 -B 1024MB +``` + +2. From this repo root directory. +``` +export CL_DATABASE_URL="postgresql://postgres:@localhost:5432/chainlink_test?sslmode=disable" +make testdb +``` + +3. From this directory, run a test. +``` +go test -count 1 -v -run "Test_CCIPBatching" . +``` From 521217ea3338dadbddc587f97ddea0167e723c3d Mon Sep 17 00:00:00 2001 From: pavel-raykov <165708424+pavel-raykov@users.noreply.github.com> Date: Wed, 26 Feb 2025 11:41:58 +0100 Subject: [PATCH 03/12] Remove bash wrappers and invoke solidity compilation directly. (#16568) * Minor * Minor --- .changeset/wet-suits-worry.md | 5 +++ .../generation/compile_contracts.sh | 32 ----------------- .../generation/compile_event_mock_contract.sh | 34 ------------------- core/gethwrappers/go_generate.go | 6 ++-- 4 files changed, 8 insertions(+), 69 deletions(-) create mode 100644 .changeset/wet-suits-worry.md delete mode 100755 core/gethwrappers/generation/compile_contracts.sh delete mode 100755 core/gethwrappers/generation/compile_event_mock_contract.sh diff --git a/.changeset/wet-suits-worry.md b/.changeset/wet-suits-worry.md new file mode 100644 index 00000000000..3ce904a90d3 --- /dev/null +++ b/.changeset/wet-suits-worry.md @@ -0,0 +1,5 @@ +--- +"chainlink": minor +--- + +#removed Remove bash wrappers and call solidity compilation directly. diff --git a/core/gethwrappers/generation/compile_contracts.sh b/core/gethwrappers/generation/compile_contracts.sh deleted file mode 100755 index 627e0d52b57..00000000000 --- a/core/gethwrappers/generation/compile_contracts.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/usr/bin/env bash - -echo "compiling contracts" - -CDIR="$(dirname "$0")" -COMPILE_COMMAND="$CDIR/../../../contracts/scripts/native_solc_compile_all" - - -# Only print compilation output on failure. -OUT="$(bash -c "${COMPILE_COMMAND}" 2>&1)" -ERR="$?" - -# shellcheck disable=SC2181 -if [ "$ERR" != "0" ]; then - echo - echo "↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓" - echo "Error while compiling solidity contracts. See below for output." - echo "You can reproduce this error directly by running the command" - echo - echo " " "$COMPILE_COMMAND" - echo - echo "in the directory $SOLIDITY_DIR" - echo - echo "This is probably a problem with a solidity contract, under the" - echo "directory contracts/src/." - echo "↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑" - echo - echo "$OUT" - exit 1 -fi - -echo "finished compilation" diff --git a/core/gethwrappers/generation/compile_event_mock_contract.sh b/core/gethwrappers/generation/compile_event_mock_contract.sh deleted file mode 100755 index a576a16adf6..00000000000 --- a/core/gethwrappers/generation/compile_event_mock_contract.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/usr/bin/env bash - -set -euo pipefail - -echo "compiling contracts" - -CDIR="$(dirname "$0")" -COMPILE_COMMAND="$CDIR/../../../contracts/scripts/native_solc_compile_all_events_mock" - - -# Only print compilation output on failure. -OUT="$(bash -c "${COMPILE_COMMAND}" 2>&1)" -ERR="$?" - -# shellcheck disable=SC2181 -if [ "$ERR" != "0" ]; then - echo - echo "↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓" - echo "Error while compiling solidity contracts. See below for output." - echo "You can reproduce this error directly by running the command" - echo - echo " " "$COMPILE_COMMAND" - echo - echo "in the directory $SOLIDITY_DIR" - echo - echo "This is probably a problem with a solidity contract, under the" - echo "directory contracts/src/." - echo "↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑" - echo - echo "$OUT" - exit 1 -fi - -echo "finished compilation" diff --git a/core/gethwrappers/go_generate.go b/core/gethwrappers/go_generate.go index 339c27d98d5..506a214b5cb 100644 --- a/core/gethwrappers/go_generate.go +++ b/core/gethwrappers/go_generate.go @@ -3,7 +3,7 @@ package gethwrappers // Make sure solidity compiler artifacts are up-to-date. Only output stdout on failure. -//go:generate ./generation/compile_contracts.sh +//go:generate ../../contracts/scripts/native_solc_compile_all //go:generate go run ./generation/generate/wrap.go ../../contracts/solc/v0.8.19/Operator/Operator.abi ../../contracts/solc/v0.8.19/Operator/Operator.bin Operator operator_wrapper //go:generate go run ./generation/generate/wrap.go ../../contracts/solc/v0.8.19/OperatorFactory/OperatorFactory.abi ../../contracts/solc/v0.8.19/OperatorFactory/OperatorFactory.bin OperatorFactory operator_factory @@ -161,6 +161,6 @@ package gethwrappers // The flow is as follows: // 1. Compile all non events mock contracts. // 2. Generate events mock .sol files based on ABI of compiled contracts. -// 3. Compile events mock contracts. ./generation/compile_event_mock_contract.sh calls contracts/scripts/native_solc_compile_all_events_mock to compile events mock contracts. +// 3. Compile mocks by calling contracts/scripts/native_solc_compile_all_events_mock to compile events mock contracts. // 4. Generate wrappers for events mock contracts. -//go:generate ./generation/compile_event_mock_contract.sh +//go:generate ../../contracts/scripts/native_solc_compile_all_events_mock From 565c61ae8a4bc4b5b9b6c4791504fee20a27a078 Mon Sep 17 00:00:00 2001 From: "Abdelrahman Soliman (Boda)" <2677789+asoliman92@users.noreply.github.com> Date: Wed, 26 Feb 2025 16:23:27 +0400 Subject: [PATCH 04/12] debug logs (#16581) --- 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 ++-- system-tests/lib/go.mod | 2 +- system-tests/lib/go.sum | 4 ++-- system-tests/tests/go.mod | 2 +- system-tests/tests/go.sum | 4 ++-- 14 files changed, 21 insertions(+), 21 deletions(-) diff --git a/core/scripts/go.mod b/core/scripts/go.mod index 50eb43c9f9c..6094343ad4b 100644 --- a/core/scripts/go.mod +++ b/core/scripts/go.mod @@ -340,7 +340,7 @@ require ( github.com/sirupsen/logrus v1.9.3 // indirect github.com/smartcontractkit/ccip-owner-contracts v0.1.0 // indirect github.com/smartcontractkit/chain-selectors v1.0.40 // indirect - github.com/smartcontractkit/chainlink-ccip v0.0.0-20250225130625-4a632b0b1e61 // indirect + github.com/smartcontractkit/chainlink-ccip v0.0.0-20250226083129-e596590f48f7 // indirect github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250214202341-4190f2db1c01 // indirect github.com/smartcontractkit/chainlink-feeds v0.1.1 // indirect github.com/smartcontractkit/chainlink-framework/chains v0.0.0-20250207205350-420ccacab78a // indirect diff --git a/core/scripts/go.sum b/core/scripts/go.sum index 56f76930831..a35215ab7bd 100644 --- a/core/scripts/go.sum +++ b/core/scripts/go.sum @@ -1089,8 +1089,8 @@ github.com/smartcontractkit/chain-selectors v1.0.40 h1:iLvvoZeehVq6/7F+zzolQLF0D github.com/smartcontractkit/chain-selectors v1.0.40/go.mod h1:xsKM0aN3YGcQKTPRPDDtPx2l4mlTN1Djmg0VVXV40b8= github.com/smartcontractkit/chainlink-automation v0.8.1 h1:sTc9LKpBvcKPc1JDYAmgBc2xpDKBco/Q4h4ydl6+UUU= github.com/smartcontractkit/chainlink-automation v0.8.1/go.mod h1:Iij36PvWZ6blrdC5A/nrQUBuf3MH3JvsBB9sSyc9W08= -github.com/smartcontractkit/chainlink-ccip v0.0.0-20250225130625-4a632b0b1e61 h1:x8GMgtVnW81t//lDpizA+/t225RThOjw8ydtrORFS7Q= -github.com/smartcontractkit/chainlink-ccip v0.0.0-20250225130625-4a632b0b1e61/go.mod h1:Hht/OJq/PxC+gnBCIPyzHt4Otsw6mYwUVsmtOqIvlxo= +github.com/smartcontractkit/chainlink-ccip v0.0.0-20250226083129-e596590f48f7 h1:179ROx6VXwUApnhf7NzqMiCVUwutdLzRxvA10KsQQhQ= +github.com/smartcontractkit/chainlink-ccip v0.0.0-20250226083129-e596590f48f7/go.mod h1:Hht/OJq/PxC+gnBCIPyzHt4Otsw6mYwUVsmtOqIvlxo= github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250214202341-4190f2db1c01 h1:R3OD6Phi0ULIQ2uvHiKVWYdgpi/O1Mt46CUK1UApcXU= github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250214202341-4190f2db1c01/go.mod h1:Bmwq4lNb5tE47sydN0TKetcLEGbgl+VxHEWp4S0LI60= github.com/smartcontractkit/chainlink-common v0.4.2-0.20250221174903-e1e47fdb11b0 h1:BTN2nQgFKBxgas6oqY3ym82O+wT++WlpP1+a6KzIfY0= diff --git a/deployment/go.mod b/deployment/go.mod index 3bfb5c278c4..861b7e8515e 100644 --- a/deployment/go.mod +++ b/deployment/go.mod @@ -32,7 +32,7 @@ require ( github.com/sethvargo/go-retry v0.2.4 github.com/smartcontractkit/ccip-owner-contracts v0.1.0 github.com/smartcontractkit/chain-selectors v1.0.40 - github.com/smartcontractkit/chainlink-ccip v0.0.0-20250225130625-4a632b0b1e61 + github.com/smartcontractkit/chainlink-ccip v0.0.0-20250226083129-e596590f48f7 github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250214202341-4190f2db1c01 github.com/smartcontractkit/chainlink-common v0.4.2-0.20250221174903-e1e47fdb11b0 github.com/smartcontractkit/chainlink-framework/multinode v0.0.0-20250211162441-3d6cea220efb diff --git a/deployment/go.sum b/deployment/go.sum index a967856cf84..008a81c31c9 100644 --- a/deployment/go.sum +++ b/deployment/go.sum @@ -1136,8 +1136,8 @@ github.com/smartcontractkit/chain-selectors v1.0.40 h1:iLvvoZeehVq6/7F+zzolQLF0D github.com/smartcontractkit/chain-selectors v1.0.40/go.mod h1:xsKM0aN3YGcQKTPRPDDtPx2l4mlTN1Djmg0VVXV40b8= github.com/smartcontractkit/chainlink-automation v0.8.1 h1:sTc9LKpBvcKPc1JDYAmgBc2xpDKBco/Q4h4ydl6+UUU= github.com/smartcontractkit/chainlink-automation v0.8.1/go.mod h1:Iij36PvWZ6blrdC5A/nrQUBuf3MH3JvsBB9sSyc9W08= -github.com/smartcontractkit/chainlink-ccip v0.0.0-20250225130625-4a632b0b1e61 h1:x8GMgtVnW81t//lDpizA+/t225RThOjw8ydtrORFS7Q= -github.com/smartcontractkit/chainlink-ccip v0.0.0-20250225130625-4a632b0b1e61/go.mod h1:Hht/OJq/PxC+gnBCIPyzHt4Otsw6mYwUVsmtOqIvlxo= +github.com/smartcontractkit/chainlink-ccip v0.0.0-20250226083129-e596590f48f7 h1:179ROx6VXwUApnhf7NzqMiCVUwutdLzRxvA10KsQQhQ= +github.com/smartcontractkit/chainlink-ccip v0.0.0-20250226083129-e596590f48f7/go.mod h1:Hht/OJq/PxC+gnBCIPyzHt4Otsw6mYwUVsmtOqIvlxo= github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250214202341-4190f2db1c01 h1:R3OD6Phi0ULIQ2uvHiKVWYdgpi/O1Mt46CUK1UApcXU= github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250214202341-4190f2db1c01/go.mod h1:Bmwq4lNb5tE47sydN0TKetcLEGbgl+VxHEWp4S0LI60= github.com/smartcontractkit/chainlink-common v0.4.2-0.20250221174903-e1e47fdb11b0 h1:BTN2nQgFKBxgas6oqY3ym82O+wT++WlpP1+a6KzIfY0= diff --git a/go.mod b/go.mod index 864c836b8b4..91839a87219 100644 --- a/go.mod +++ b/go.mod @@ -78,7 +78,7 @@ require ( github.com/shopspring/decimal v1.4.0 github.com/smartcontractkit/chain-selectors v1.0.40 github.com/smartcontractkit/chainlink-automation v0.8.1 - github.com/smartcontractkit/chainlink-ccip v0.0.0-20250225130625-4a632b0b1e61 + github.com/smartcontractkit/chainlink-ccip v0.0.0-20250226083129-e596590f48f7 github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250214202341-4190f2db1c01 github.com/smartcontractkit/chainlink-common v0.4.2-0.20250214231858-f365e2bdecea github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20250224190032-809e4b8cf29e diff --git a/go.sum b/go.sum index 21d315cb677..441c8b933ec 100644 --- a/go.sum +++ b/go.sum @@ -1016,8 +1016,8 @@ github.com/smartcontractkit/chain-selectors v1.0.40 h1:iLvvoZeehVq6/7F+zzolQLF0D github.com/smartcontractkit/chain-selectors v1.0.40/go.mod h1:xsKM0aN3YGcQKTPRPDDtPx2l4mlTN1Djmg0VVXV40b8= github.com/smartcontractkit/chainlink-automation v0.8.1 h1:sTc9LKpBvcKPc1JDYAmgBc2xpDKBco/Q4h4ydl6+UUU= github.com/smartcontractkit/chainlink-automation v0.8.1/go.mod h1:Iij36PvWZ6blrdC5A/nrQUBuf3MH3JvsBB9sSyc9W08= -github.com/smartcontractkit/chainlink-ccip v0.0.0-20250225130625-4a632b0b1e61 h1:x8GMgtVnW81t//lDpizA+/t225RThOjw8ydtrORFS7Q= -github.com/smartcontractkit/chainlink-ccip v0.0.0-20250225130625-4a632b0b1e61/go.mod h1:Hht/OJq/PxC+gnBCIPyzHt4Otsw6mYwUVsmtOqIvlxo= +github.com/smartcontractkit/chainlink-ccip v0.0.0-20250226083129-e596590f48f7 h1:179ROx6VXwUApnhf7NzqMiCVUwutdLzRxvA10KsQQhQ= +github.com/smartcontractkit/chainlink-ccip v0.0.0-20250226083129-e596590f48f7/go.mod h1:Hht/OJq/PxC+gnBCIPyzHt4Otsw6mYwUVsmtOqIvlxo= github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250214202341-4190f2db1c01 h1:R3OD6Phi0ULIQ2uvHiKVWYdgpi/O1Mt46CUK1UApcXU= github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250214202341-4190f2db1c01/go.mod h1:Bmwq4lNb5tE47sydN0TKetcLEGbgl+VxHEWp4S0LI60= github.com/smartcontractkit/chainlink-common v0.4.2-0.20250214231858-f365e2bdecea h1:/1f/pWf7vSV9acTR9UPn2exPAwQG/LHGa4l9OywhS00= diff --git a/integration-tests/go.mod b/integration-tests/go.mod index 114b9fa54e6..02a22943d6b 100644 --- a/integration-tests/go.mod +++ b/integration-tests/go.mod @@ -44,7 +44,7 @@ require ( github.com/slack-go/slack v0.15.0 github.com/smartcontractkit/chain-selectors v1.0.40 github.com/smartcontractkit/chainlink-automation v0.8.1 - github.com/smartcontractkit/chainlink-ccip v0.0.0-20250225130625-4a632b0b1e61 + github.com/smartcontractkit/chainlink-ccip v0.0.0-20250226083129-e596590f48f7 github.com/smartcontractkit/chainlink-common v0.4.2-0.20250221174903-e1e47fdb11b0 github.com/smartcontractkit/chainlink-integrations/evm v0.0.0-20250213145514-41d874782c02 github.com/smartcontractkit/chainlink-protos/job-distributor v0.9.0 diff --git a/integration-tests/go.sum b/integration-tests/go.sum index 5c335396988..e0ee69f9e01 100644 --- a/integration-tests/go.sum +++ b/integration-tests/go.sum @@ -1430,8 +1430,8 @@ github.com/smartcontractkit/chain-selectors v1.0.40 h1:iLvvoZeehVq6/7F+zzolQLF0D github.com/smartcontractkit/chain-selectors v1.0.40/go.mod h1:xsKM0aN3YGcQKTPRPDDtPx2l4mlTN1Djmg0VVXV40b8= github.com/smartcontractkit/chainlink-automation v0.8.1 h1:sTc9LKpBvcKPc1JDYAmgBc2xpDKBco/Q4h4ydl6+UUU= github.com/smartcontractkit/chainlink-automation v0.8.1/go.mod h1:Iij36PvWZ6blrdC5A/nrQUBuf3MH3JvsBB9sSyc9W08= -github.com/smartcontractkit/chainlink-ccip v0.0.0-20250225130625-4a632b0b1e61 h1:x8GMgtVnW81t//lDpizA+/t225RThOjw8ydtrORFS7Q= -github.com/smartcontractkit/chainlink-ccip v0.0.0-20250225130625-4a632b0b1e61/go.mod h1:Hht/OJq/PxC+gnBCIPyzHt4Otsw6mYwUVsmtOqIvlxo= +github.com/smartcontractkit/chainlink-ccip v0.0.0-20250226083129-e596590f48f7 h1:179ROx6VXwUApnhf7NzqMiCVUwutdLzRxvA10KsQQhQ= +github.com/smartcontractkit/chainlink-ccip v0.0.0-20250226083129-e596590f48f7/go.mod h1:Hht/OJq/PxC+gnBCIPyzHt4Otsw6mYwUVsmtOqIvlxo= github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250214202341-4190f2db1c01 h1:R3OD6Phi0ULIQ2uvHiKVWYdgpi/O1Mt46CUK1UApcXU= github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250214202341-4190f2db1c01/go.mod h1:Bmwq4lNb5tE47sydN0TKetcLEGbgl+VxHEWp4S0LI60= github.com/smartcontractkit/chainlink-common v0.4.2-0.20250221174903-e1e47fdb11b0 h1:BTN2nQgFKBxgas6oqY3ym82O+wT++WlpP1+a6KzIfY0= diff --git a/integration-tests/load/go.mod b/integration-tests/load/go.mod index b52c7d71b36..587c30e4f31 100644 --- a/integration-tests/load/go.mod +++ b/integration-tests/load/go.mod @@ -26,7 +26,7 @@ require ( github.com/rs/zerolog v1.33.0 github.com/slack-go/slack v0.15.0 github.com/smartcontractkit/chain-selectors v1.0.40 - github.com/smartcontractkit/chainlink-ccip v0.0.0-20250225130625-4a632b0b1e61 + github.com/smartcontractkit/chainlink-ccip v0.0.0-20250226083129-e596590f48f7 github.com/smartcontractkit/chainlink-common v0.4.2-0.20250221174903-e1e47fdb11b0 github.com/smartcontractkit/chainlink-integrations/evm v0.0.0-20250213145514-41d874782c02 github.com/smartcontractkit/chainlink-testing-framework/lib v1.51.1-0.20250225210020-fc215b29321e diff --git a/integration-tests/load/go.sum b/integration-tests/load/go.sum index d3140dcdecb..e3e3a07128c 100644 --- a/integration-tests/load/go.sum +++ b/integration-tests/load/go.sum @@ -1415,8 +1415,8 @@ github.com/smartcontractkit/chain-selectors v1.0.40 h1:iLvvoZeehVq6/7F+zzolQLF0D github.com/smartcontractkit/chain-selectors v1.0.40/go.mod h1:xsKM0aN3YGcQKTPRPDDtPx2l4mlTN1Djmg0VVXV40b8= github.com/smartcontractkit/chainlink-automation v0.8.1 h1:sTc9LKpBvcKPc1JDYAmgBc2xpDKBco/Q4h4ydl6+UUU= github.com/smartcontractkit/chainlink-automation v0.8.1/go.mod h1:Iij36PvWZ6blrdC5A/nrQUBuf3MH3JvsBB9sSyc9W08= -github.com/smartcontractkit/chainlink-ccip v0.0.0-20250225130625-4a632b0b1e61 h1:x8GMgtVnW81t//lDpizA+/t225RThOjw8ydtrORFS7Q= -github.com/smartcontractkit/chainlink-ccip v0.0.0-20250225130625-4a632b0b1e61/go.mod h1:Hht/OJq/PxC+gnBCIPyzHt4Otsw6mYwUVsmtOqIvlxo= +github.com/smartcontractkit/chainlink-ccip v0.0.0-20250226083129-e596590f48f7 h1:179ROx6VXwUApnhf7NzqMiCVUwutdLzRxvA10KsQQhQ= +github.com/smartcontractkit/chainlink-ccip v0.0.0-20250226083129-e596590f48f7/go.mod h1:Hht/OJq/PxC+gnBCIPyzHt4Otsw6mYwUVsmtOqIvlxo= github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250214202341-4190f2db1c01 h1:R3OD6Phi0ULIQ2uvHiKVWYdgpi/O1Mt46CUK1UApcXU= github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250214202341-4190f2db1c01/go.mod h1:Bmwq4lNb5tE47sydN0TKetcLEGbgl+VxHEWp4S0LI60= github.com/smartcontractkit/chainlink-common v0.4.2-0.20250221174903-e1e47fdb11b0 h1:BTN2nQgFKBxgas6oqY3ym82O+wT++WlpP1+a6KzIfY0= diff --git a/system-tests/lib/go.mod b/system-tests/lib/go.mod index 35227b34da1..526d92473e4 100644 --- a/system-tests/lib/go.mod +++ b/system-tests/lib/go.mod @@ -340,7 +340,7 @@ require ( github.com/smartcontractkit/ccip-owner-contracts v0.1.0 // indirect github.com/smartcontractkit/chain-selectors v1.0.40 // indirect github.com/smartcontractkit/chainlink-automation v0.8.1 // indirect - github.com/smartcontractkit/chainlink-ccip v0.0.0-20250225130625-4a632b0b1e61 // indirect + github.com/smartcontractkit/chainlink-ccip v0.0.0-20250226083129-e596590f48f7 // indirect github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250214202341-4190f2db1c01 // indirect github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20250224190032-809e4b8cf29e // indirect github.com/smartcontractkit/chainlink-feeds v0.1.1 // indirect diff --git a/system-tests/lib/go.sum b/system-tests/lib/go.sum index 7c26e1f4bdd..83acbd61e21 100644 --- a/system-tests/lib/go.sum +++ b/system-tests/lib/go.sum @@ -1124,8 +1124,8 @@ github.com/smartcontractkit/chain-selectors v1.0.40 h1:iLvvoZeehVq6/7F+zzolQLF0D github.com/smartcontractkit/chain-selectors v1.0.40/go.mod h1:xsKM0aN3YGcQKTPRPDDtPx2l4mlTN1Djmg0VVXV40b8= github.com/smartcontractkit/chainlink-automation v0.8.1 h1:sTc9LKpBvcKPc1JDYAmgBc2xpDKBco/Q4h4ydl6+UUU= github.com/smartcontractkit/chainlink-automation v0.8.1/go.mod h1:Iij36PvWZ6blrdC5A/nrQUBuf3MH3JvsBB9sSyc9W08= -github.com/smartcontractkit/chainlink-ccip v0.0.0-20250225130625-4a632b0b1e61 h1:x8GMgtVnW81t//lDpizA+/t225RThOjw8ydtrORFS7Q= -github.com/smartcontractkit/chainlink-ccip v0.0.0-20250225130625-4a632b0b1e61/go.mod h1:Hht/OJq/PxC+gnBCIPyzHt4Otsw6mYwUVsmtOqIvlxo= +github.com/smartcontractkit/chainlink-ccip v0.0.0-20250226083129-e596590f48f7 h1:179ROx6VXwUApnhf7NzqMiCVUwutdLzRxvA10KsQQhQ= +github.com/smartcontractkit/chainlink-ccip v0.0.0-20250226083129-e596590f48f7/go.mod h1:Hht/OJq/PxC+gnBCIPyzHt4Otsw6mYwUVsmtOqIvlxo= github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250214202341-4190f2db1c01 h1:R3OD6Phi0ULIQ2uvHiKVWYdgpi/O1Mt46CUK1UApcXU= github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250214202341-4190f2db1c01/go.mod h1:Bmwq4lNb5tE47sydN0TKetcLEGbgl+VxHEWp4S0LI60= github.com/smartcontractkit/chainlink-common v0.4.2-0.20250221174903-e1e47fdb11b0 h1:BTN2nQgFKBxgas6oqY3ym82O+wT++WlpP1+a6KzIfY0= diff --git a/system-tests/tests/go.mod b/system-tests/tests/go.mod index cab810d1f99..64c23415501 100644 --- a/system-tests/tests/go.mod +++ b/system-tests/tests/go.mod @@ -343,7 +343,7 @@ require ( github.com/sirupsen/logrus v1.9.3 // indirect github.com/smartcontractkit/ccip-owner-contracts v0.1.0 // indirect github.com/smartcontractkit/chainlink-automation v0.8.1 // indirect - github.com/smartcontractkit/chainlink-ccip v0.0.0-20250225130625-4a632b0b1e61 // indirect + github.com/smartcontractkit/chainlink-ccip v0.0.0-20250226083129-e596590f48f7 // indirect github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250214202341-4190f2db1c01 // indirect github.com/smartcontractkit/chainlink-common v0.4.2-0.20250221174903-e1e47fdb11b0 // indirect github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20250224190032-809e4b8cf29e // indirect diff --git a/system-tests/tests/go.sum b/system-tests/tests/go.sum index a139a30ed1f..8ec9815675c 100644 --- a/system-tests/tests/go.sum +++ b/system-tests/tests/go.sum @@ -1124,8 +1124,8 @@ github.com/smartcontractkit/chain-selectors v1.0.40 h1:iLvvoZeehVq6/7F+zzolQLF0D github.com/smartcontractkit/chain-selectors v1.0.40/go.mod h1:xsKM0aN3YGcQKTPRPDDtPx2l4mlTN1Djmg0VVXV40b8= github.com/smartcontractkit/chainlink-automation v0.8.1 h1:sTc9LKpBvcKPc1JDYAmgBc2xpDKBco/Q4h4ydl6+UUU= github.com/smartcontractkit/chainlink-automation v0.8.1/go.mod h1:Iij36PvWZ6blrdC5A/nrQUBuf3MH3JvsBB9sSyc9W08= -github.com/smartcontractkit/chainlink-ccip v0.0.0-20250225130625-4a632b0b1e61 h1:x8GMgtVnW81t//lDpizA+/t225RThOjw8ydtrORFS7Q= -github.com/smartcontractkit/chainlink-ccip v0.0.0-20250225130625-4a632b0b1e61/go.mod h1:Hht/OJq/PxC+gnBCIPyzHt4Otsw6mYwUVsmtOqIvlxo= +github.com/smartcontractkit/chainlink-ccip v0.0.0-20250226083129-e596590f48f7 h1:179ROx6VXwUApnhf7NzqMiCVUwutdLzRxvA10KsQQhQ= +github.com/smartcontractkit/chainlink-ccip v0.0.0-20250226083129-e596590f48f7/go.mod h1:Hht/OJq/PxC+gnBCIPyzHt4Otsw6mYwUVsmtOqIvlxo= github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250214202341-4190f2db1c01 h1:R3OD6Phi0ULIQ2uvHiKVWYdgpi/O1Mt46CUK1UApcXU= github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250214202341-4190f2db1c01/go.mod h1:Bmwq4lNb5tE47sydN0TKetcLEGbgl+VxHEWp4S0LI60= github.com/smartcontractkit/chainlink-common v0.4.2-0.20250221174903-e1e47fdb11b0 h1:BTN2nQgFKBxgas6oqY3ym82O+wT++WlpP1+a6KzIfY0= From fa7b728be5fc8b37537fbcc354c41a79d2b53865 Mon Sep 17 00:00:00 2001 From: Makram Date: Wed, 26 Feb 2025 15:02:05 +0200 Subject: [PATCH 05/12] .github: fix integration in memory tests workflow (#16586) * .github: fix integration in memory tests workflow * fix --- .github/integration-in-memory-tests.yml | 7 ------- .github/workflows/integration-in-memory-tests.yml | 4 ++-- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/.github/integration-in-memory-tests.yml b/.github/integration-in-memory-tests.yml index 39d61cd03e7..1dbda1b26ce 100644 --- a/.github/integration-in-memory-tests.yml +++ b/.github/integration-in-memory-tests.yml @@ -38,13 +38,6 @@ runner-test-matrix: - PR Integration CCIP Tests test_cmd: cd integration-tests/smoke/ccip && go test -run "Test_CCIPMessageLimitations" -timeout 12m -test.parallel=2 -count=1 -json - - id: smoke/ccip/ccip_fee_boosting_test.go:* - path: integration-tests/smoke/ccip/ccip_fee_boosting_test.go - test_env_type: in-memory - runs_on: ubuntu-latest - triggers: - - PR Integration CCIP Tests - test_cmd: cd integration-tests/smoke/ccip && go test ccip_fee_boosting_test.go -timeout 12m -test.parallel=2 -count=1 -json - id: smoke/ccip/ccip_batching_test.go:* path: integration-tests/smoke/ccip/ccip_batching_test.go test_env_type: in-memory diff --git a/.github/workflows/integration-in-memory-tests.yml b/.github/workflows/integration-in-memory-tests.yml index dcbe988693d..565e391d235 100644 --- a/.github/workflows/integration-in-memory-tests.yml +++ b/.github/workflows/integration-in-memory-tests.yml @@ -74,7 +74,7 @@ jobs: contents: read needs: changes if: github.event_name == 'pull_request' && ( needs.changes.outputs.ccip_changes == 'true' || needs.changes.outputs.core_changes == 'true' || needs.changes.outputs.github_ci_changes == 'true') - uses: smartcontractkit/.github/.github/workflows/run-integration-tests.yml@bb2d725fba3a42858bcb91e816987ca7cd063488 + uses: smartcontractkit/.github/.github/workflows/run-integration-tests.yml@18ee2276811ff4ad56a2284590c9917bec33b748 with: workflow_name: Run CCIP Integration Tests For PR test_path: .github/integration-in-memory-tests.yml @@ -98,7 +98,7 @@ jobs: contents: read needs: changes if: github.event_name == 'merge_group' && ( needs.changes.outputs.ccip_changes == 'true' || needs.changes.outputs.core_changes == 'true' || needs.changes.outputs.github_ci_changes == 'true') - uses: smartcontractkit/.github/.github/workflows/run-integration-tests.yml@d7f8e299e891eafa428a37b5e856d929232c6e18 + uses: smartcontractkit/.github/.github/workflows/run-integration-tests.yml@18ee2276811ff4ad56a2284590c9917bec33b748 with: workflow_name: Run CCIP Integration Tests For Merge Queue test_path: .github/integration-in-memory-tests.yml From e88896e702a1240b0b3ed672f444c66e20d58288 Mon Sep 17 00:00:00 2001 From: Will Winder Date: Wed, 26 Feb 2025 08:37:25 -0500 Subject: [PATCH 06/12] Rename commitTransmitter to ccipTransmitter (#16235) --- .../ccip/ocrimpls/contract_transmitter.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/core/capabilities/ccip/ocrimpls/contract_transmitter.go b/core/capabilities/ccip/ocrimpls/contract_transmitter.go index 1876ac60b2f..1766ae39865 100644 --- a/core/capabilities/ccip/ocrimpls/contract_transmitter.go +++ b/core/capabilities/ccip/ocrimpls/contract_transmitter.go @@ -100,9 +100,9 @@ func ToExecCalldata( }, nil } -var _ ocr3types.ContractTransmitter[[]byte] = &commitTransmitter{} +var _ ocr3types.ContractTransmitter[[]byte] = &ccipTransmitter{} -type commitTransmitter struct { +type ccipTransmitter struct { cw commontypes.ContractWriter fromAccount ocrtypes.Account contractName string @@ -119,7 +119,7 @@ func XXXNewContractTransmitterTestsOnly( offrampAddress string, toCalldataFn ToCalldataFunc, ) ocr3types.ContractTransmitter[[]byte] { - return &commitTransmitter{ + return &ccipTransmitter{ cw: cw, fromAccount: fromAccount, contractName: contractName, @@ -134,7 +134,7 @@ func NewCommitContractTransmitter( fromAccount ocrtypes.Account, offrampAddress string, ) ocr3types.ContractTransmitter[[]byte] { - return &commitTransmitter{ + return &ccipTransmitter{ cw: cw, fromAccount: fromAccount, contractName: consts.ContractNameOffRamp, @@ -149,7 +149,7 @@ func NewExecContractTransmitter( fromAccount ocrtypes.Account, offrampAddress string, ) ocr3types.ContractTransmitter[[]byte] { - return &commitTransmitter{ + return &ccipTransmitter{ cw: cw, fromAccount: fromAccount, contractName: consts.ContractNameOffRamp, @@ -160,12 +160,12 @@ func NewExecContractTransmitter( } // FromAccount implements ocr3types.ContractTransmitter. -func (c *commitTransmitter) FromAccount(context.Context) (ocrtypes.Account, error) { +func (c *ccipTransmitter) FromAccount(context.Context) (ocrtypes.Account, error) { return c.fromAccount, nil } // Transmit implements ocr3types.ContractTransmitter. -func (c *commitTransmitter) Transmit( +func (c *ccipTransmitter) Transmit( ctx context.Context, configDigest ocrtypes.ConfigDigest, seqNr uint64, From a939bc0261cd50c567935f6b26b9ef5b4e9bc659 Mon Sep 17 00:00:00 2001 From: Bartek Tofel Date: Wed, 26 Feb 2025 15:43:21 +0100 Subject: [PATCH 07/12] [TT-2009] run multi-don keystone test in the CI (#16553) * run multi-don keystone test in the CI * Use real-world endpoint * enhance TOML config clarity * fix JD registration for multi don setup and update guidelines * use latest JD in keystone e2e tests in the CI --- .github/e2e-tests.yml | 18 ++ .../lib/cre/environment/environment.go | 16 +- .../smoke/capabilities/environment-ci.toml | 13 +- .../environment-multi-don-ci.toml | 184 ++++++++++++++++++ .../capabilities/environment-multi-don.toml | 42 ++-- .../tests/smoke/capabilities/environment.toml | 2 +- .../tests/smoke/capabilities/guidelines.md | 4 +- 7 files changed, 243 insertions(+), 36 deletions(-) create mode 100644 system-tests/tests/smoke/capabilities/environment-multi-don-ci.toml diff --git a/.github/e2e-tests.yml b/.github/e2e-tests.yml index a2785367763..157306b3dd1 100644 --- a/.github/e2e-tests.yml +++ b/.github/e2e-tests.yml @@ -201,6 +201,24 @@ runner-test-matrix: # Anvil developer key, not a secret PRIVATE_KEY: "ac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80" + - id: system-tests/smoke/capabilities/workflow_test.go:TestKeystoneWithOCR3Workflow_TwoDons + path: system-tests/tests/smoke/capabilities/workflow_test.go + test_env_type: docker + runs_on: ubuntu-latest + triggers: + - PR Workflow Engine E2E Core Tests + - Nightly E2E Tests + test_cmd: cd system-tests/tests && go test github.com/smartcontractkit/chainlink/system-tests/tests/smoke/capabilities -v -run "^(TestKeystoneWithOCR3Workflow_TwoDons_LivePrice)$" -timeout 30m -count=1 -test.parallel=1 -json + pyroscope_env: ci-smoke-capabilities-evm-simulated + test_env_vars: + E2E_TEST_CHAINLINK_VERSION: '{{ env.DEFAULT_CHAINLINK_PLUGINS_VERSION }}' # This is the chainlink version that has the plugins + E2E_JD_VERSION: 0.9.0 # there is no latest tag for this repo, so we need to specify the version + GITHUB_READ_TOKEN: '{{ env.GITHUB_API_TOKEN }}' # GATI-provided token that can read from capabilities and dev-platform repos + CI: "true" + CTF_CONFIGS: "environment-multi-don-ci.toml" + # Anvil developer key, not a secret + PRIVATE_KEY: "ac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80" + - id: chaos/ocr_chaos_test.go path: integration-tests/chaos/ocr_chaos_test.go test_env_type: k8s-remote-runner diff --git a/system-tests/lib/cre/environment/environment.go b/system-tests/lib/cre/environment/environment.go index 83f1194860d..9d48bb179ea 100644 --- a/system-tests/lib/cre/environment/environment.go +++ b/system-tests/lib/cre/environment/environment.go @@ -35,6 +35,7 @@ func BuildTopologyAndCLDEnvironment(lgr logger.Logger, nodeSetInput []*types.Cap func buildChainlinkDeploymentEnv(lgr logger.Logger, jdOutput *jd.Output, nodeSetOutput []*types.WrappedNodeOutput, blockchainOutput *blockchain.Output, sethClient *seth.Client) (*deployment.Environment, []*devenv.DON, error) { envs := make([]*deployment.Environment, len(nodeSetOutput)) dons := make([]*devenv.DON, len(nodeSetOutput)) + var allNodesInfo []devenv.NodeInfo for i, nodeOutput := range nodeSetOutput { // assume that each nodeset has only one bootstrap node @@ -42,6 +43,7 @@ func buildChainlinkDeploymentEnv(lgr logger.Logger, jdOutput *jd.Output, nodeSet if err != nil { return nil, nil, errors.Wrap(err, "failed to get node info") } + allNodesInfo = append(allNodesInfo, nodeInfo...) jdConfig := devenv.JDConfig{ GRPC: jdOutput.HostGRPCUrl, @@ -84,6 +86,18 @@ func buildChainlinkDeploymentEnv(lgr logger.Logger, jdOutput *jd.Output, nodeSet nodeIDs = append(nodeIDs, env.NodeIDs...) } + // Create a JD client that can interact with all the nodes, otherwise if it has node IDs of nodes that belong only to one Don, + // it will still propose jobs to unknown nodes, but won't accept them automatically + jd, err := devenv.NewJDClient(context.Background(), devenv.JDConfig{ + GRPC: jdOutput.HostGRPCUrl, + WSRPC: jdOutput.DockerWSRPCUrl, + Creds: insecure.NewCredentials(), + NodeInfo: allNodesInfo, + }) + if err != nil { + return nil, nil, errors.Wrap(err, "failed to create JD client") + } + // we assume that all DONs run on the same chain and that there's only one chain // also, we don't care which instance of offchain client we use, because we have // only one instance of offchain client and we have just configured it to work @@ -93,7 +107,7 @@ func buildChainlinkDeploymentEnv(lgr logger.Logger, jdOutput *jd.Output, nodeSet Logger: envs[0].Logger, ExistingAddresses: envs[0].ExistingAddresses, Chains: envs[0].Chains, - Offchain: envs[0].Offchain, + Offchain: jd, OCRSecrets: envs[0].OCRSecrets, GetContext: envs[0].GetContext, NodeIDs: nodeIDs, diff --git a/system-tests/tests/smoke/capabilities/environment-ci.toml b/system-tests/tests/smoke/capabilities/environment-ci.toml index 9d4c8226956..96c63b6800e 100644 --- a/system-tests/tests/smoke/capabilities/environment-ci.toml +++ b/system-tests/tests/smoke/capabilities/environment-ci.toml @@ -4,7 +4,7 @@ docker_cmd_params = ["-b", "5"] [jd] - image = "replace-me" + image = "injected-at-runtime" [fake] port = 8171 @@ -15,7 +15,6 @@ use_cre_cli = true should_compile_new_workflow = false - workflow_folder_location = "not-needed-here" [workflow_config.dependencies] capabilities_version = "v1.0.0-alpha" @@ -41,7 +40,7 @@ [[nodesets.node_specs]] [nodesets.node_specs.node] - image = "replace-me" + image = "injected-at-runtime" user_config_overrides = """ [Feature] LogPoller = true @@ -58,7 +57,7 @@ [[nodesets.node_specs]] [nodesets.node_specs.node] - image = "replace-me" + image = "injected-at-runtime" capabilities = ["./amd64_cron"] user_config_overrides = """ [Feature] @@ -76,7 +75,7 @@ [[nodesets.node_specs]] [nodesets.node_specs.node] - image = "replace-me" + image = "injected-at-runtime" capabilities = ["./amd64_cron"] user_config_overrides = """ [Feature] @@ -94,7 +93,7 @@ [[nodesets.node_specs]] [nodesets.node_specs.node] - image = "replace-me" + image = "injected-at-runtime" capabilities = ["./amd64_cron"] user_config_overrides = """ [Feature] @@ -112,7 +111,7 @@ [[nodesets.node_specs]] [nodesets.node_specs.node] - image = "replace-me" + image = "injected-at-runtime" capabilities = ["./amd64_cron"] user_config_overrides = """ [Feature] diff --git a/system-tests/tests/smoke/capabilities/environment-multi-don-ci.toml b/system-tests/tests/smoke/capabilities/environment-multi-don-ci.toml new file mode 100644 index 00000000000..a5962707ad6 --- /dev/null +++ b/system-tests/tests/smoke/capabilities/environment-multi-don-ci.toml @@ -0,0 +1,184 @@ + +[blockchain_a] + type = "anvil" + docker_cmd_params = ["-b", "5"] + +[jd] + image = "injected-at-runtime" + +[workflow_config] + workflow_name = "abcdefgasd" + feed_id = "018bfe8840700040000000000000000000000000000000000000000000000000" + + use_cre_cli = true + should_compile_new_workflow = false + + [workflow_config.dependencies] + capabilities_version = "v1.0.0-alpha" + cre_cli_version = "v0.0.2" + + [workflow_config.compiled_config] + binary_url = "https://gist.githubusercontent.com/Tofel/73d703157bafe65ab51f7e619c589091/raw/cb7b2a56b37e333fe0bdce07b79538c4ce332f5f/binary.wasm.br" + config_url = "https://gist.githubusercontent.com/Tofel/a261990c5b177fe58f304a52d0998e51/raw/2e28ee10feacf4e451a38fdfbdff8a38cf2628d8/config.json2891974493" + +[[nodesets]] + nodes = 5 + override_mode = "each" + http_port_range_start = 10100 + name = "workflow" + + [nodesets.db] + image = "postgres:12.0" + port = 13000 + volume_name = "workflow_volume" + + [[nodesets.node_specs]] + + [nodesets.node_specs.node] + image = "injected-at-runtime" + user_config_overrides = """ + [Feature] + LogPoller = true + + [OCR2] + Enabled = true + DatabaseTimeout = '1s' + + [P2P.V2] + Enabled = true + ListenAddresses = ['0.0.0.0:5001'] + """ + + [[nodesets.node_specs]] + + [nodesets.node_specs.node] + image = "injected-at-runtime" + capabilities = ["./amd64_cron"] + user_config_overrides = """ + [Feature] + LogPoller = true + + [OCR2] + Enabled = true + DatabaseTimeout = '1s' + + [P2P.V2] + Enabled = true + ListenAddresses = ['0.0.0.0:5001'] + """ + + [[nodesets.node_specs]] + + [nodesets.node_specs.node] + image = "injected-at-runtime" + capabilities = ["./amd64_cron"] + user_config_overrides = """ + [Feature] + LogPoller = true + + [OCR2] + Enabled = true + DatabaseTimeout = '1s' + + [P2P.V2] + Enabled = true + ListenAddresses = ['0.0.0.0:5001'] + """ + + [[nodesets.node_specs]] + + [nodesets.node_specs.node] + image = "injected-at-runtime" + capabilities = ["./amd64_cron"] + user_config_overrides = """ + [Feature] + LogPoller = true + + [OCR2] + Enabled = true + DatabaseTimeout = '1s' + + [P2P.V2] + Enabled = true + ListenAddresses = ['0.0.0.0:5001'] + """ + + [[nodesets.node_specs]] + + [nodesets.node_specs.node] + image = "injected-at-runtime" + capabilities = ["./amd64_cron"] + user_config_overrides = """ + [Feature] + LogPoller = true + + [OCR2] + Enabled = true + DatabaseTimeout = '1s' + + [P2P.V2] + Enabled = true + ListenAddresses = ['0.0.0.0:5001'] + """ + +[[nodesets]] + nodes = 3 + override_mode = "each" + http_port_range_start = 10200 + name = "capabilities" + + [nodesets.db] + image = "postgres:12.0" + port = 13100 + volume_name = "capabilities_volume" + + [[nodesets.node_specs]] + + [nodesets.node_specs.node] + image = "injected-at-runtime" + user_config_overrides = """ + [Feature] + LogPoller = true + + [OCR2] + Enabled = true + DatabaseTimeout = '1s' + + [P2P.V2] + Enabled = true + ListenAddresses = ['0.0.0.0:5001'] + """ + + [[nodesets.node_specs]] + + [nodesets.node_specs.node] + image = "injected-at-runtime" + user_config_overrides = """ + [Feature] + LogPoller = true + + [OCR2] + Enabled = true + DatabaseTimeout = '1s' + + [P2P.V2] + Enabled = true + ListenAddresses = ['0.0.0.0:5001'] + """ + + [[nodesets.node_specs]] + + [nodesets.node_specs.node] + image = "injected-at-runtime" + user_config_overrides = """ + [Feature] + LogPoller = true + + [OCR2] + Enabled = true + DatabaseTimeout = '1s' + + [P2P.V2] + Enabled = true + ListenAddresses = ['0.0.0.0:5001'] + """ \ No newline at end of file diff --git a/system-tests/tests/smoke/capabilities/environment-multi-don.toml b/system-tests/tests/smoke/capabilities/environment-multi-don.toml index cfac5d5ca76..631edf5be94 100644 --- a/system-tests/tests/smoke/capabilities/environment-multi-don.toml +++ b/system-tests/tests/smoke/capabilities/environment-multi-don.toml @@ -5,7 +5,7 @@ [jd] # change to your version - image = "jd-test-1:latest" + image = "job-distributor:latest" [workflow_config] workflow_name = "abcdefgasd" @@ -37,9 +37,8 @@ [[nodesets.node_specs]] [nodesets.node_specs.node] - # docker_ctx = "../../../.." - # docker_file = "plugins/chainlink.Dockerfile" - image = "chainlink-tmp" + docker_ctx = "../../../.." + docker_file = "plugins/chainlink.Dockerfile" user_config_overrides = """ [Feature] LogPoller = true @@ -56,9 +55,8 @@ [[nodesets.node_specs]] [nodesets.node_specs.node] - # docker_ctx = "../../../.." - # docker_file = "plugins/chainlink.Dockerfile" - image = "chainlink-tmp" + docker_ctx = "../../../.." + docker_file = "plugins/chainlink.Dockerfile" capabilities = ["./amd64_cron"] user_config_overrides = """ [Feature] @@ -76,9 +74,8 @@ [[nodesets.node_specs]] [nodesets.node_specs.node] - # docker_ctx = "../../../.." - # docker_file = "plugins/chainlink.Dockerfile" - image = "chainlink-tmp" + docker_ctx = "../../../.." + docker_file = "plugins/chainlink.Dockerfile" capabilities = ["./amd64_cron"] user_config_overrides = """ [Feature] @@ -96,9 +93,8 @@ [[nodesets.node_specs]] [nodesets.node_specs.node] - # docker_ctx = "../../../.." - # docker_file = "plugins/chainlink.Dockerfile" - image = "chainlink-tmp" + docker_ctx = "../../../.." + docker_file = "plugins/chainlink.Dockerfile" capabilities = ["./amd64_cron"] user_config_overrides = """ [Feature] @@ -116,9 +112,8 @@ [[nodesets.node_specs]] [nodesets.node_specs.node] - # docker_ctx = "../../../.." - # docker_file = "plugins/chainlink.Dockerfile" - image = "chainlink-tmp" + docker_ctx = "../../../.." + docker_file = "plugins/chainlink.Dockerfile" capabilities = ["./amd64_cron"] user_config_overrides = """ [Feature] @@ -147,9 +142,8 @@ [[nodesets.node_specs]] [nodesets.node_specs.node] - # docker_ctx = "../../../.." - # docker_file = "plugins/chainlink.Dockerfile" - image = "chainlink-tmp" + docker_ctx = "../../../.." + docker_file = "plugins/chainlink.Dockerfile" user_config_overrides = """ [Feature] LogPoller = true @@ -166,9 +160,8 @@ [[nodesets.node_specs]] [nodesets.node_specs.node] - # docker_ctx = "../../../.." - # docker_file = "plugins/chainlink.Dockerfile" - image = "chainlink-tmp" + docker_ctx = "../../../.." + docker_file = "plugins/chainlink.Dockerfile" user_config_overrides = """ [Feature] LogPoller = true @@ -185,9 +178,8 @@ [[nodesets.node_specs]] [nodesets.node_specs.node] - # docker_ctx = "../../../.." - # docker_file = "plugins/chainlink.Dockerfile" - image = "chainlink-tmp" + docker_ctx = "../../../.." + docker_file = "plugins/chainlink.Dockerfile" user_config_overrides = """ [Feature] LogPoller = true diff --git a/system-tests/tests/smoke/capabilities/environment.toml b/system-tests/tests/smoke/capabilities/environment.toml index 2f7634c48e4..a114520324f 100644 --- a/system-tests/tests/smoke/capabilities/environment.toml +++ b/system-tests/tests/smoke/capabilities/environment.toml @@ -5,7 +5,7 @@ [jd] # change to your version - image = "jd-test-1:latest" + image = "job-distributor:latest" # fake data provider used as a mocked price source [fake] diff --git a/system-tests/tests/smoke/capabilities/guidelines.md b/system-tests/tests/smoke/capabilities/guidelines.md index a6b7d42e9f7..1f4c0a7293f 100644 --- a/system-tests/tests/smoke/capabilities/guidelines.md +++ b/system-tests/tests/smoke/capabilities/guidelines.md @@ -57,9 +57,9 @@ The test requires several environment variables. Below is a launch configuration - **`GITHUB_READ_TOKEN`**: Required for downloading the `cron` capability binary and CRE CLI (if enabled). Requires `content:read` permission for `smartcontractkit/capabilities` and `smartcontractkit/dev-platform` repositories. Use a fine-grained personal access token (PAT) tied to the **organization’s GitHub account**. - **`GIST_WRITE_TOKEN`**: Required only for compiling and uploading a new workflow. It needs `gist:read:write` permissions and should be a fine-grained PAT **tied to your personal GitHub account**. -Test also expects you to have the Job Distributor image available locally. By default, `environment.toml` expects image tagged as `jd-test-1:latest`. The easiest way to get it, is to clone the Job Distributor repository and build it locally with: +Test also expects you to have the Job Distributor image available locally. By default, `environment.toml` expects image tagged as `job-distributor:latest`. The easiest way to get it, is to clone the Job Distributor repository and build it locally with: ```bash -docker build -t jd-test-1 -f e2e/Dockerfile.e2e +docker build -t job-distributor:latest -f e2e/Dockerfile.e2e . ``` Alternatively, if you have access to the Docker image repository where it's stored you can modify `environment.toml` with the name of the image stored there. From 3efa849e04fa79b8db3e98ac5912ff408a9d4869 Mon Sep 17 00:00:00 2001 From: Patrick Date: Wed, 26 Feb 2025 10:51:26 -0500 Subject: [PATCH 08/12] fixing engine deletion bug (#16548) * fixing engine deletion bug * log instead of return if UnregisterTrigger fails * fix lint * removing misleading comments --- core/services/workflows/engine.go | 3 +- core/services/workflows/engine_test.go | 81 ++++++++++++++++++++++++++ 2 files changed, 83 insertions(+), 1 deletion(-) diff --git a/core/services/workflows/engine.go b/core/services/workflows/engine.go index abf4e59579d..1ac4e11c10b 100644 --- a/core/services/workflows/engine.go +++ b/core/services/workflows/engine.go @@ -1167,10 +1167,11 @@ func (e *Engine) Close() error { // any triggers to ensure no new executions are triggered, // then we'll close down any background goroutines, // and finally, we'll deregister any workflow steps. + for idx, t := range e.workflow.triggers { err := e.deregisterTrigger(ctx, t, idx) if err != nil { - return err + e.logger.Errorf("failed to deregister trigger: %v", err) } } diff --git a/core/services/workflows/engine_test.go b/core/services/workflows/engine_test.go index 59b95c94538..4756975704e 100644 --- a/core/services/workflows/engine_test.go +++ b/core/services/workflows/engine_test.go @@ -10,6 +10,7 @@ import ( "github.com/jonboulle/clockwork" "github.com/shopspring/decimal" "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" "google.golang.org/protobuf/proto" @@ -1876,6 +1877,86 @@ func TestEngine_CloseHappensOnlyIfWorkflowHasBeenRegistered(t *testing.T) { require.NoError(t, err) } +func TestEngine_CloseUnregisterFails_NotFound(t *testing.T) { + ctx := testutils.Context(t) + reg := coreCap.NewRegistry(logger.TestLogger(t)) + + trigger, _ := mockTrigger(t) + + require.NoError(t, reg.Add(ctx, trigger)) + + require.NoError(t, reg.Add(ctx, mockConsensus(""))) + + target := mockTarget("write_ethereum-testnet-sepolia@1.0.0") + require.NoError(t, reg.Add(ctx, target)) + + action := newMockCapability( + // Create a remote capability so we don't use the local transmission protocol. + capabilities.MustNewRemoteCapabilityInfo( + "custom-compute@1.0.0", + capabilities.CapabilityTypeAction, + "a custom compute action with custom config", + &capabilities.DON{ID: 1}, + ), + func(req capabilities.CapabilityRequest) (capabilities.CapabilityResponse, error) { + return capabilities.CapabilityResponse{ + Value: req.Inputs, + }, nil + }, + ) + require.NoError(t, reg.Add(ctx, action)) + + eng, testHooks := newTestEngineWithYAMLSpec( + t, + reg, + secretsWorkflow, + func(c *Config) { + c.SecretsFetcher = &mockFetcher{ + retval: map[string]string{}, + retErr: errors.New("failed to fetch secrets XXX"), + } + }, + ) + + err := eng.Start(ctx) + require.NoError(t, err) + + // simulate WorkflowUpdatedEvent that calls tryEngineCleanup + <-testHooks.initFailed + + // update trigger to mock + // triggerCapability wraps a capabilities.TriggerCapability + mockedInternalTrigger := newMockRuntimeTrigger(eng.workflow.triggers[0].trigger) + mockedInternalTrigger.On("UnregisterTrigger").Return(errors.New("trigger mock not found")) + eng.workflow.triggers[0].trigger = mockedInternalTrigger + eng.workflow.triggers[0].registered = true + + err = eng.Close() + require.NoError(t, err) +} + +type mockRuntimeTrigger struct { + c capabilities.TriggerCapability + *mock.Mock +} + +func newMockRuntimeTrigger(t capabilities.TriggerCapability) *mockRuntimeTrigger { + return &mockRuntimeTrigger{t, new(mock.Mock)} +} + +func (t mockRuntimeTrigger) Info(ctx context.Context) (capabilities.CapabilityInfo, error) { + return t.c.Info(ctx) +} + +func (t mockRuntimeTrigger) RegisterTrigger(ctx context.Context, request capabilities.TriggerRegistrationRequest) (<-chan capabilities.TriggerResponse, error) { + return t.c.RegisterTrigger(ctx, request) +} + +func (t mockRuntimeTrigger) UnregisterTrigger(ctx context.Context, request capabilities.TriggerRegistrationRequest) error { + args := t.Called() + return args.Error(0) +} + func TestMerge(t *testing.T) { tests := []struct { name string From 39d09094fea9b1754cb94e41d0fae017c9126cb2 Mon Sep 17 00:00:00 2001 From: gustavogama-cll <165679773+gustavogama-cll@users.noreply.github.com> Date: Wed, 26 Feb 2025 14:19:58 -0300 Subject: [PATCH 09/12] feat(job-distributor): add exp. backoff retry to `feeds.SyncNodeInfo()` (#15752) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat(job-distributor): add exp. backoff retry to feeds.SyncNodeInfo() There’s a behavior that we’ve observed for some time on the NOP side where they will add/update a chain configuration of the Job Distributor panel but the change is not reflected on the service itself. This leads to inefficiencies as NOPs are unaware of this and thus need to be notified so that they may "reapply" the configuration. After some investigation, we suspect that this is due to connectivity issues between the nodes and the job distributor instance, which causes the message with the update to be lost. This PR attempts to solve this by adding a "retry" wrapper on top of the existing `SyncNodeInfo` method. We rely on `avast/retry-go` to implement the bulk of the retry logic. It's configured with a minimal delay of 10 seconds, maximum delay of 30 minutes and retry a total of 56 times -- which adds up to a bit more than 24 hours. Ticket Number: DPA-1371 * review: protect cancel func access with a mutex to avoid race conditions * review: trigger retry on partial failures and support multiple job distributors * review: clear contexts before closing the connection manager --- .changeset/neat-penguins-report.md | 5 + core/scripts/go.mod | 2 +- core/scripts/go.sum | 4 +- core/services/feeds/service.go | 166 ++++++++++++++++++++--- core/services/feeds/service_test.go | 201 +++++++++++++++++++++++++++- 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 +- system-tests/lib/go.mod | 2 +- system-tests/lib/go.sum | 4 +- system-tests/tests/go.mod | 2 +- system-tests/tests/go.sum | 4 +- 17 files changed, 366 insertions(+), 48 deletions(-) create mode 100644 .changeset/neat-penguins-report.md diff --git a/.changeset/neat-penguins-report.md b/.changeset/neat-penguins-report.md new file mode 100644 index 00000000000..053faa00178 --- /dev/null +++ b/.changeset/neat-penguins-report.md @@ -0,0 +1,5 @@ +--- +"chainlink": patch +--- + +#added add exponential backoff retry to feeds.SyncNodeInfo() diff --git a/core/scripts/go.mod b/core/scripts/go.mod index 6094343ad4b..72bbcfcf04b 100644 --- a/core/scripts/go.mod +++ b/core/scripts/go.mod @@ -346,7 +346,7 @@ require ( github.com/smartcontractkit/chainlink-framework/chains v0.0.0-20250207205350-420ccacab78a // indirect github.com/smartcontractkit/chainlink-framework/multinode v0.0.0-20250211162441-3d6cea220efb // indirect github.com/smartcontractkit/chainlink-protos/job-distributor v0.9.0 // indirect - github.com/smartcontractkit/chainlink-protos/orchestrator v0.4.0 // indirect + github.com/smartcontractkit/chainlink-protos/orchestrator v0.5.0 // indirect github.com/smartcontractkit/chainlink-protos/rmn/v1.6/go v0.0.0-20250131130834-15e0d4cde2a6 // indirect github.com/smartcontractkit/chainlink-protos/svr v0.0.0-20250123084029-58cce9b32112 // indirect github.com/smartcontractkit/chainlink-solana v1.1.2-0.20250213203720-e15b1333a14a // indirect diff --git a/core/scripts/go.sum b/core/scripts/go.sum index a35215ab7bd..c1a570007be 100644 --- a/core/scripts/go.sum +++ b/core/scripts/go.sum @@ -1107,8 +1107,8 @@ github.com/smartcontractkit/chainlink-integrations/evm v0.0.0-20250213145514-41d github.com/smartcontractkit/chainlink-integrations/evm v0.0.0-20250213145514-41d874782c02/go.mod h1:7DbPnG0E39eZaX1CXKxRiJ1NOWHwTZYDWR9ys3kZZuU= github.com/smartcontractkit/chainlink-protos/job-distributor v0.9.0 h1:hfMRj2ny6oNHd8w1rhJHdoX3YkoWJtCkBK6wTlCE4+c= github.com/smartcontractkit/chainlink-protos/job-distributor v0.9.0/go.mod h1:/dVVLXrsp+V0AbcYGJo3XMzKg3CkELsweA/TTopCsKE= -github.com/smartcontractkit/chainlink-protos/orchestrator v0.4.0 h1:ZBat8EBvE2LpSQR9U1gEbRV6PfAkiFdINmQ8nVnXIAQ= -github.com/smartcontractkit/chainlink-protos/orchestrator v0.4.0/go.mod h1:m/A3lqD7ms/RsQ9BT5P2uceYY0QX5mIt4KQxT2G6qEo= +github.com/smartcontractkit/chainlink-protos/orchestrator v0.5.0 h1:xRgu/kMkxcY4LeDKMBhaXU4khgya7v2wyb4Sa5Nzb+Y= +github.com/smartcontractkit/chainlink-protos/orchestrator v0.5.0/go.mod h1:m/A3lqD7ms/RsQ9BT5P2uceYY0QX5mIt4KQxT2G6qEo= github.com/smartcontractkit/chainlink-protos/rmn/v1.6/go v0.0.0-20250131130834-15e0d4cde2a6 h1:L6KJ4kGv/yNNoCk8affk7Y1vAY0qglPMXC/hevV/IsA= github.com/smartcontractkit/chainlink-protos/rmn/v1.6/go v0.0.0-20250131130834-15e0d4cde2a6/go.mod h1:FRwzI3hGj4CJclNS733gfcffmqQ62ONCkbGi49s658w= github.com/smartcontractkit/chainlink-protos/svr v0.0.0-20250123084029-58cce9b32112 h1:c77Gi/APraqwbBO8fbd/5JY2wW+MSIpYg8Uma9MEZFE= diff --git a/core/services/feeds/service.go b/core/services/feeds/service.go index 99bbb2e0cbb..06c964130cf 100644 --- a/core/services/feeds/service.go +++ b/core/services/feeds/service.go @@ -5,7 +5,11 @@ import ( "database/sql" "encoding/hex" "fmt" + "strings" + "sync" + "time" + "github.com/avast/retry-go/v4" "github.com/ethereum/go-ethereum/common" "github.com/google/uuid" "github.com/lib/pq" @@ -77,6 +81,10 @@ var ( // Job Proposal status "status", }) + + defaultSyncMinDelay = 10 * time.Second + defaultSyncMaxDelay = 30 * time.Minute + defaultSyncMaxAttempts = uint(48 + 8) // 30m * 48 =~ 24h; plus the initial 8 shorter retries ) // Service represents a behavior of the feeds service @@ -142,6 +150,10 @@ type service struct { lggr logger.Logger version string loopRegistrarConfig plugins.RegistrarConfig + syncNodeInfoCancel atomicCancelFns + syncMinDelay time.Duration + syncMaxDelay time.Duration + syncMaxAttempts uint } // NewService constructs a new feeds service @@ -161,6 +173,7 @@ func NewService( lggr logger.Logger, version string, rc plugins.RegistrarConfig, + opts ...ServiceOption, ) *service { lggr = lggr.Named("Feeds") svc := &service{ @@ -184,6 +197,14 @@ func NewService( lggr: lggr, version: version, loopRegistrarConfig: rc, + syncNodeInfoCancel: atomicCancelFns{fns: map[int64]context.CancelFunc{}}, + syncMinDelay: defaultSyncMinDelay, + syncMaxDelay: defaultSyncMaxDelay, + syncMaxAttempts: defaultSyncMaxAttempts, + } + + for _, opt := range opts { + opt(svc) } return svc @@ -255,8 +276,43 @@ func (s *service) RegisterManager(ctx context.Context, params RegisterManagerPar return id, nil } -// SyncNodeInfo syncs the node's information with FMS +// syncNodeInfoWithRetry syncs the node's information with FMS. In case of failures, +// it retries with an exponential backoff for up to 24h. +func (s *service) syncNodeInfoWithRetry(id int64) { + ctx, cancel := context.WithCancel(context.Background()) + + // cancel the previous context -- and, by extension, the existing goroutine -- + // so that we can start anew + s.syncNodeInfoCancel.callAndSwap(id, cancel) + + retryOpts := []retry.Option{ + retry.Context(ctx), + retry.DelayType(retry.BackOffDelay), + retry.Delay(s.syncMinDelay), + retry.MaxDelay(s.syncMaxDelay), + retry.Attempts(s.syncMaxAttempts), + retry.LastErrorOnly(true), + retry.OnRetry(func(attempt uint, err error) { + s.lggr.Infow("failed to sync node info", "attempt", attempt, "err", err.Error()) + }), + } + + go func() { + err := retry.Do(func() error { return s.SyncNodeInfo(ctx, id) }, retryOpts...) + if err != nil { + s.lggr.Errorw("failed to sync node info; aborting", "err", err) + } else { + s.lggr.Info("successfully synced node info") + } + + s.syncNodeInfoCancel.callAndSwap(id, nil) + }() +} + func (s *service) SyncNodeInfo(ctx context.Context, id int64) error { + ctx, cancel := context.WithTimeout(ctx, 30*time.Second) + defer cancel() + // Get the FMS RPC client fmsClient, err := s.connMgr.GetClient(id) if err != nil { @@ -281,12 +337,22 @@ func (s *service) SyncNodeInfo(ctx context.Context, id int64) error { } workflowKey := s.getWorkflowPublicKey() - if _, err = fmsClient.UpdateNode(ctx, &pb.UpdateNodeRequest{ + + resp, err := fmsClient.UpdateNode(ctx, &pb.UpdateNodeRequest{ Version: s.version, ChainConfigs: cfgMsgs, WorkflowKey: &workflowKey, - }); err != nil { - return err + }) + if err != nil { + return errors.Wrap(err, "SyncNodeInfo.UpdateNode call failed") + } + if len(resp.ChainConfigErrors) > 0 { + errMsgs := make([]string, 0, len(resp.ChainConfigErrors)) + for _, ccErr := range resp.ChainConfigErrors { + errMsgs = append(errMsgs, ccErr.Message) + } + + return errors.Errorf("SyncNodeInfo.UpdateNode call partially failed: %s", strings.Join(errMsgs, "; ")) } return nil @@ -402,9 +468,7 @@ func (s *service) CreateChainConfig(ctx context.Context, cfg ChainConfig) (int64 return 0, errors.Wrap(err, "CreateChainConfig: failed to fetch manager") } - if err := s.SyncNodeInfo(ctx, mgr.ID); err != nil { - s.lggr.Infof("FMS: Unable to sync node info: %v", err) - } + s.syncNodeInfoWithRetry(mgr.ID) return id, nil } @@ -426,9 +490,7 @@ func (s *service) DeleteChainConfig(ctx context.Context, id int64) (int64, error return 0, errors.Wrap(err, "DeleteChainConfig: failed to fetch manager") } - if err := s.SyncNodeInfo(ctx, mgr.ID); err != nil { - s.lggr.Infof("FMS: Unable to sync node info: %v", err) - } + s.syncNodeInfoWithRetry(mgr.ID) return id, nil } @@ -467,9 +529,7 @@ func (s *service) UpdateChainConfig(ctx context.Context, cfg ChainConfig) (int64 return 0, errors.Wrap(err, "UpdateChainConfig failed: could not get chain config") } - if err := s.SyncNodeInfo(ctx, ccfg.FeedsManagerID); err != nil { - s.lggr.Infof("FMS: Unable to sync node info: %v", err) - } + s.syncNodeInfoWithRetry(ccfg.FeedsManagerID) return id, nil } @@ -1031,9 +1091,7 @@ func (s *service) CancelSpec(ctx context.Context, id int64) error { ) err = s.transact(ctx, func(tx datasources) error { - var ( - txerr error - ) + var txerr error if txerr = tx.orm.CancelSpec(ctx, id); txerr != nil { return txerr @@ -1153,6 +1211,8 @@ func (s *service) Start(ctx context.Context) error { // Close shuts down the service func (s *service) Close() error { return s.StopOnce("FeedsService", func() error { + s.syncNodeInfoCancel.callAllAndClear() + // This blocks until it finishes s.connMgr.Close() @@ -1173,10 +1233,7 @@ func (s *service) connectFeedManager(ctx context.Context, mgr FeedsManager, priv }, OnConnect: func(pb.FeedsManagerClient) { // Sync the node's information with FMS once connected - err := s.SyncNodeInfo(ctx, mgr.ID) - if err != nil { - s.lggr.Infof("Error syncing node info: %v", err) - } + s.syncNodeInfoWithRetry(mgr.ID) }, }) } @@ -1220,8 +1277,10 @@ func (s *service) observeJobProposalCounts(ctx context.Context) error { metrics := counts.toMetrics() // Set the prometheus gauge metrics. - for _, status := range []JobProposalStatus{JobProposalStatusPending, JobProposalStatusApproved, - JobProposalStatusCancelled, JobProposalStatusRejected, JobProposalStatusDeleted, JobProposalStatusRevoked} { + for _, status := range []JobProposalStatus{ + JobProposalStatusPending, JobProposalStatusApproved, + JobProposalStatusCancelled, JobProposalStatusRejected, JobProposalStatusDeleted, JobProposalStatusRevoked, + } { status := status promJobProposalCounts.With(prometheus.Labels{"status": string(status)}).Set(metrics[status]) @@ -1565,6 +1624,49 @@ func (s *service) isRevokable(propStatus JobProposalStatus, specStatus SpecStatu return propStatus != JobProposalStatusDeleted && (specStatus == SpecStatusPending || specStatus == SpecStatusCancelled) } +type atomicCancelFns struct { + fns map[int64]context.CancelFunc + mutex sync.Mutex +} + +func (f *atomicCancelFns) callAndSwap(id int64, other func()) { + f.mutex.Lock() + defer f.mutex.Unlock() + + fn, found := f.fns[id] + if found && fn != nil { + fn() + } + + f.fns[id] = other +} + +func (f *atomicCancelFns) callAllAndClear() { + f.mutex.Lock() + defer f.mutex.Unlock() + + for _, fn := range f.fns { + if fn != nil { + fn() + } + } + clear(f.fns) +} + +type ServiceOption func(*service) + +func WithSyncMinDelay(delay time.Duration) ServiceOption { + return func(s *service) { s.syncMinDelay = delay } +} + +func WithSyncMaxDelay(delay time.Duration) ServiceOption { + return func(s *service) { s.syncMaxDelay = delay } +} + +func WithSyncMaxAttempts(attempts uint) ServiceOption { + return func(s *service) { s.syncMaxAttempts = attempts } +} + var _ Service = &NullService{} // NullService defines an implementation of the Feeds Service that is used @@ -1577,24 +1679,31 @@ func (ns NullService) Close() error { return nil } func (ns NullService) ApproveSpec(ctx context.Context, id int64, force bool) error { return ErrFeedsManagerDisabled } + func (ns NullService) CountJobProposalsByStatus(ctx context.Context) (*JobProposalCounts, error) { return nil, ErrFeedsManagerDisabled } + func (ns NullService) CancelSpec(ctx context.Context, id int64) error { return ErrFeedsManagerDisabled } + func (ns NullService) GetJobProposal(ctx context.Context, id int64) (*JobProposal, error) { return nil, ErrFeedsManagerDisabled } + func (ns NullService) ListSpecsByJobProposalIDs(ctx context.Context, ids []int64) ([]JobProposalSpec, error) { return nil, ErrFeedsManagerDisabled } + func (ns NullService) GetManager(ctx context.Context, id int64) (*FeedsManager, error) { return nil, ErrFeedsManagerDisabled } + func (ns NullService) ListManagersByIDs(ctx context.Context, ids []int64) ([]FeedsManager, error) { return nil, ErrFeedsManagerDisabled } + func (ns NullService) GetSpec(ctx context.Context, id int64) (*JobProposalSpec, error) { return nil, ErrFeedsManagerDisabled } @@ -1602,15 +1711,19 @@ func (ns NullService) ListManagers(ctx context.Context) ([]FeedsManager, error) func (ns NullService) CreateChainConfig(ctx context.Context, cfg ChainConfig) (int64, error) { return 0, ErrFeedsManagerDisabled } + func (ns NullService) GetChainConfig(ctx context.Context, id int64) (*ChainConfig, error) { return nil, ErrFeedsManagerDisabled } + func (ns NullService) DeleteChainConfig(ctx context.Context, id int64) (int64, error) { return 0, ErrFeedsManagerDisabled } + func (ns NullService) ListChainConfigsByManagerIDs(ctx context.Context, mgrIDs []int64) ([]ChainConfig, error) { return nil, ErrFeedsManagerDisabled } + func (ns NullService) UpdateChainConfig(ctx context.Context, cfg ChainConfig) (int64, error) { return 0, ErrFeedsManagerDisabled } @@ -1618,18 +1731,23 @@ func (ns NullService) ListJobProposals(ctx context.Context) ([]JobProposal, erro func (ns NullService) ListJobProposalsByManagersIDs(ctx context.Context, ids []int64) ([]JobProposal, error) { return nil, ErrFeedsManagerDisabled } + func (ns NullService) ProposeJob(ctx context.Context, args *ProposeJobArgs) (int64, error) { return 0, ErrFeedsManagerDisabled } + func (ns NullService) DeleteJob(ctx context.Context, args *DeleteJobArgs) (int64, error) { return 0, ErrFeedsManagerDisabled } + func (ns NullService) RevokeJob(ctx context.Context, args *RevokeJobArgs) (int64, error) { return 0, ErrFeedsManagerDisabled } + func (ns NullService) RegisterManager(ctx context.Context, params RegisterManagerParams) (int64, error) { return 0, ErrFeedsManagerDisabled } + func (ns NullService) RejectSpec(ctx context.Context, id int64) error { return ErrFeedsManagerDisabled } @@ -1637,15 +1755,19 @@ func (ns NullService) SyncNodeInfo(ctx context.Context, id int64) error { return func (ns NullService) UpdateManager(ctx context.Context, mgr FeedsManager) error { return ErrFeedsManagerDisabled } + func (ns NullService) EnableManager(ctx context.Context, id int64) (*FeedsManager, error) { return nil, ErrFeedsManagerDisabled } + func (ns NullService) DisableManager(ctx context.Context, id int64) (*FeedsManager, error) { return nil, ErrFeedsManagerDisabled } + func (ns NullService) IsJobManaged(ctx context.Context, jobID int64) (bool, error) { return false, nil } + func (ns NullService) UpdateSpecDefinition(ctx context.Context, id int64, spec string) error { return ErrFeedsManagerDisabled } diff --git a/core/services/feeds/service_test.go b/core/services/feeds/service_test.go index ce0e933df49..1cf14b00ef5 100644 --- a/core/services/feeds/service_test.go +++ b/core/services/feeds/service_test.go @@ -5,7 +5,9 @@ import ( "database/sql" "encoding/hex" "fmt" + "maps" "math/big" + "slices" "testing" "time" @@ -16,6 +18,8 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" + "go.uber.org/zap" + "go.uber.org/zap/zaptest/observer" "gopkg.in/guregu/null.v4" commonconfig "github.com/smartcontractkit/chainlink-common/pkg/config" @@ -196,15 +200,18 @@ type TestService struct { ocr2Keystore *ksmocks.OCR2 workflowKeystore *ksmocks.Workflow legacyChains legacyevm.LegacyChainContainer + logs *observer.ObservedLogs } -func setupTestService(t *testing.T) *TestService { +func setupTestService(t *testing.T, opts ...feeds.ServiceOption) *TestService { t.Helper() - return setupTestServiceCfg(t, nil) + return setupTestServiceCfg(t, nil, opts...) } -func setupTestServiceCfg(t *testing.T, overrideCfg func(c *chainlink.Config, s *chainlink.Secrets)) *TestService { +func setupTestServiceCfg( + t *testing.T, overrideCfg func(c *chainlink.Config, s *chainlink.Secrets), opts ...feeds.ServiceOption, +) *TestService { t.Helper() var ( @@ -220,7 +227,7 @@ func setupTestServiceCfg(t *testing.T, overrideCfg func(c *chainlink.Config, s * workflowKeystore = ksmocks.NewWorkflow(t) ) - lggr := logger.TestLogger(t) + lggr, observedLogs := logger.TestLoggerObserved(t, zap.DebugLevel) db := pgtest.NewSqlxDB(t) gcfg := configtest.NewGeneralConfig(t, overrideCfg) @@ -241,7 +248,8 @@ func setupTestServiceCfg(t *testing.T, overrideCfg func(c *chainlink.Config, s * keyStore.On("OCR").Return(ocr1Keystore) keyStore.On("OCR2").Return(ocr2Keystore) keyStore.On("Workflow").Return(workflowKeystore) - svc := feeds.NewService(orm, jobORM, db, spawner, keyStore, gcfg, gcfg.Feature(), gcfg.Insecure(), gcfg.JobPipeline(), gcfg.OCR(), gcfg.OCR2(), legacyChains, lggr, "1.0.0", nil) + svc := feeds.NewService(orm, jobORM, db, spawner, keyStore, gcfg, gcfg.Feature(), gcfg.Insecure(), + gcfg.JobPipeline(), gcfg.OCR(), gcfg.OCR2(), legacyChains, lggr, "1.0.0", nil, opts...) svc.SetConnectionsManager(connMgr) return &TestService{ @@ -257,6 +265,7 @@ func setupTestServiceCfg(t *testing.T, overrideCfg func(c *chainlink.Config, s * ocr2Keystore: ocr2Keystore, workflowKeystore: workflowKeystore, legacyChains: legacyChains, + logs: observedLogs, } } @@ -1856,6 +1865,170 @@ func Test_Service_SyncNodeInfo(t *testing.T) { } } +func Test_Service_syncNodeInfoWithRetry(t *testing.T) { + t.Parallel() + + mgr := feeds.FeedsManager{ID: 1} + nodeVersion := &versioning.NodeVersion{Version: "1.0.0"} + cfg := feeds.ChainConfig{ + FeedsManagerID: mgr.ID, + ChainID: "42", + ChainType: feeds.ChainTypeEVM, + AccountAddress: "0x0000000000000000000000000000000000000000", + AccountAddressPublicKey: null.StringFrom("0x0000000000000000000000000000000000000002"), + AdminAddress: "0x0000000000000000000000000000000000000001", + FluxMonitorConfig: feeds.FluxMonitorConfig{Enabled: true}, + OCR1Config: feeds.OCR1Config{Enabled: false}, + OCR2Config: feeds.OCR2ConfigModel{Enabled: false}, + } + workflowKey, err := workflowkey.New() + require.NoError(t, err) + + request := &proto.UpdateNodeRequest{ + Version: nodeVersion.Version, + ChainConfigs: []*proto.ChainConfig{ + { + Chain: &proto.Chain{ + Id: cfg.ChainID, + Type: proto.ChainType_CHAIN_TYPE_EVM, + }, + AccountAddress: cfg.AccountAddress, + AccountAddressPublicKey: &cfg.AccountAddressPublicKey.String, + AdminAddress: cfg.AdminAddress, + FluxMonitorConfig: &proto.FluxMonitorConfig{Enabled: true}, + Ocr1Config: &proto.OCR1Config{Enabled: false}, + Ocr2Config: &proto.OCR2Config{Enabled: false}, + }, + }, + WorkflowKey: func(s string) *string { return &s }(workflowKey.ID()), + } + successResponse := &proto.UpdateNodeResponse{ChainConfigErrors: map[string]*proto.ChainConfigError{}} + failureResponse := func(chainID string) *proto.UpdateNodeResponse { + return &proto.UpdateNodeResponse{ + ChainConfigErrors: map[string]*proto.ChainConfigError{chainID: {Message: "error chain " + chainID}}, + } + } + + tests := []struct { + name string + setup func(t *testing.T, svc *TestService) + run func(svc *TestService) (any, error) + wantLogs []string + }{ + { + name: "create chain", + setup: func(t *testing.T, svc *TestService) { + svc.workflowKeystore.EXPECT().GetAll().Return([]workflowkey.Key{workflowKey}, nil) + svc.orm.EXPECT().CreateChainConfig(mock.Anything, cfg).Return(int64(1), nil) + svc.orm.EXPECT().GetManager(mock.Anything, mgr.ID).Return(&mgr, nil) + svc.orm.EXPECT().ListChainConfigsByManagerIDs(mock.Anything, []int64{mgr.ID}).Return([]feeds.ChainConfig{cfg}, nil) + svc.connMgr.EXPECT().GetClient(mgr.ID).Return(svc.fmsClient, nil) + svc.fmsClient.EXPECT().UpdateNode(mock.Anything, request).Return(nil, errors.New("error-0")).Once() + svc.fmsClient.EXPECT().UpdateNode(mock.Anything, request).Return(failureResponse("1"), nil).Once() + svc.fmsClient.EXPECT().UpdateNode(mock.Anything, request).Return(failureResponse("2"), nil).Once() + svc.fmsClient.EXPECT().UpdateNode(mock.Anything, request).Return(successResponse, nil).Once() + }, + run: func(svc *TestService) (any, error) { + return svc.CreateChainConfig(testutils.Context(t), cfg) + }, + wantLogs: []string{ + `failed to sync node info attempt="0" err="SyncNodeInfo.UpdateNode call failed: error-0"`, + `failed to sync node info attempt="1" err="SyncNodeInfo.UpdateNode call partially failed: error chain 1"`, + `failed to sync node info attempt="2" err="SyncNodeInfo.UpdateNode call partially failed: error chain 2"`, + `successfully synced node info`, + }, + }, + { + name: "update chain", + setup: func(t *testing.T, svc *TestService) { + svc.workflowKeystore.EXPECT().GetAll().Return([]workflowkey.Key{workflowKey}, nil) + svc.orm.EXPECT().UpdateChainConfig(mock.Anything, cfg).Return(int64(1), nil) + svc.orm.EXPECT().GetChainConfig(mock.Anything, cfg.ID).Return(&cfg, nil) + svc.orm.EXPECT().ListChainConfigsByManagerIDs(mock.Anything, []int64{mgr.ID}).Return([]feeds.ChainConfig{cfg}, nil) + svc.connMgr.EXPECT().GetClient(mgr.ID).Return(svc.fmsClient, nil) + svc.fmsClient.EXPECT().UpdateNode(mock.Anything, request).Return(failureResponse("3"), nil).Once() + svc.fmsClient.EXPECT().UpdateNode(mock.Anything, request).Return(nil, errors.New("error-4")).Once() + svc.fmsClient.EXPECT().UpdateNode(mock.Anything, request).Return(failureResponse("5"), nil).Once() + svc.fmsClient.EXPECT().UpdateNode(mock.Anything, request).Return(successResponse, nil).Once() + }, + run: func(svc *TestService) (any, error) { + return svc.UpdateChainConfig(testutils.Context(t), cfg) + }, + wantLogs: []string{ + `failed to sync node info attempt="0" err="SyncNodeInfo.UpdateNode call partially failed: error chain 3"`, + `failed to sync node info attempt="1" err="SyncNodeInfo.UpdateNode call failed: error-4"`, + `failed to sync node info attempt="2" err="SyncNodeInfo.UpdateNode call partially failed: error chain 5"`, + `successfully synced node info`, + }, + }, + { + name: "delete chain", + setup: func(t *testing.T, svc *TestService) { + svc.workflowKeystore.EXPECT().GetAll().Return([]workflowkey.Key{workflowKey}, nil) + svc.orm.EXPECT().GetChainConfig(mock.Anything, cfg.ID).Return(&cfg, nil) + svc.orm.EXPECT().DeleteChainConfig(mock.Anything, cfg.ID).Return(cfg.ID, nil) + svc.orm.EXPECT().GetManager(mock.Anything, mgr.ID).Return(&mgr, nil) + svc.orm.EXPECT().ListChainConfigsByManagerIDs(mock.Anything, []int64{mgr.ID}).Return([]feeds.ChainConfig{cfg}, nil) + svc.connMgr.EXPECT().GetClient(mgr.ID).Return(svc.fmsClient, nil) + svc.fmsClient.EXPECT().UpdateNode(mock.Anything, request).Return(failureResponse("6"), nil).Once() + svc.fmsClient.EXPECT().UpdateNode(mock.Anything, request).Return(failureResponse("7"), nil).Once() + svc.fmsClient.EXPECT().UpdateNode(mock.Anything, request).Return(nil, errors.New("error-8")).Once() + svc.fmsClient.EXPECT().UpdateNode(mock.Anything, request).Return(successResponse, nil).Once() + }, + run: func(svc *TestService) (any, error) { + return svc.DeleteChainConfig(testutils.Context(t), cfg.ID) + }, + wantLogs: []string{ + `failed to sync node info attempt="0" err="SyncNodeInfo.UpdateNode call partially failed: error chain 6"`, + `failed to sync node info attempt="1" err="SyncNodeInfo.UpdateNode call partially failed: error chain 7"`, + `failed to sync node info attempt="2" err="SyncNodeInfo.UpdateNode call failed: error-8"`, + `successfully synced node info`, + }, + }, + { + name: "more errors than MaxAttempts", + setup: func(t *testing.T, svc *TestService) { + svc.workflowKeystore.EXPECT().GetAll().Return([]workflowkey.Key{workflowKey}, nil) + svc.orm.EXPECT().CreateChainConfig(mock.Anything, cfg).Return(int64(1), nil) + svc.orm.EXPECT().GetManager(mock.Anything, mgr.ID).Return(&mgr, nil) + svc.orm.EXPECT().ListChainConfigsByManagerIDs(mock.Anything, []int64{mgr.ID}).Return([]feeds.ChainConfig{cfg}, nil) + svc.connMgr.EXPECT().GetClient(mgr.ID).Return(svc.fmsClient, nil) + svc.fmsClient.EXPECT().UpdateNode(mock.Anything, request).Return(failureResponse("9"), nil).Once() + svc.fmsClient.EXPECT().UpdateNode(mock.Anything, request).Return(failureResponse("10"), nil).Once() + svc.fmsClient.EXPECT().UpdateNode(mock.Anything, request).Return(nil, errors.New("error-11")).Once() + svc.fmsClient.EXPECT().UpdateNode(mock.Anything, request).Return(failureResponse("12"), nil).Once() + }, + run: func(svc *TestService) (any, error) { + return svc.CreateChainConfig(testutils.Context(t), cfg) + }, + wantLogs: []string{ + `failed to sync node info attempt="0" err="SyncNodeInfo.UpdateNode call partially failed: error chain 9"`, + `failed to sync node info attempt="1" err="SyncNodeInfo.UpdateNode call partially failed: error chain 10"`, + `failed to sync node info attempt="2" err="SyncNodeInfo.UpdateNode call failed: error-11"`, + `failed to sync node info attempt="3" err="SyncNodeInfo.UpdateNode call partially failed: error chain 12"`, + `failed to sync node info; aborting err="SyncNodeInfo.UpdateNode call partially failed: error chain 12"`, + }, + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + t.Parallel() + + svc := setupTestService(t, feeds.WithSyncMinDelay(5*time.Millisecond), + feeds.WithSyncMaxDelay(50*time.Millisecond), feeds.WithSyncMaxAttempts(4)) + + tt.setup(t, svc) + _, err := tt.run(svc) + + require.NoError(t, err) + assert.EventuallyWithT(t, func(collect *assert.CollectT) { + assert.Equal(collect, tt.wantLogs, logMessages(svc.logs.All())) + }, 1*time.Second, 50*time.Millisecond) + }) + } +} + func Test_Service_IsJobManaged(t *testing.T) { t.Parallel() @@ -4751,3 +4924,21 @@ func Test_Service_StartStop(t *testing.T) { }) } } + +func logMessages(logEntries []observer.LoggedEntry) []string { + messages := make([]string, 0, len(logEntries)) + for _, entry := range logEntries { + messageWithContext := entry.Message + contextMap := entry.ContextMap() + for _, key := range slices.Sorted(maps.Keys(contextMap)) { + if key == "version" || key == "errVerbose" { + continue + } + messageWithContext += fmt.Sprintf(" %v=\"%v\"", key, entry.ContextMap()[key]) + } + + messages = append(messages, messageWithContext) + } + + return messages +} diff --git a/deployment/go.mod b/deployment/go.mod index 861b7e8515e..b89112f0083 100644 --- a/deployment/go.mod +++ b/deployment/go.mod @@ -358,7 +358,7 @@ require ( github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20250224190032-809e4b8cf29e // indirect github.com/smartcontractkit/chainlink-feeds v0.1.1 // indirect github.com/smartcontractkit/chainlink-framework/chains v0.0.0-20250207205350-420ccacab78a // indirect - github.com/smartcontractkit/chainlink-protos/orchestrator v0.4.0 // indirect + github.com/smartcontractkit/chainlink-protos/orchestrator v0.5.0 // indirect github.com/smartcontractkit/chainlink-protos/rmn/v1.6/go v0.0.0-20250131130834-15e0d4cde2a6 // indirect github.com/smartcontractkit/chainlink-protos/svr v0.0.0-20250123084029-58cce9b32112 // indirect github.com/smartcontractkit/chainlink-testing-framework/seth v1.50.10 // indirect diff --git a/deployment/go.sum b/deployment/go.sum index 008a81c31c9..d826718379e 100644 --- a/deployment/go.sum +++ b/deployment/go.sum @@ -1154,8 +1154,8 @@ github.com/smartcontractkit/chainlink-integrations/evm v0.0.0-20250213145514-41d github.com/smartcontractkit/chainlink-integrations/evm v0.0.0-20250213145514-41d874782c02/go.mod h1:7DbPnG0E39eZaX1CXKxRiJ1NOWHwTZYDWR9ys3kZZuU= github.com/smartcontractkit/chainlink-protos/job-distributor v0.9.0 h1:hfMRj2ny6oNHd8w1rhJHdoX3YkoWJtCkBK6wTlCE4+c= github.com/smartcontractkit/chainlink-protos/job-distributor v0.9.0/go.mod h1:/dVVLXrsp+V0AbcYGJo3XMzKg3CkELsweA/TTopCsKE= -github.com/smartcontractkit/chainlink-protos/orchestrator v0.4.0 h1:ZBat8EBvE2LpSQR9U1gEbRV6PfAkiFdINmQ8nVnXIAQ= -github.com/smartcontractkit/chainlink-protos/orchestrator v0.4.0/go.mod h1:m/A3lqD7ms/RsQ9BT5P2uceYY0QX5mIt4KQxT2G6qEo= +github.com/smartcontractkit/chainlink-protos/orchestrator v0.5.0 h1:xRgu/kMkxcY4LeDKMBhaXU4khgya7v2wyb4Sa5Nzb+Y= +github.com/smartcontractkit/chainlink-protos/orchestrator v0.5.0/go.mod h1:m/A3lqD7ms/RsQ9BT5P2uceYY0QX5mIt4KQxT2G6qEo= github.com/smartcontractkit/chainlink-protos/rmn/v1.6/go v0.0.0-20250131130834-15e0d4cde2a6 h1:L6KJ4kGv/yNNoCk8affk7Y1vAY0qglPMXC/hevV/IsA= github.com/smartcontractkit/chainlink-protos/rmn/v1.6/go v0.0.0-20250131130834-15e0d4cde2a6/go.mod h1:FRwzI3hGj4CJclNS733gfcffmqQ62ONCkbGi49s658w= github.com/smartcontractkit/chainlink-protos/svr v0.0.0-20250123084029-58cce9b32112 h1:c77Gi/APraqwbBO8fbd/5JY2wW+MSIpYg8Uma9MEZFE= diff --git a/go.mod b/go.mod index 91839a87219..c3b52661302 100644 --- a/go.mod +++ b/go.mod @@ -86,7 +86,7 @@ require ( github.com/smartcontractkit/chainlink-framework/chains v0.0.0-20250207205350-420ccacab78a github.com/smartcontractkit/chainlink-framework/multinode v0.0.0-20250211162441-3d6cea220efb github.com/smartcontractkit/chainlink-integrations/evm v0.0.0-20250213145514-41d874782c02 - github.com/smartcontractkit/chainlink-protos/orchestrator v0.4.0 + github.com/smartcontractkit/chainlink-protos/orchestrator v0.5.0 github.com/smartcontractkit/chainlink-solana v1.1.2-0.20250213203720-e15b1333a14a github.com/smartcontractkit/libocr v0.0.0-20250220133800-f3b940c4f298 github.com/smartcontractkit/tdh2/go/ocr2/decryptionplugin v0.0.0-20241009055228-33d0c0bf38de diff --git a/go.sum b/go.sum index 441c8b933ec..6860ae1bdcb 100644 --- a/go.sum +++ b/go.sum @@ -1032,8 +1032,8 @@ github.com/smartcontractkit/chainlink-framework/multinode v0.0.0-20250211162441- github.com/smartcontractkit/chainlink-framework/multinode v0.0.0-20250211162441-3d6cea220efb/go.mod h1:4JqpgFy01LaqG1yM2iFTzwX3ZgcAvW9WdstBZQgPHzU= github.com/smartcontractkit/chainlink-integrations/evm v0.0.0-20250213145514-41d874782c02 h1:3icYNFldKQbs6Qrfai2LE+tKbNcE4tfgPRELF30mnEA= github.com/smartcontractkit/chainlink-integrations/evm v0.0.0-20250213145514-41d874782c02/go.mod h1:7DbPnG0E39eZaX1CXKxRiJ1NOWHwTZYDWR9ys3kZZuU= -github.com/smartcontractkit/chainlink-protos/orchestrator v0.4.0 h1:ZBat8EBvE2LpSQR9U1gEbRV6PfAkiFdINmQ8nVnXIAQ= -github.com/smartcontractkit/chainlink-protos/orchestrator v0.4.0/go.mod h1:m/A3lqD7ms/RsQ9BT5P2uceYY0QX5mIt4KQxT2G6qEo= +github.com/smartcontractkit/chainlink-protos/orchestrator v0.5.0 h1:xRgu/kMkxcY4LeDKMBhaXU4khgya7v2wyb4Sa5Nzb+Y= +github.com/smartcontractkit/chainlink-protos/orchestrator v0.5.0/go.mod h1:m/A3lqD7ms/RsQ9BT5P2uceYY0QX5mIt4KQxT2G6qEo= github.com/smartcontractkit/chainlink-protos/rmn/v1.6/go v0.0.0-20250131130834-15e0d4cde2a6 h1:L6KJ4kGv/yNNoCk8affk7Y1vAY0qglPMXC/hevV/IsA= github.com/smartcontractkit/chainlink-protos/rmn/v1.6/go v0.0.0-20250131130834-15e0d4cde2a6/go.mod h1:FRwzI3hGj4CJclNS733gfcffmqQ62ONCkbGi49s658w= github.com/smartcontractkit/chainlink-protos/svr v0.0.0-20250123084029-58cce9b32112 h1:c77Gi/APraqwbBO8fbd/5JY2wW+MSIpYg8Uma9MEZFE= diff --git a/integration-tests/go.mod b/integration-tests/go.mod index 02a22943d6b..df5ffad26d9 100644 --- a/integration-tests/go.mod +++ b/integration-tests/go.mod @@ -444,7 +444,7 @@ require ( github.com/smartcontractkit/chainlink-feeds v0.1.1 // indirect github.com/smartcontractkit/chainlink-framework/chains v0.0.0-20250207205350-420ccacab78a // indirect github.com/smartcontractkit/chainlink-framework/multinode v0.0.0-20250211162441-3d6cea220efb // indirect - github.com/smartcontractkit/chainlink-protos/orchestrator v0.4.0 // indirect + github.com/smartcontractkit/chainlink-protos/orchestrator v0.5.0 // indirect github.com/smartcontractkit/chainlink-protos/rmn/v1.6/go v0.0.0-20250131130834-15e0d4cde2a6 // indirect github.com/smartcontractkit/chainlink-protos/svr v0.0.0-20250123084029-58cce9b32112 // indirect github.com/smartcontractkit/chainlink-solana v1.1.2-0.20250213203720-e15b1333a14a // indirect diff --git a/integration-tests/go.sum b/integration-tests/go.sum index e0ee69f9e01..b987c1228e9 100644 --- a/integration-tests/go.sum +++ b/integration-tests/go.sum @@ -1448,8 +1448,8 @@ github.com/smartcontractkit/chainlink-integrations/evm v0.0.0-20250213145514-41d github.com/smartcontractkit/chainlink-integrations/evm v0.0.0-20250213145514-41d874782c02/go.mod h1:7DbPnG0E39eZaX1CXKxRiJ1NOWHwTZYDWR9ys3kZZuU= github.com/smartcontractkit/chainlink-protos/job-distributor v0.9.0 h1:hfMRj2ny6oNHd8w1rhJHdoX3YkoWJtCkBK6wTlCE4+c= github.com/smartcontractkit/chainlink-protos/job-distributor v0.9.0/go.mod h1:/dVVLXrsp+V0AbcYGJo3XMzKg3CkELsweA/TTopCsKE= -github.com/smartcontractkit/chainlink-protos/orchestrator v0.4.0 h1:ZBat8EBvE2LpSQR9U1gEbRV6PfAkiFdINmQ8nVnXIAQ= -github.com/smartcontractkit/chainlink-protos/orchestrator v0.4.0/go.mod h1:m/A3lqD7ms/RsQ9BT5P2uceYY0QX5mIt4KQxT2G6qEo= +github.com/smartcontractkit/chainlink-protos/orchestrator v0.5.0 h1:xRgu/kMkxcY4LeDKMBhaXU4khgya7v2wyb4Sa5Nzb+Y= +github.com/smartcontractkit/chainlink-protos/orchestrator v0.5.0/go.mod h1:m/A3lqD7ms/RsQ9BT5P2uceYY0QX5mIt4KQxT2G6qEo= github.com/smartcontractkit/chainlink-protos/rmn/v1.6/go v0.0.0-20250131130834-15e0d4cde2a6 h1:L6KJ4kGv/yNNoCk8affk7Y1vAY0qglPMXC/hevV/IsA= github.com/smartcontractkit/chainlink-protos/rmn/v1.6/go v0.0.0-20250131130834-15e0d4cde2a6/go.mod h1:FRwzI3hGj4CJclNS733gfcffmqQ62ONCkbGi49s658w= github.com/smartcontractkit/chainlink-protos/svr v0.0.0-20250123084029-58cce9b32112 h1:c77Gi/APraqwbBO8fbd/5JY2wW+MSIpYg8Uma9MEZFE= diff --git a/integration-tests/load/go.mod b/integration-tests/load/go.mod index 587c30e4f31..850d608dfe5 100644 --- a/integration-tests/load/go.mod +++ b/integration-tests/load/go.mod @@ -435,7 +435,7 @@ require ( github.com/smartcontractkit/chainlink-framework/chains v0.0.0-20250207205350-420ccacab78a // indirect github.com/smartcontractkit/chainlink-framework/multinode v0.0.0-20250211162441-3d6cea220efb // indirect github.com/smartcontractkit/chainlink-protos/job-distributor v0.9.0 // indirect - github.com/smartcontractkit/chainlink-protos/orchestrator v0.4.0 // indirect + github.com/smartcontractkit/chainlink-protos/orchestrator v0.5.0 // indirect github.com/smartcontractkit/chainlink-protos/rmn/v1.6/go v0.0.0-20250131130834-15e0d4cde2a6 // indirect github.com/smartcontractkit/chainlink-protos/svr v0.0.0-20250123084029-58cce9b32112 // indirect github.com/smartcontractkit/chainlink-solana v1.1.2-0.20250213203720-e15b1333a14a // indirect diff --git a/integration-tests/load/go.sum b/integration-tests/load/go.sum index e3e3a07128c..65671427faa 100644 --- a/integration-tests/load/go.sum +++ b/integration-tests/load/go.sum @@ -1433,8 +1433,8 @@ github.com/smartcontractkit/chainlink-integrations/evm v0.0.0-20250213145514-41d github.com/smartcontractkit/chainlink-integrations/evm v0.0.0-20250213145514-41d874782c02/go.mod h1:7DbPnG0E39eZaX1CXKxRiJ1NOWHwTZYDWR9ys3kZZuU= github.com/smartcontractkit/chainlink-protos/job-distributor v0.9.0 h1:hfMRj2ny6oNHd8w1rhJHdoX3YkoWJtCkBK6wTlCE4+c= github.com/smartcontractkit/chainlink-protos/job-distributor v0.9.0/go.mod h1:/dVVLXrsp+V0AbcYGJo3XMzKg3CkELsweA/TTopCsKE= -github.com/smartcontractkit/chainlink-protos/orchestrator v0.4.0 h1:ZBat8EBvE2LpSQR9U1gEbRV6PfAkiFdINmQ8nVnXIAQ= -github.com/smartcontractkit/chainlink-protos/orchestrator v0.4.0/go.mod h1:m/A3lqD7ms/RsQ9BT5P2uceYY0QX5mIt4KQxT2G6qEo= +github.com/smartcontractkit/chainlink-protos/orchestrator v0.5.0 h1:xRgu/kMkxcY4LeDKMBhaXU4khgya7v2wyb4Sa5Nzb+Y= +github.com/smartcontractkit/chainlink-protos/orchestrator v0.5.0/go.mod h1:m/A3lqD7ms/RsQ9BT5P2uceYY0QX5mIt4KQxT2G6qEo= github.com/smartcontractkit/chainlink-protos/rmn/v1.6/go v0.0.0-20250131130834-15e0d4cde2a6 h1:L6KJ4kGv/yNNoCk8affk7Y1vAY0qglPMXC/hevV/IsA= github.com/smartcontractkit/chainlink-protos/rmn/v1.6/go v0.0.0-20250131130834-15e0d4cde2a6/go.mod h1:FRwzI3hGj4CJclNS733gfcffmqQ62ONCkbGi49s658w= github.com/smartcontractkit/chainlink-protos/svr v0.0.0-20250123084029-58cce9b32112 h1:c77Gi/APraqwbBO8fbd/5JY2wW+MSIpYg8Uma9MEZFE= diff --git a/system-tests/lib/go.mod b/system-tests/lib/go.mod index 526d92473e4..32efa110bf9 100644 --- a/system-tests/lib/go.mod +++ b/system-tests/lib/go.mod @@ -347,7 +347,7 @@ require ( github.com/smartcontractkit/chainlink-framework/chains v0.0.0-20250207205350-420ccacab78a // indirect github.com/smartcontractkit/chainlink-framework/multinode v0.0.0-20250211162441-3d6cea220efb // indirect github.com/smartcontractkit/chainlink-integrations/evm v0.0.0-20250213145514-41d874782c02 // indirect - github.com/smartcontractkit/chainlink-protos/orchestrator v0.4.0 // indirect + github.com/smartcontractkit/chainlink-protos/orchestrator v0.5.0 // indirect github.com/smartcontractkit/chainlink-protos/rmn/v1.6/go v0.0.0-20250131130834-15e0d4cde2a6 // indirect github.com/smartcontractkit/chainlink-protos/svr v0.0.0-20250123084029-58cce9b32112 // indirect github.com/smartcontractkit/chainlink-solana v1.1.2-0.20250213203720-e15b1333a14a // indirect diff --git a/system-tests/lib/go.sum b/system-tests/lib/go.sum index 83acbd61e21..64a9a9b9350 100644 --- a/system-tests/lib/go.sum +++ b/system-tests/lib/go.sum @@ -1142,8 +1142,8 @@ github.com/smartcontractkit/chainlink-integrations/evm v0.0.0-20250213145514-41d github.com/smartcontractkit/chainlink-integrations/evm v0.0.0-20250213145514-41d874782c02/go.mod h1:7DbPnG0E39eZaX1CXKxRiJ1NOWHwTZYDWR9ys3kZZuU= github.com/smartcontractkit/chainlink-protos/job-distributor v0.9.0 h1:hfMRj2ny6oNHd8w1rhJHdoX3YkoWJtCkBK6wTlCE4+c= github.com/smartcontractkit/chainlink-protos/job-distributor v0.9.0/go.mod h1:/dVVLXrsp+V0AbcYGJo3XMzKg3CkELsweA/TTopCsKE= -github.com/smartcontractkit/chainlink-protos/orchestrator v0.4.0 h1:ZBat8EBvE2LpSQR9U1gEbRV6PfAkiFdINmQ8nVnXIAQ= -github.com/smartcontractkit/chainlink-protos/orchestrator v0.4.0/go.mod h1:m/A3lqD7ms/RsQ9BT5P2uceYY0QX5mIt4KQxT2G6qEo= +github.com/smartcontractkit/chainlink-protos/orchestrator v0.5.0 h1:xRgu/kMkxcY4LeDKMBhaXU4khgya7v2wyb4Sa5Nzb+Y= +github.com/smartcontractkit/chainlink-protos/orchestrator v0.5.0/go.mod h1:m/A3lqD7ms/RsQ9BT5P2uceYY0QX5mIt4KQxT2G6qEo= github.com/smartcontractkit/chainlink-protos/rmn/v1.6/go v0.0.0-20250131130834-15e0d4cde2a6 h1:L6KJ4kGv/yNNoCk8affk7Y1vAY0qglPMXC/hevV/IsA= github.com/smartcontractkit/chainlink-protos/rmn/v1.6/go v0.0.0-20250131130834-15e0d4cde2a6/go.mod h1:FRwzI3hGj4CJclNS733gfcffmqQ62ONCkbGi49s658w= github.com/smartcontractkit/chainlink-protos/svr v0.0.0-20250123084029-58cce9b32112 h1:c77Gi/APraqwbBO8fbd/5JY2wW+MSIpYg8Uma9MEZFE= diff --git a/system-tests/tests/go.mod b/system-tests/tests/go.mod index 64c23415501..b7915ef440b 100644 --- a/system-tests/tests/go.mod +++ b/system-tests/tests/go.mod @@ -352,7 +352,7 @@ require ( github.com/smartcontractkit/chainlink-framework/multinode v0.0.0-20250211162441-3d6cea220efb // indirect github.com/smartcontractkit/chainlink-integrations/evm v0.0.0-20250213145514-41d874782c02 // indirect github.com/smartcontractkit/chainlink-protos/job-distributor v0.9.0 // indirect - github.com/smartcontractkit/chainlink-protos/orchestrator v0.4.0 // indirect + github.com/smartcontractkit/chainlink-protos/orchestrator v0.5.0 // indirect github.com/smartcontractkit/chainlink-protos/rmn/v1.6/go v0.0.0-20250131130834-15e0d4cde2a6 // indirect github.com/smartcontractkit/chainlink-protos/svr v0.0.0-20250123084029-58cce9b32112 // indirect github.com/smartcontractkit/chainlink-solana v1.1.2-0.20250213203720-e15b1333a14a // indirect diff --git a/system-tests/tests/go.sum b/system-tests/tests/go.sum index 8ec9815675c..df065994470 100644 --- a/system-tests/tests/go.sum +++ b/system-tests/tests/go.sum @@ -1142,8 +1142,8 @@ github.com/smartcontractkit/chainlink-integrations/evm v0.0.0-20250213145514-41d github.com/smartcontractkit/chainlink-integrations/evm v0.0.0-20250213145514-41d874782c02/go.mod h1:7DbPnG0E39eZaX1CXKxRiJ1NOWHwTZYDWR9ys3kZZuU= github.com/smartcontractkit/chainlink-protos/job-distributor v0.9.0 h1:hfMRj2ny6oNHd8w1rhJHdoX3YkoWJtCkBK6wTlCE4+c= github.com/smartcontractkit/chainlink-protos/job-distributor v0.9.0/go.mod h1:/dVVLXrsp+V0AbcYGJo3XMzKg3CkELsweA/TTopCsKE= -github.com/smartcontractkit/chainlink-protos/orchestrator v0.4.0 h1:ZBat8EBvE2LpSQR9U1gEbRV6PfAkiFdINmQ8nVnXIAQ= -github.com/smartcontractkit/chainlink-protos/orchestrator v0.4.0/go.mod h1:m/A3lqD7ms/RsQ9BT5P2uceYY0QX5mIt4KQxT2G6qEo= +github.com/smartcontractkit/chainlink-protos/orchestrator v0.5.0 h1:xRgu/kMkxcY4LeDKMBhaXU4khgya7v2wyb4Sa5Nzb+Y= +github.com/smartcontractkit/chainlink-protos/orchestrator v0.5.0/go.mod h1:m/A3lqD7ms/RsQ9BT5P2uceYY0QX5mIt4KQxT2G6qEo= github.com/smartcontractkit/chainlink-protos/rmn/v1.6/go v0.0.0-20250131130834-15e0d4cde2a6 h1:L6KJ4kGv/yNNoCk8affk7Y1vAY0qglPMXC/hevV/IsA= github.com/smartcontractkit/chainlink-protos/rmn/v1.6/go v0.0.0-20250131130834-15e0d4cde2a6/go.mod h1:FRwzI3hGj4CJclNS733gfcffmqQ62ONCkbGi49s658w= github.com/smartcontractkit/chainlink-protos/svr v0.0.0-20250123084029-58cce9b32112 h1:c77Gi/APraqwbBO8fbd/5JY2wW+MSIpYg8Uma9MEZFE= From 5403123073f043520f6f1fbd7a2e07d47913193c Mon Sep 17 00:00:00 2001 From: Erik Burton Date: Wed, 26 Feb 2025 14:01:14 -0500 Subject: [PATCH 10/12] fix: goreleaser amd64 disk space issue (#16592) --- .../actions/goreleaser-build-sign-publish/action.yml | 10 ++++++++++ .github/workflows/build-publish-develop-pr.yml | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/actions/goreleaser-build-sign-publish/action.yml b/.github/actions/goreleaser-build-sign-publish/action.yml index 0c7c05fe618..e63f22a1b70 100644 --- a/.github/actions/goreleaser-build-sign-publish/action.yml +++ b/.github/actions/goreleaser-build-sign-publish/action.yml @@ -37,6 +37,16 @@ inputs: runs: using: composite steps: + # See https://github.com/orgs/community/discussions/25678#discussioncomment-5242449 + - name: Delete unused tools to free up space + shell: bash + run: | + sudo rm -rf /opt/hostedtoolcache/CodeQL + sudo rm -rf /opt/hostedtoolcache/PyPy + sudo rm -rf /opt/hostedtoolcache/Python + sudo rm -rf /opt/hostedtoolcache/Ruby + sudo rm -rf /opt/hostedtoolcache/Java_* + - # We need QEMU to test the cross architecture builds after they're built. name: Set up QEMU uses: docker/setup-qemu-action@4574d27a4764455b42196d70a065bc6853246a25 # v3.4.0 diff --git a/.github/workflows/build-publish-develop-pr.yml b/.github/workflows/build-publish-develop-pr.yml index 9f918541673..d49e539e35e 100644 --- a/.github/workflows/build-publish-develop-pr.yml +++ b/.github/workflows/build-publish-develop-pr.yml @@ -98,7 +98,7 @@ jobs: with: persist-credentials: false ref: ${{ env.CHECKOUT_REF }} - fetch-depth: 0 + fetch-depth: 1 - name: Setup Github Token id: token From d27cae599135636da62c9af40ddcbafc61b864cb Mon Sep 17 00:00:00 2001 From: Bartek Tofel Date: Wed, 26 Feb 2025 21:15:47 +0100 Subject: [PATCH 11/12] [TT-1992] use CTF/lib that supports Docker running go-ethereum v1.15.0 (#16477) * use CTF/lib that supports Docker running go-ethereum v1.15.0 * use CTF versions that use go-ethereum v1.15.0 * make sure thet eth client used with Seth is ethclient not simulated.Backend * try another commit * use tagged CTF versions * add changeset * remove havoc.Schedule calls --- .changeset/swift-nails-yell.md | 5 ++ core/scripts/go.mod | 4 +- deployment/go.mod | 4 +- go.mod | 4 +- integration-tests/go.mod | 10 +-- integration-tests/go.sum | 20 ++--- integration-tests/load/go.mod | 10 +-- integration-tests/load/go.sum | 20 ++--- .../testsetups/automation_benchmark.go | 9 +- integration-tests/testsetups/ocr.go | 6 -- integration-tests/wrappers/contract_caller.go | 82 +++++++++++++++---- system-tests/lib/go.mod | 10 +-- system-tests/lib/go.sum | 12 +-- system-tests/tests/go.mod | 10 +-- system-tests/tests/go.sum | 12 +-- 15 files changed, 129 insertions(+), 89 deletions(-) create mode 100644 .changeset/swift-nails-yell.md diff --git a/.changeset/swift-nails-yell.md b/.changeset/swift-nails-yell.md new file mode 100644 index 00000000000..3c96000ff7f --- /dev/null +++ b/.changeset/swift-nails-yell.md @@ -0,0 +1,5 @@ +--- +"chainlink": patch +--- + +go.mod update in core/scripts #updated diff --git a/core/scripts/go.mod b/core/scripts/go.mod index 72bbcfcf04b..36d15adffbd 100644 --- a/core/scripts/go.mod +++ b/core/scripts/go.mod @@ -1,8 +1,6 @@ module github.com/smartcontractkit/chainlink/core/scripts -go 1.24 - -toolchain go1.24.0 +go 1.24.0 // Make sure we're working with the latest chainlink libs replace github.com/smartcontractkit/chainlink/v2 => ../../ diff --git a/deployment/go.mod b/deployment/go.mod index b89112f0083..16510ba7b37 100644 --- a/deployment/go.mod +++ b/deployment/go.mod @@ -1,8 +1,6 @@ module github.com/smartcontractkit/chainlink/deployment -go 1.24 - -toolchain go1.24.0 +go 1.24.0 // Make sure we're working with the latest chainlink libs replace github.com/smartcontractkit/chainlink/v2 => ../ diff --git a/go.mod b/go.mod index c3b52661302..6ffb117780e 100644 --- a/go.mod +++ b/go.mod @@ -1,8 +1,6 @@ module github.com/smartcontractkit/chainlink/v2 -go 1.24 - -toolchain go1.24.0 +go 1.24.0 require ( github.com/Depado/ginprom v1.8.0 diff --git a/integration-tests/go.mod b/integration-tests/go.mod index df5ffad26d9..6d7280b4740 100644 --- a/integration-tests/go.mod +++ b/integration-tests/go.mod @@ -48,12 +48,12 @@ require ( github.com/smartcontractkit/chainlink-common v0.4.2-0.20250221174903-e1e47fdb11b0 github.com/smartcontractkit/chainlink-integrations/evm v0.0.0-20250213145514-41d874782c02 github.com/smartcontractkit/chainlink-protos/job-distributor v0.9.0 - github.com/smartcontractkit/chainlink-testing-framework/havoc v1.50.5-0.20250225210020-fc215b29321e - github.com/smartcontractkit/chainlink-testing-framework/lib v1.51.1-0.20250225210020-fc215b29321e - github.com/smartcontractkit/chainlink-testing-framework/lib/grafana v1.50.1-0.20250225210020-fc215b29321e + github.com/smartcontractkit/chainlink-testing-framework/havoc v1.50.5 + github.com/smartcontractkit/chainlink-testing-framework/lib v1.52.0 + github.com/smartcontractkit/chainlink-testing-framework/lib/grafana v1.51.0 github.com/smartcontractkit/chainlink-testing-framework/sentinel v0.1.2 - github.com/smartcontractkit/chainlink-testing-framework/seth v1.50.10 - github.com/smartcontractkit/chainlink-testing-framework/wasp v1.50.6-0.20250225210020-fc215b29321e + github.com/smartcontractkit/chainlink-testing-framework/seth v1.51.0 + github.com/smartcontractkit/chainlink-testing-framework/wasp v1.51.0 github.com/smartcontractkit/libocr v0.0.0-20250220133800-f3b940c4f298 github.com/spf13/cobra v1.8.1 github.com/stretchr/testify v1.10.0 diff --git a/integration-tests/go.sum b/integration-tests/go.sum index b987c1228e9..cd175605d3a 100644 --- a/integration-tests/go.sum +++ b/integration-tests/go.sum @@ -1458,18 +1458,18 @@ github.com/smartcontractkit/chainlink-solana v1.1.2-0.20250213203720-e15b1333a14 github.com/smartcontractkit/chainlink-solana v1.1.2-0.20250213203720-e15b1333a14a/go.mod h1:aFm1QC/n99mVeBDtv0SE0co56+IECY6Y1fR3OfNYy3c= github.com/smartcontractkit/chainlink-testing-framework/framework v0.5.8-0.20250225210020-fc215b29321e h1:6poVaumg1KZYW/K8Aeip2VN2k9TnSjK6ujwfxJnIsoY= github.com/smartcontractkit/chainlink-testing-framework/framework v0.5.8-0.20250225210020-fc215b29321e/go.mod h1:tnyujVNgajqe67i2/0iwS4Y3mvbA30XBQWLEAArpwfw= -github.com/smartcontractkit/chainlink-testing-framework/havoc v1.50.5-0.20250225210020-fc215b29321e h1:2LFrQLx5VoilcbmiDC9+0rENoNLNECEVYYj3c/VDpHs= -github.com/smartcontractkit/chainlink-testing-framework/havoc v1.50.5-0.20250225210020-fc215b29321e/go.mod h1:SKBYQvtnl3OqOTr5aQyt9YbIckuNNn40LOJUCR0vlMo= -github.com/smartcontractkit/chainlink-testing-framework/lib v1.51.1-0.20250225210020-fc215b29321e h1:8fgAWzBdPrJcqX/QJMxYB3Xoi3v0IZkML7pOiLyV/tQ= -github.com/smartcontractkit/chainlink-testing-framework/lib v1.51.1-0.20250225210020-fc215b29321e/go.mod h1:jNxIJa9Fl/zM7rFahUFE8E55VGPC/2e6ilqVKoSbr8U= -github.com/smartcontractkit/chainlink-testing-framework/lib/grafana v1.50.1-0.20250225210020-fc215b29321e h1:g1fOH4P+JLU70bpjQVL7viDU7EhB+JKr1SpvpIDce+g= -github.com/smartcontractkit/chainlink-testing-framework/lib/grafana v1.50.1-0.20250225210020-fc215b29321e/go.mod h1:ym1yBKknQkGfgSQF7EGXSevDuex1YZbz+zgDwRvhY3U= +github.com/smartcontractkit/chainlink-testing-framework/havoc v1.50.5 h1:S5HND0EDtlA+xp2E+mD11DlUTp2wD6uojwixye8ZB/k= +github.com/smartcontractkit/chainlink-testing-framework/havoc v1.50.5/go.mod h1:SKBYQvtnl3OqOTr5aQyt9YbIckuNNn40LOJUCR0vlMo= +github.com/smartcontractkit/chainlink-testing-framework/lib v1.52.0 h1:rNjLZrwY3TcrANHVz/JUm55vufzoeRogSlgjAH7plvU= +github.com/smartcontractkit/chainlink-testing-framework/lib v1.52.0/go.mod h1:jNxIJa9Fl/zM7rFahUFE8E55VGPC/2e6ilqVKoSbr8U= +github.com/smartcontractkit/chainlink-testing-framework/lib/grafana v1.51.0 h1:+6L/PVxWsaYCr9jmxtKfyCcEJm1o6UaKrFJU9jAiZwA= +github.com/smartcontractkit/chainlink-testing-framework/lib/grafana v1.51.0/go.mod h1:ym1yBKknQkGfgSQF7EGXSevDuex1YZbz+zgDwRvhY3U= github.com/smartcontractkit/chainlink-testing-framework/sentinel v0.1.2 h1:ihRlWrii5nr4RUuMu1hStTbwFvVuHUDoQQwXmCU5IdQ= github.com/smartcontractkit/chainlink-testing-framework/sentinel v0.1.2/go.mod h1:J1Za5EuI/vWDsQSIh6qbPXlVvuEhmHmnvLQBN0XVxqA= -github.com/smartcontractkit/chainlink-testing-framework/seth v1.50.10 h1:Yf+n3T/fnUWcYyfe7bsygV4sWAkNo0QhN58APJFIKIc= -github.com/smartcontractkit/chainlink-testing-framework/seth v1.50.10/go.mod h1:05duR85P8YHuIfIkA7sn2bvrhKo/pDpFKV2rliYHNOo= -github.com/smartcontractkit/chainlink-testing-framework/wasp v1.50.6-0.20250225210020-fc215b29321e h1:Xuulg3EfQdsgO4j+IaMkffpmd0UbIcppB4wsIafKPsA= -github.com/smartcontractkit/chainlink-testing-framework/wasp v1.50.6-0.20250225210020-fc215b29321e/go.mod h1:eqV2n0vpqnY5N51je5/1vC/Qm8MMXVKvOXjLM+53Sog= +github.com/smartcontractkit/chainlink-testing-framework/seth v1.51.0 h1:cH+/lRpm7VN1a/tX7HmJCtQfZjLRyw1khG7CEQS94jA= +github.com/smartcontractkit/chainlink-testing-framework/seth v1.51.0/go.mod h1:kHYJnZUqiPF7/xN5273prV+srrLJkS77GbBXHLKQpx0= +github.com/smartcontractkit/chainlink-testing-framework/wasp v1.51.0 h1:qaLw7J7oRRsj+lUzzIjGVlXAVNmkAEwjj7xTXe0hcAk= +github.com/smartcontractkit/chainlink-testing-framework/wasp v1.51.0/go.mod h1:eqV2n0vpqnY5N51je5/1vC/Qm8MMXVKvOXjLM+53Sog= github.com/smartcontractkit/grpc-proxy v0.0.0-20240830132753-a7e17fec5ab7 h1:12ijqMM9tvYVEm+nR826WsrNi6zCKpwBhuApq127wHs= github.com/smartcontractkit/grpc-proxy v0.0.0-20240830132753-a7e17fec5ab7/go.mod h1:FX7/bVdoep147QQhsOPkYsPEXhGZjeYx6lBSaSXtZOA= github.com/smartcontractkit/libocr v0.0.0-20250220133800-f3b940c4f298 h1:PKiqnVOTChlH4a4ljJKL3OKGRgYfIpJS4YD1daAIKks= diff --git a/integration-tests/load/go.mod b/integration-tests/load/go.mod index 850d608dfe5..9dbc79c8cbb 100644 --- a/integration-tests/load/go.mod +++ b/integration-tests/load/go.mod @@ -29,9 +29,9 @@ require ( github.com/smartcontractkit/chainlink-ccip v0.0.0-20250226083129-e596590f48f7 github.com/smartcontractkit/chainlink-common v0.4.2-0.20250221174903-e1e47fdb11b0 github.com/smartcontractkit/chainlink-integrations/evm v0.0.0-20250213145514-41d874782c02 - github.com/smartcontractkit/chainlink-testing-framework/lib v1.51.1-0.20250225210020-fc215b29321e - github.com/smartcontractkit/chainlink-testing-framework/seth v1.50.14-0.20250225174253-0fe1e95e89b2 - github.com/smartcontractkit/chainlink-testing-framework/wasp v1.50.6-0.20250225210020-fc215b29321e + github.com/smartcontractkit/chainlink-testing-framework/lib v1.52.0 + github.com/smartcontractkit/chainlink-testing-framework/seth v1.51.0 + github.com/smartcontractkit/chainlink-testing-framework/wasp v1.51.0 github.com/smartcontractkit/tdh2/go/tdh2 v0.0.0-20241009055228-33d0c0bf38de github.com/stretchr/testify v1.10.0 github.com/wiremock/go-wiremock v1.9.0 @@ -440,8 +440,8 @@ require ( github.com/smartcontractkit/chainlink-protos/svr v0.0.0-20250123084029-58cce9b32112 // indirect github.com/smartcontractkit/chainlink-solana v1.1.2-0.20250213203720-e15b1333a14a // indirect github.com/smartcontractkit/chainlink-testing-framework/framework v0.5.8-0.20250225210020-fc215b29321e // indirect - github.com/smartcontractkit/chainlink-testing-framework/havoc v1.50.5-0.20250225210020-fc215b29321e // indirect - github.com/smartcontractkit/chainlink-testing-framework/lib/grafana v1.50.1-0.20250225210020-fc215b29321e // indirect + github.com/smartcontractkit/chainlink-testing-framework/havoc v1.50.5 // indirect + github.com/smartcontractkit/chainlink-testing-framework/lib/grafana v1.51.0 // indirect github.com/smartcontractkit/grpc-proxy v0.0.0-20240830132753-a7e17fec5ab7 // indirect github.com/smartcontractkit/libocr v0.0.0-20250220133800-f3b940c4f298 // indirect github.com/smartcontractkit/mcms v0.12.2 // indirect diff --git a/integration-tests/load/go.sum b/integration-tests/load/go.sum index 65671427faa..37213c2e46c 100644 --- a/integration-tests/load/go.sum +++ b/integration-tests/load/go.sum @@ -1443,16 +1443,16 @@ github.com/smartcontractkit/chainlink-solana v1.1.2-0.20250213203720-e15b1333a14 github.com/smartcontractkit/chainlink-solana v1.1.2-0.20250213203720-e15b1333a14a/go.mod h1:aFm1QC/n99mVeBDtv0SE0co56+IECY6Y1fR3OfNYy3c= github.com/smartcontractkit/chainlink-testing-framework/framework v0.5.8-0.20250225210020-fc215b29321e h1:6poVaumg1KZYW/K8Aeip2VN2k9TnSjK6ujwfxJnIsoY= github.com/smartcontractkit/chainlink-testing-framework/framework v0.5.8-0.20250225210020-fc215b29321e/go.mod h1:tnyujVNgajqe67i2/0iwS4Y3mvbA30XBQWLEAArpwfw= -github.com/smartcontractkit/chainlink-testing-framework/havoc v1.50.5-0.20250225210020-fc215b29321e h1:2LFrQLx5VoilcbmiDC9+0rENoNLNECEVYYj3c/VDpHs= -github.com/smartcontractkit/chainlink-testing-framework/havoc v1.50.5-0.20250225210020-fc215b29321e/go.mod h1:SKBYQvtnl3OqOTr5aQyt9YbIckuNNn40LOJUCR0vlMo= -github.com/smartcontractkit/chainlink-testing-framework/lib v1.51.1-0.20250225210020-fc215b29321e h1:8fgAWzBdPrJcqX/QJMxYB3Xoi3v0IZkML7pOiLyV/tQ= -github.com/smartcontractkit/chainlink-testing-framework/lib v1.51.1-0.20250225210020-fc215b29321e/go.mod h1:jNxIJa9Fl/zM7rFahUFE8E55VGPC/2e6ilqVKoSbr8U= -github.com/smartcontractkit/chainlink-testing-framework/lib/grafana v1.50.1-0.20250225210020-fc215b29321e h1:g1fOH4P+JLU70bpjQVL7viDU7EhB+JKr1SpvpIDce+g= -github.com/smartcontractkit/chainlink-testing-framework/lib/grafana v1.50.1-0.20250225210020-fc215b29321e/go.mod h1:ym1yBKknQkGfgSQF7EGXSevDuex1YZbz+zgDwRvhY3U= -github.com/smartcontractkit/chainlink-testing-framework/seth v1.50.14-0.20250225174253-0fe1e95e89b2 h1:DFP15nHtZntUnhAsHFxeE40jgHf5qgBX9TvzX49yRdU= -github.com/smartcontractkit/chainlink-testing-framework/seth v1.50.14-0.20250225174253-0fe1e95e89b2/go.mod h1:kHYJnZUqiPF7/xN5273prV+srrLJkS77GbBXHLKQpx0= -github.com/smartcontractkit/chainlink-testing-framework/wasp v1.50.6-0.20250225210020-fc215b29321e h1:Xuulg3EfQdsgO4j+IaMkffpmd0UbIcppB4wsIafKPsA= -github.com/smartcontractkit/chainlink-testing-framework/wasp v1.50.6-0.20250225210020-fc215b29321e/go.mod h1:eqV2n0vpqnY5N51je5/1vC/Qm8MMXVKvOXjLM+53Sog= +github.com/smartcontractkit/chainlink-testing-framework/havoc v1.50.5 h1:S5HND0EDtlA+xp2E+mD11DlUTp2wD6uojwixye8ZB/k= +github.com/smartcontractkit/chainlink-testing-framework/havoc v1.50.5/go.mod h1:SKBYQvtnl3OqOTr5aQyt9YbIckuNNn40LOJUCR0vlMo= +github.com/smartcontractkit/chainlink-testing-framework/lib v1.52.0 h1:rNjLZrwY3TcrANHVz/JUm55vufzoeRogSlgjAH7plvU= +github.com/smartcontractkit/chainlink-testing-framework/lib v1.52.0/go.mod h1:jNxIJa9Fl/zM7rFahUFE8E55VGPC/2e6ilqVKoSbr8U= +github.com/smartcontractkit/chainlink-testing-framework/lib/grafana v1.51.0 h1:+6L/PVxWsaYCr9jmxtKfyCcEJm1o6UaKrFJU9jAiZwA= +github.com/smartcontractkit/chainlink-testing-framework/lib/grafana v1.51.0/go.mod h1:ym1yBKknQkGfgSQF7EGXSevDuex1YZbz+zgDwRvhY3U= +github.com/smartcontractkit/chainlink-testing-framework/seth v1.51.0 h1:cH+/lRpm7VN1a/tX7HmJCtQfZjLRyw1khG7CEQS94jA= +github.com/smartcontractkit/chainlink-testing-framework/seth v1.51.0/go.mod h1:kHYJnZUqiPF7/xN5273prV+srrLJkS77GbBXHLKQpx0= +github.com/smartcontractkit/chainlink-testing-framework/wasp v1.51.0 h1:qaLw7J7oRRsj+lUzzIjGVlXAVNmkAEwjj7xTXe0hcAk= +github.com/smartcontractkit/chainlink-testing-framework/wasp v1.51.0/go.mod h1:eqV2n0vpqnY5N51je5/1vC/Qm8MMXVKvOXjLM+53Sog= github.com/smartcontractkit/grpc-proxy v0.0.0-20240830132753-a7e17fec5ab7 h1:12ijqMM9tvYVEm+nR826WsrNi6zCKpwBhuApq127wHs= github.com/smartcontractkit/grpc-proxy v0.0.0-20240830132753-a7e17fec5ab7/go.mod h1:FX7/bVdoep147QQhsOPkYsPEXhGZjeYx6lBSaSXtZOA= github.com/smartcontractkit/libocr v0.0.0-20250220133800-f3b940c4f298 h1:PKiqnVOTChlH4a4ljJKL3OKGRgYfIpJS4YD1daAIKks= diff --git a/integration-tests/testsetups/automation_benchmark.go b/integration-tests/testsetups/automation_benchmark.go index 1d9675decb0..d54cf592b79 100644 --- a/integration-tests/testsetups/automation_benchmark.go +++ b/integration-tests/testsetups/automation_benchmark.go @@ -21,6 +21,7 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/hexutil" "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/ethclient" "github.com/pkg/errors" "github.com/rs/zerolog" "github.com/rs/zerolog/log" @@ -230,10 +231,14 @@ func (k *KeeperBenchmarkTest) Run() { var startedObservations = atomic.Int32{} var finishedObservations = atomic.Int32{} + // since Seth can also be using simulated.Backend we need to make sure we are using ethclient.Client + sethAsEthClient, ok := k.chainClient.Client.(*ethclient.Client) + require.True(k.t, ok, "chainClient (Seth) client should be an ethclient.Client") + // We create as many channels as listening goroutines (1 per upkeep). In the background we will be fanning out // headers that we get from a single channel connected to EVM node to all upkeep-specific channels. headerCh := make(chan *blockchain.SafeEVMHeader, 10) - sub, err := k.chainClient.Client.Client().EthSubscribe(context.Background(), headerCh, "newHeads") + sub, err := sethAsEthClient.Client().EthSubscribe(context.Background(), headerCh, "newHeads") require.NoError(k.t, err, "Subscribing to new headers for upkeep observation shouldn't fail") totalNumberOfChannels := 0 @@ -279,7 +284,7 @@ func (k *KeeperBenchmarkTest) Run() { // we use infinite loop here on purposes, these nodes can be down for extended periods of time ¯\_(ツ)_/¯ RECONNECT: for { - sub, err = k.chainClient.Client.Client().EthSubscribe(context.Background(), headerCh, "newHeads") + sub, err = sethAsEthClient.Client().EthSubscribe(context.Background(), headerCh, "newHeads") if err == nil { break RECONNECT } diff --git a/integration-tests/testsetups/ocr.go b/integration-tests/testsetups/ocr.go index 7a90c38fdd0..82a6a2b6c26 100644 --- a/integration-tests/testsetups/ocr.go +++ b/integration-tests/testsetups/ocr.go @@ -1314,9 +1314,3 @@ func (l ocrTestChaosListener) OnChaosEnded(_ havoc.Chaos) { func (l ocrTestChaosListener) OnChaosStatusUnknown(_ havoc.Chaos) { } - -func (l ocrTestChaosListener) OnScheduleCreated(_ havoc.Schedule) { -} - -func (l ocrTestChaosListener) OnScheduleDeleted(_ havoc.Schedule) { -} diff --git a/integration-tests/wrappers/contract_caller.go b/integration-tests/wrappers/contract_caller.go index f904e2fa1da..c256ea1cfd1 100644 --- a/integration-tests/wrappers/contract_caller.go +++ b/integration-tests/wrappers/contract_caller.go @@ -63,16 +63,20 @@ func MustNewRetryingWrappedContractBackend(sethClient *seth.Client, logger zerol } } -func (w *WrappedContractBackend) getGethClient() *ethclient.Client { +func (w *WrappedContractBackend) getGethClient() (*ethclient.Client, error) { if w.sethClient != nil { - return w.sethClient.Client + if asEthClient, ok := w.sethClient.Client.(*ethclient.Client); ok { + return asEthClient, nil + } + + return nil, fmt.Errorf("seth client is not an ethclient, but %T", w.sethClient.Client) } if w.evmClient != nil { - return w.evmClient.GetEthClient() + return w.evmClient.GetEthClient(), nil } - panic("No client found") + return nil, errors.New("no client found") } func (w *WrappedContractBackend) CodeAt(ctx context.Context, contract common.Address, blockNumber *big.Int) ([]byte, error) { @@ -81,7 +85,10 @@ func (w *WrappedContractBackend) CodeAt(ctx context.Context, contract common.Add } var fn = func() ([]byte, error) { - client := w.getGethClient() + client, clientErr := w.getGethClient() + if clientErr != nil { + return nil, clientErr + } return client.CodeAt(ctx, contract, blockNumber) } @@ -95,7 +102,10 @@ func (w *WrappedContractBackend) PendingCodeAt(ctx context.Context, contract com } var fn = func() ([]byte, error) { - client := w.getGethClient() + client, clientErr := w.getGethClient() + if clientErr != nil { + return nil, clientErr + } return client.PendingCodeAt(ctx, contract) } @@ -109,7 +119,10 @@ func (w *WrappedContractBackend) CodeAtHash(ctx context.Context, contract common } var fn = func() ([]byte, error) { - client := w.getGethClient() + client, clientErr := w.getGethClient() + if clientErr != nil { + return nil, clientErr + } return client.CodeAtHash(ctx, contract, blockHash) } @@ -123,7 +136,10 @@ func (w *WrappedContractBackend) CallContractAtHash(ctx context.Context, call et } var fn = func() ([]byte, error) { - client := w.getGethClient() + client, clientErr := w.getGethClient() + if clientErr != nil { + return nil, clientErr + } return client.CallContractAtHash(ctx, call, blockHash) } @@ -137,7 +153,10 @@ func (w *WrappedContractBackend) HeaderByNumber(ctx context.Context, number *big } var fn = func() (*types.Header, error) { - client := w.getGethClient() + client, clientErr := w.getGethClient() + if clientErr != nil { + return nil, clientErr + } return client.HeaderByNumber(ctx, number) } @@ -151,7 +170,10 @@ func (w *WrappedContractBackend) PendingNonceAt(ctx context.Context, account com } var fn = func() (uint64, error) { - client := w.getGethClient() + client, clientErr := w.getGethClient() + if clientErr != nil { + return 0, clientErr + } return client.PendingNonceAt(ctx, account) } @@ -165,7 +187,10 @@ func (w *WrappedContractBackend) SuggestGasPrice(ctx context.Context) (*big.Int, } var fn = func() (*big.Int, error) { - client := w.getGethClient() + client, clientErr := w.getGethClient() + if clientErr != nil { + return nil, clientErr + } return client.SuggestGasPrice(ctx) } @@ -179,7 +204,10 @@ func (w *WrappedContractBackend) SuggestGasTipCap(ctx context.Context) (*big.Int } var fn = func() (*big.Int, error) { - client := w.getGethClient() + client, clientErr := w.getGethClient() + if clientErr != nil { + return nil, clientErr + } return client.SuggestGasTipCap(ctx) } @@ -193,7 +221,10 @@ func (w *WrappedContractBackend) EstimateGas(ctx context.Context, call ethereum. } var fn = func() (uint64, error) { - client := w.getGethClient() + client, clientErr := w.getGethClient() + if clientErr != nil { + return 0, clientErr + } return client.EstimateGas(ctx, call) } @@ -206,7 +237,10 @@ func (w *WrappedContractBackend) SendTransaction(ctx context.Context, tx *types. return errors.Wrapf(ctxErr, "the context you passed had an error set. Won't call SendTransaction") } - client := w.getGethClient() + client, clientErr := w.getGethClient() + if clientErr != nil { + return clientErr + } return client.SendTransaction(ctx, tx) } @@ -216,7 +250,10 @@ func (w *WrappedContractBackend) FilterLogs(ctx context.Context, query ethereum. } var fn = func() ([]types.Log, error) { - client := w.getGethClient() + client, clientErr := w.getGethClient() + if clientErr != nil { + return nil, clientErr + } return client.FilterLogs(ctx, query) } @@ -230,7 +267,10 @@ func (w *WrappedContractBackend) SubscribeFilterLogs(ctx context.Context, query } var fn = func() (ethereum.Subscription, error) { - client := w.getGethClient() + client, clientErr := w.getGethClient() + if clientErr != nil { + return nil, clientErr + } return client.SubscribeFilterLogs(ctx, query, ch) } @@ -245,7 +285,10 @@ func (w *WrappedContractBackend) CallContract(ctx context.Context, msg ethereum. var fn = func() ([]byte, error) { var hex hexutil.Bytes - client := w.getGethClient() + client, clientErr := w.getGethClient() + if clientErr != nil { + return nil, clientErr + } err := client.Client().CallContext(ctx, &hex, "eth_call", evmClient.ToBackwardCompatibleCallArg(msg), evmClient.ToBackwardCompatibleBlockNumArg(blockNumber)) if err != nil { return nil, err @@ -264,7 +307,10 @@ func (w *WrappedContractBackend) PendingCallContract(ctx context.Context, msg et var fn = func() ([]byte, error) { var hex hexutil.Bytes - client := w.getGethClient() + client, clientErr := w.getGethClient() + if clientErr != nil { + return nil, clientErr + } err := client.Client().CallContext(ctx, &hex, "eth_call", evmClient.ToBackwardCompatibleCallArg(msg), "pending") if err != nil { return nil, err diff --git a/system-tests/lib/go.mod b/system-tests/lib/go.mod index 32efa110bf9..458d8fd2054 100644 --- a/system-tests/lib/go.mod +++ b/system-tests/lib/go.mod @@ -1,8 +1,6 @@ module github.com/smartcontractkit/chainlink/system-tests/lib -go 1.24 - -toolchain go1.24.0 +go 1.24.0 require ( github.com/smartcontractkit/chainlink/deployment v0.0.0-20250221182743-098d1b0a763a @@ -21,9 +19,9 @@ require ( github.com/rs/zerolog v1.33.0 github.com/smartcontractkit/chainlink-common v0.4.2-0.20250221174903-e1e47fdb11b0 github.com/smartcontractkit/chainlink-protos/job-distributor v0.9.0 - github.com/smartcontractkit/chainlink-testing-framework/framework v0.5.4 - github.com/smartcontractkit/chainlink-testing-framework/lib v1.50.23 - github.com/smartcontractkit/chainlink-testing-framework/seth v1.50.10 + github.com/smartcontractkit/chainlink-testing-framework/framework v0.5.8 + github.com/smartcontractkit/chainlink-testing-framework/lib v1.52.0 + github.com/smartcontractkit/chainlink-testing-framework/seth v1.51.0 google.golang.org/grpc v1.70.0 gopkg.in/yaml.v3 v3.0.1 ) diff --git a/system-tests/lib/go.sum b/system-tests/lib/go.sum index 64a9a9b9350..74810cf9921 100644 --- a/system-tests/lib/go.sum +++ b/system-tests/lib/go.sum @@ -1150,12 +1150,12 @@ github.com/smartcontractkit/chainlink-protos/svr v0.0.0-20250123084029-58cce9b32 github.com/smartcontractkit/chainlink-protos/svr v0.0.0-20250123084029-58cce9b32112/go.mod h1:TcOliTQU6r59DwG4lo3U+mFM9WWyBHGuFkkxQpvSujo= github.com/smartcontractkit/chainlink-solana v1.1.2-0.20250213203720-e15b1333a14a h1:C+XavZQ0rBOpOrh45LUhdOsvtI8OQ0XZKI5pi+GP6h4= github.com/smartcontractkit/chainlink-solana v1.1.2-0.20250213203720-e15b1333a14a/go.mod h1:aFm1QC/n99mVeBDtv0SE0co56+IECY6Y1fR3OfNYy3c= -github.com/smartcontractkit/chainlink-testing-framework/framework v0.5.4 h1:8R/xyOh/SaifOhhmOYNB3uv3sUzKeshILtVCqRgv7ck= -github.com/smartcontractkit/chainlink-testing-framework/framework v0.5.4/go.mod h1:fAmPov5WZg2WjTRoUrz7fzcvD9b77ZOw5yPwJXI2IOE= -github.com/smartcontractkit/chainlink-testing-framework/lib v1.50.23 h1:gji906uw6vkSPXUUBoRuFeeL/93l4YYZAQY4G03R1RM= -github.com/smartcontractkit/chainlink-testing-framework/lib v1.50.23/go.mod h1:70JLBXQncNHyW63ik4PvPQGjQGZ1xK67MKrDanVAk2w= -github.com/smartcontractkit/chainlink-testing-framework/seth v1.50.10 h1:Yf+n3T/fnUWcYyfe7bsygV4sWAkNo0QhN58APJFIKIc= -github.com/smartcontractkit/chainlink-testing-framework/seth v1.50.10/go.mod h1:05duR85P8YHuIfIkA7sn2bvrhKo/pDpFKV2rliYHNOo= +github.com/smartcontractkit/chainlink-testing-framework/framework v0.5.8 h1:WZkQt31AsUtnsTSBsH5UdOXrXTfulq0DnuVfHKLaBto= +github.com/smartcontractkit/chainlink-testing-framework/framework v0.5.8/go.mod h1:tnyujVNgajqe67i2/0iwS4Y3mvbA30XBQWLEAArpwfw= +github.com/smartcontractkit/chainlink-testing-framework/lib v1.52.0 h1:rNjLZrwY3TcrANHVz/JUm55vufzoeRogSlgjAH7plvU= +github.com/smartcontractkit/chainlink-testing-framework/lib v1.52.0/go.mod h1:jNxIJa9Fl/zM7rFahUFE8E55VGPC/2e6ilqVKoSbr8U= +github.com/smartcontractkit/chainlink-testing-framework/seth v1.51.0 h1:cH+/lRpm7VN1a/tX7HmJCtQfZjLRyw1khG7CEQS94jA= +github.com/smartcontractkit/chainlink-testing-framework/seth v1.51.0/go.mod h1:kHYJnZUqiPF7/xN5273prV+srrLJkS77GbBXHLKQpx0= github.com/smartcontractkit/grpc-proxy v0.0.0-20240830132753-a7e17fec5ab7 h1:12ijqMM9tvYVEm+nR826WsrNi6zCKpwBhuApq127wHs= github.com/smartcontractkit/grpc-proxy v0.0.0-20240830132753-a7e17fec5ab7/go.mod h1:FX7/bVdoep147QQhsOPkYsPEXhGZjeYx6lBSaSXtZOA= github.com/smartcontractkit/libocr v0.0.0-20250220133800-f3b940c4f298 h1:PKiqnVOTChlH4a4ljJKL3OKGRgYfIpJS4YD1daAIKks= diff --git a/system-tests/tests/go.mod b/system-tests/tests/go.mod index b7915ef440b..4d1c9863524 100644 --- a/system-tests/tests/go.mod +++ b/system-tests/tests/go.mod @@ -1,8 +1,6 @@ module github.com/smartcontractkit/chainlink/system-tests/tests -go 1.24 - -toolchain go1.24.0 +go 1.24.0 // Using a separate `require` here to avoid surrounding line changes // creating potential merge conflicts. @@ -26,9 +24,9 @@ require ( github.com/pkg/errors v0.9.1 github.com/rs/zerolog v1.33.0 github.com/smartcontractkit/chain-selectors v1.0.40 - github.com/smartcontractkit/chainlink-testing-framework/framework v0.5.4 - github.com/smartcontractkit/chainlink-testing-framework/lib v1.50.23 - github.com/smartcontractkit/chainlink-testing-framework/seth v1.50.10 + github.com/smartcontractkit/chainlink-testing-framework/framework v0.5.8 + github.com/smartcontractkit/chainlink-testing-framework/lib v1.52.0 + github.com/smartcontractkit/chainlink-testing-framework/seth v1.51.0 github.com/smartcontractkit/chainlink/system-tests/lib v0.0.0-00010101000000-000000000000 github.com/stretchr/testify v1.10.0 ) diff --git a/system-tests/tests/go.sum b/system-tests/tests/go.sum index df065994470..c5bddf1be3a 100644 --- a/system-tests/tests/go.sum +++ b/system-tests/tests/go.sum @@ -1150,12 +1150,12 @@ github.com/smartcontractkit/chainlink-protos/svr v0.0.0-20250123084029-58cce9b32 github.com/smartcontractkit/chainlink-protos/svr v0.0.0-20250123084029-58cce9b32112/go.mod h1:TcOliTQU6r59DwG4lo3U+mFM9WWyBHGuFkkxQpvSujo= github.com/smartcontractkit/chainlink-solana v1.1.2-0.20250213203720-e15b1333a14a h1:C+XavZQ0rBOpOrh45LUhdOsvtI8OQ0XZKI5pi+GP6h4= github.com/smartcontractkit/chainlink-solana v1.1.2-0.20250213203720-e15b1333a14a/go.mod h1:aFm1QC/n99mVeBDtv0SE0co56+IECY6Y1fR3OfNYy3c= -github.com/smartcontractkit/chainlink-testing-framework/framework v0.5.4 h1:8R/xyOh/SaifOhhmOYNB3uv3sUzKeshILtVCqRgv7ck= -github.com/smartcontractkit/chainlink-testing-framework/framework v0.5.4/go.mod h1:fAmPov5WZg2WjTRoUrz7fzcvD9b77ZOw5yPwJXI2IOE= -github.com/smartcontractkit/chainlink-testing-framework/lib v1.50.23 h1:gji906uw6vkSPXUUBoRuFeeL/93l4YYZAQY4G03R1RM= -github.com/smartcontractkit/chainlink-testing-framework/lib v1.50.23/go.mod h1:70JLBXQncNHyW63ik4PvPQGjQGZ1xK67MKrDanVAk2w= -github.com/smartcontractkit/chainlink-testing-framework/seth v1.50.10 h1:Yf+n3T/fnUWcYyfe7bsygV4sWAkNo0QhN58APJFIKIc= -github.com/smartcontractkit/chainlink-testing-framework/seth v1.50.10/go.mod h1:05duR85P8YHuIfIkA7sn2bvrhKo/pDpFKV2rliYHNOo= +github.com/smartcontractkit/chainlink-testing-framework/framework v0.5.8 h1:WZkQt31AsUtnsTSBsH5UdOXrXTfulq0DnuVfHKLaBto= +github.com/smartcontractkit/chainlink-testing-framework/framework v0.5.8/go.mod h1:tnyujVNgajqe67i2/0iwS4Y3mvbA30XBQWLEAArpwfw= +github.com/smartcontractkit/chainlink-testing-framework/lib v1.52.0 h1:rNjLZrwY3TcrANHVz/JUm55vufzoeRogSlgjAH7plvU= +github.com/smartcontractkit/chainlink-testing-framework/lib v1.52.0/go.mod h1:jNxIJa9Fl/zM7rFahUFE8E55VGPC/2e6ilqVKoSbr8U= +github.com/smartcontractkit/chainlink-testing-framework/seth v1.51.0 h1:cH+/lRpm7VN1a/tX7HmJCtQfZjLRyw1khG7CEQS94jA= +github.com/smartcontractkit/chainlink-testing-framework/seth v1.51.0/go.mod h1:kHYJnZUqiPF7/xN5273prV+srrLJkS77GbBXHLKQpx0= github.com/smartcontractkit/grpc-proxy v0.0.0-20240830132753-a7e17fec5ab7 h1:12ijqMM9tvYVEm+nR826WsrNi6zCKpwBhuApq127wHs= github.com/smartcontractkit/grpc-proxy v0.0.0-20240830132753-a7e17fec5ab7/go.mod h1:FX7/bVdoep147QQhsOPkYsPEXhGZjeYx6lBSaSXtZOA= github.com/smartcontractkit/libocr v0.0.0-20250220133800-f3b940c4f298 h1:PKiqnVOTChlH4a4ljJKL3OKGRgYfIpJS4YD1daAIKks= From 87b3664d31b89d22214a7267b99da7e604ec4aee Mon Sep 17 00:00:00 2001 From: "Simon B.Robert" Date: Wed, 26 Feb 2025 15:49:18 -0500 Subject: [PATCH 12/12] Add curse subject to RMNRemote view (#16563) * Add curse subject to RMNRemote view * Fix linting issues * Address PR feedback * Fix linting issues * Fix import rename --- deployment/ccip/changeset/globals/helpers.go | 24 ++++++++++ .../changeset/v1_6/cs_rmn_curse_uncurse.go | 47 +++++++------------ deployment/ccip/view/v1_6/rmnremote.go | 37 +++++++++++++-- deployment/ccip/view/v1_6/rmnremote_test.go | 42 +++++++++++++++++ .../ccip/ccip_cs_rmn_curse_uncurse_test.go | 5 +- 5 files changed, 118 insertions(+), 37 deletions(-) create mode 100644 deployment/ccip/changeset/globals/helpers.go create mode 100644 deployment/ccip/view/v1_6/rmnremote_test.go diff --git a/deployment/ccip/changeset/globals/helpers.go b/deployment/ccip/changeset/globals/helpers.go new file mode 100644 index 00000000000..5169cc7a732 --- /dev/null +++ b/deployment/ccip/changeset/globals/helpers.go @@ -0,0 +1,24 @@ +package globals + +import "encoding/binary" + +// GlobalCurseSubject as defined here: https://github.com/smartcontractkit/chainlink/blob/new-rmn-curse-changeset/contracts/src/v0.8/ccip/rmn/RMNRemote.sol#L15 +func GlobalCurseSubject() Subject { + return Subject{0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01} +} + +type Subject = [16]byte + +func SelectorToSubject(selector uint64) Subject { + var b Subject + binary.BigEndian.PutUint64(b[8:], selector) + return b +} + +func SubjectToSelector(subject [16]byte) uint64 { + if subject == GlobalCurseSubject() { + return 0 + } + + return binary.BigEndian.Uint64(subject[8:]) +} diff --git a/deployment/ccip/changeset/v1_6/cs_rmn_curse_uncurse.go b/deployment/ccip/changeset/v1_6/cs_rmn_curse_uncurse.go index 63ac89689ae..248a944dc39 100644 --- a/deployment/ccip/changeset/v1_6/cs_rmn_curse_uncurse.go +++ b/deployment/ccip/changeset/v1_6/cs_rmn_curse_uncurse.go @@ -1,12 +1,12 @@ package v1_6 import ( - "encoding/binary" "errors" "fmt" "github.com/smartcontractkit/chainlink/deployment" "github.com/smartcontractkit/chainlink/deployment/ccip/changeset" + "github.com/smartcontractkit/chainlink/deployment/ccip/changeset/globals" commoncs "github.com/smartcontractkit/chainlink/deployment/common/changeset" ) @@ -15,16 +15,11 @@ var ( _ deployment.ChangeSet[RMNCurseConfig] = RMNUncurseChangeset ) -// GlobalCurseSubject as defined here: https://github.com/smartcontractkit/chainlink/blob/new-rmn-curse-changeset/contracts/src/v0.8/ccip/rmn/RMNRemote.sol#L15 -func GlobalCurseSubject() Subject { - return Subject{0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01} -} - // RMNCurseAction represent a curse action to be applied on a chain (ChainSelector) with a specific subject (SubjectToCurse) // The curse action will by applied by calling the Curse method on the RMNRemote contract on the chain (ChainSelector) type RMNCurseAction struct { ChainSelector uint64 - SubjectToCurse Subject + SubjectToCurse globals.Subject } // CurseAction is a function that returns a list of RMNCurseAction to be applied on a chain @@ -52,11 +47,11 @@ func (c RMNCurseConfig) Validate(e deployment.Environment) error { return errors.New("reason is required") } - validSubjects := map[Subject]struct{}{ - GlobalCurseSubject(): {}, + validSubjects := map[globals.Subject]struct{}{ + globals.GlobalCurseSubject(): {}, } for _, selector := range e.AllChainSelectors() { - validSubjects[SelectorToSubject(selector)] = struct{}{} + validSubjects[globals.SelectorToSubject(selector)] = struct{}{} } for _, curseAction := range c.CurseActions { @@ -85,14 +80,6 @@ func (c RMNCurseConfig) Validate(e deployment.Environment) error { return nil } -type Subject = [16]byte - -func SelectorToSubject(selector uint64) Subject { - var b Subject - binary.BigEndian.PutUint64(b[8:], selector) - return b -} - // CurseLaneOnlyOnSource curses a lane only on the source chain // This will prevent message from source to destination to be initiated // One noteworthy behaviour is that this means that message can be sent from destination to source but will not be executed on the source @@ -104,7 +91,7 @@ func CurseLaneOnlyOnSource(sourceSelector uint64, destinationSelector uint64) Cu return []RMNCurseAction{ { ChainSelector: sourceSelector, - SubjectToCurse: SelectorToSubject(destinationSelector), + SubjectToCurse: globals.SelectorToSubject(destinationSelector), }, } } @@ -118,7 +105,7 @@ func CurseGloballyOnlyOnChain(selector uint64) CurseAction { return []RMNCurseAction{ { ChainSelector: selector, - SubjectToCurse: GlobalCurseSubject(), + SubjectToCurse: globals.GlobalCurseSubject(), }, } } @@ -150,7 +137,7 @@ func CurseChain(chainSelector uint64) CurseAction { if otherChainSelector != chainSelector { curseActions = append(curseActions, RMNCurseAction{ ChainSelector: otherChainSelector, - SubjectToCurse: SelectorToSubject(chainSelector), + SubjectToCurse: globals.SelectorToSubject(chainSelector), }) } } @@ -162,24 +149,24 @@ func CurseChain(chainSelector uint64) CurseAction { } } -func groupRMNSubjectBySelector(rmnSubjects []RMNCurseAction, avoidCursingSelf bool, onlyKeepGlobal bool) map[uint64][]Subject { - grouped := make(map[uint64][]Subject) +func groupRMNSubjectBySelector(rmnSubjects []RMNCurseAction, avoidCursingSelf bool, onlyKeepGlobal bool) map[uint64][]globals.Subject { + grouped := make(map[uint64][]globals.Subject) for _, s := range rmnSubjects { // Skip self-curse if needed - if s.SubjectToCurse == SelectorToSubject(s.ChainSelector) && avoidCursingSelf { + if s.SubjectToCurse == globals.SelectorToSubject(s.ChainSelector) && avoidCursingSelf { continue } // Initialize slice for this chain if needed if _, ok := grouped[s.ChainSelector]; !ok { - grouped[s.ChainSelector] = []Subject{} + grouped[s.ChainSelector] = []globals.Subject{} } // If global is already set and we only keep global, skip - if onlyKeepGlobal && len(grouped[s.ChainSelector]) == 1 && grouped[s.ChainSelector][0] == GlobalCurseSubject() { + if onlyKeepGlobal && len(grouped[s.ChainSelector]) == 1 && grouped[s.ChainSelector][0] == globals.GlobalCurseSubject() { continue } // If subject is global and we only keep global, reset immediately - if s.SubjectToCurse == GlobalCurseSubject() && onlyKeepGlobal { - grouped[s.ChainSelector] = []Subject{GlobalCurseSubject()} + if s.SubjectToCurse == globals.GlobalCurseSubject() && onlyKeepGlobal { + grouped[s.ChainSelector] = []globals.Subject{globals.GlobalCurseSubject()} continue } // Ensure uniqueness @@ -238,7 +225,7 @@ func RMNCurseChangeset(e deployment.Environment, cfg RMNCurseConfig) (deployment } if curseSubjects, ok := grouped[selector]; ok { // Only curse the subjects that are not actually cursed - notAlreadyCursedSubjects := make([]Subject, 0) + notAlreadyCursedSubjects := make([]globals.Subject, 0) for _, subject := range curseSubjects { cursed, err := chain.RMNRemote.IsCursed(nil, subject) if err != nil { @@ -311,7 +298,7 @@ func RMNUncurseChangeset(e deployment.Environment, cfg RMNCurseConfig) (deployme if curseSubjects, ok := grouped[selector]; ok { // Only keep the subject that are actually cursed - actuallyCursedSubjects := make([]Subject, 0) + actuallyCursedSubjects := make([]globals.Subject, 0) for _, subject := range curseSubjects { cursed, err := chain.RMNRemote.IsCursed(nil, subject) if err != nil { diff --git a/deployment/ccip/view/v1_6/rmnremote.go b/deployment/ccip/view/v1_6/rmnremote.go index 36df620196d..236c0a1d6c4 100644 --- a/deployment/ccip/view/v1_6/rmnremote.go +++ b/deployment/ccip/view/v1_6/rmnremote.go @@ -1,14 +1,23 @@ package v1_6 import ( + "encoding/hex" + + "github.com/smartcontractkit/chainlink/deployment/ccip/changeset/globals" "github.com/smartcontractkit/chainlink/deployment/common/view/types" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/v1_6_0/rmn_remote" ) +type RMNRemoteCurseEntry struct { + Subject string `json:"subject"` + Selector uint64 `json:"selector"` +} + type RMNRemoteView struct { types.ContractMetaData - IsCursed bool `json:"isCursed"` - Config RMNRemoteVersionedConfig `json:"config,omitempty"` + IsCursed bool `json:"isCursed"` + Config RMNRemoteVersionedConfig `json:"config,omitempty"` + CursedSubjectEntries []RMNRemoteCurseEntry `json:"cursedSubjectEntries,omitempty"` } type RMNRemoteVersionedConfig struct { @@ -22,6 +31,17 @@ type RMNRemoteSigner struct { NodeIndex uint64 `json:"node_index"` } +func mapCurseSubjects(subjects [][16]byte) []RMNRemoteCurseEntry { + res := make([]RMNRemoteCurseEntry, 0, len(subjects)) + for _, subject := range subjects { + res = append(res, RMNRemoteCurseEntry{ + Subject: hex.EncodeToString(subject[:]), + Selector: globals.SubjectToSelector(subject), + }) + } + return res +} + func GenerateRMNRemoteView(rmnReader *rmn_remote.RMNRemote) (RMNRemoteView, error) { tv, err := types.NewContractMetaData(rmnReader, rmnReader.Address()) if err != nil { @@ -46,9 +66,16 @@ func GenerateRMNRemoteView(rmnReader *rmn_remote.RMNRemote) (RMNRemoteView, erro if err != nil { return RMNRemoteView{}, err } + + curseSubjects, err := rmnReader.GetCursedSubjects(nil) + if err != nil { + return RMNRemoteView{}, err + } + return RMNRemoteView{ - ContractMetaData: tv, - IsCursed: isCursed, - Config: rmnConfig, + ContractMetaData: tv, + IsCursed: isCursed, + Config: rmnConfig, + CursedSubjectEntries: mapCurseSubjects(curseSubjects), }, nil } diff --git a/deployment/ccip/view/v1_6/rmnremote_test.go b/deployment/ccip/view/v1_6/rmnremote_test.go new file mode 100644 index 00000000000..d4465f6c022 --- /dev/null +++ b/deployment/ccip/view/v1_6/rmnremote_test.go @@ -0,0 +1,42 @@ +package v1_6 + +import ( + "testing" + + "github.com/ethereum/go-ethereum/common" + "github.com/stretchr/testify/require" + "go.uber.org/zap/zapcore" + + "github.com/smartcontractkit/chainlink/deployment" + "github.com/smartcontractkit/chainlink/deployment/ccip/changeset/globals" + "github.com/smartcontractkit/chainlink/deployment/environment/memory" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/v1_6_0/rmn_remote" + "github.com/smartcontractkit/chainlink/v2/core/logger" +) + +func Test_RMNRemote_Curse_View(t *testing.T) { + e := memory.NewMemoryEnvironment(t, logger.TestLogger(t), zapcore.InfoLevel, memory.MemoryEnvironmentConfig{ + Chains: 1, + }) + chain := e.Chains[e.AllChainSelectors()[0]] + _, tx, remote, err := rmn_remote.DeployRMNRemote(chain.DeployerKey, chain.Client, e.AllChainSelectors()[0], common.Address{}) + _, err = deployment.ConfirmIfNoError(chain, tx, err) + require.NoError(t, err) + + tx, err = remote.Curse(chain.DeployerKey, globals.GlobalCurseSubject()) + _, err = deployment.ConfirmIfNoError(chain, tx, err) + require.NoError(t, err) + + tx, err = remote.Curse(chain.DeployerKey, globals.SelectorToSubject(e.AllChainSelectors()[0])) + _, err = deployment.ConfirmIfNoError(chain, tx, err) + require.NoError(t, err) + + view, err := GenerateRMNRemoteView(remote) + require.NoError(t, err) + + require.True(t, view.IsCursed) + require.Len(t, view.CursedSubjectEntries, 2) + require.Equal(t, "01000000000000000000000000000001", view.CursedSubjectEntries[0].Subject) + require.Equal(t, uint64(0), view.CursedSubjectEntries[0].Selector) + require.Equal(t, e.AllChainSelectors()[0], view.CursedSubjectEntries[1].Selector) +} diff --git a/integration-tests/smoke/ccip/ccip_cs_rmn_curse_uncurse_test.go b/integration-tests/smoke/ccip/ccip_cs_rmn_curse_uncurse_test.go index c5457d2bee6..2fef0fdf39e 100644 --- a/integration-tests/smoke/ccip/ccip_cs_rmn_curse_uncurse_test.go +++ b/integration-tests/smoke/ccip/ccip_cs_rmn_curse_uncurse_test.go @@ -8,6 +8,7 @@ import ( "github.com/smartcontractkit/chainlink/deployment" "github.com/smartcontractkit/chainlink/deployment/ccip/changeset" + "github.com/smartcontractkit/chainlink/deployment/ccip/changeset/globals" "github.com/smartcontractkit/chainlink/deployment/ccip/changeset/testhelpers" "github.com/smartcontractkit/chainlink/deployment/ccip/changeset/v1_6" commonchangeset "github.com/smartcontractkit/chainlink/deployment/common/changeset" @@ -369,9 +370,9 @@ func verifyTestCaseAssertions(t *testing.T, e *testhelpers.DeployedEnv, tc Curse require.NoError(t, err) for _, assertion := range tc.curseAssertions { - cursedSubject := v1_6.SelectorToSubject(mapIDToSelector(assertion.subject)) + cursedSubject := globals.SelectorToSubject(mapIDToSelector(assertion.subject)) if assertion.globalCurse { - cursedSubject = v1_6.GlobalCurseSubject() + cursedSubject = globals.GlobalCurseSubject() } isCursed, err := state.Chains[mapIDToSelector(assertion.chainID)].RMNRemote.IsCursed(nil, cursedSubject)