diff --git a/core/scripts/go.mod b/core/scripts/go.mod index 680f47423a4..7fb73eed291 100644 --- a/core/scripts/go.mod +++ b/core/scripts/go.mod @@ -12,8 +12,8 @@ replace github.com/smartcontractkit/chainlink/deployment => ../../deployment // Using a separate `require` here to avoid surrounding line changes // creating potential merge conflicts. require ( - github.com/smartcontractkit/chainlink/deployment v0.0.0-20250128231431-9279badae2f0 - github.com/smartcontractkit/chainlink/v2 v2.19.0-ccip1.5.16-alpha.0.0.20250129223716-34cbaaab2d04 + github.com/smartcontractkit/chainlink/deployment v0.0.0-20250221182743-098d1b0a763a + github.com/smartcontractkit/chainlink/v2 v2.0.0-20250221182743-098d1b0a763a ) require ( @@ -34,7 +34,7 @@ require ( github.com/prometheus/client_golang v1.20.5 github.com/shopspring/decimal v1.4.0 github.com/smartcontractkit/chainlink-automation v0.8.1 - github.com/smartcontractkit/chainlink-common v0.4.2-0.20250214231858-f365e2bdecea + github.com/smartcontractkit/chainlink-common v0.4.2-0.20250221174903-e1e47fdb11b0 github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20250128203428-08031923fbe5 github.com/smartcontractkit/chainlink-integrations/evm v0.0.0-20250213145514-41d874782c02 github.com/smartcontractkit/chainlink-testing-framework/lib v1.50.22 diff --git a/core/scripts/go.sum b/core/scripts/go.sum index 721b690ba76..fbe0b40ff8c 100644 --- a/core/scripts/go.sum +++ b/core/scripts/go.sum @@ -1090,8 +1090,8 @@ github.com/smartcontractkit/chainlink-ccip v0.0.0-20250224132459-c57ae4a97dcb h1 github.com/smartcontractkit/chainlink-ccip v0.0.0-20250224132459-c57ae4a97dcb/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= -github.com/smartcontractkit/chainlink-common v0.4.2-0.20250214231858-f365e2bdecea/go.mod h1:Z2e1ynSJ4pg83b4Qldbmryc5lmnrI3ojOdg1FUloa68= +github.com/smartcontractkit/chainlink-common v0.4.2-0.20250221174903-e1e47fdb11b0 h1:BTN2nQgFKBxgas6oqY3ym82O+wT++WlpP1+a6KzIfY0= +github.com/smartcontractkit/chainlink-common v0.4.2-0.20250221174903-e1e47fdb11b0/go.mod h1:YQuXIqQpmpAqstWV0LHaDTJ5nsSWuip5ivEM+Fisb+4= github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20250128203428-08031923fbe5 h1:CvDfgWoLoYPapOumE/UZCplfCu5oNmy9BuH+6V6+fJ8= github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20250128203428-08031923fbe5/go.mod h1:pDZagSGjs9U+l4YIFhveDznMHqxuuz+5vRxvVgpbdr8= github.com/smartcontractkit/chainlink-feeds v0.1.1 h1:JzvUOM/OgGQA1sOqTXXl52R6AnNt+Wg64sVG+XSA49c= diff --git a/core/scripts/keystone/ocr_config.json b/core/scripts/keystone/ocr_config.json index 31fe8988056..96691e48620 100644 --- a/core/scripts/keystone/ocr_config.json +++ b/core/scripts/keystone/ocr_config.json @@ -3,7 +3,7 @@ "MaxQueryLengthBytes": 1000000, "MaxObservationLengthBytes": 1000000, "MaxReportLengthBytes": 1000000, - "MaxRequestBatchSize": 1000, + "MaxBatchSize": 20, "UniqueReports": true, "DeltaProgressMillis": 5000, @@ -19,8 +19,8 @@ "MaxDurationQueryMillis": 1000, "MaxDurationObservationMillis": 1000, "MaxDurationReportMillis": 1000, - "MaxDurationAcceptMillis": 1000, - "MaxDurationTransmitMillis": 1000, + "MaxDurationShouldAcceptMillis": 1000, + "MaxDurationShouldTransmitMillis": 1000, "MaxFaultyOracles": 1 } diff --git a/core/scripts/keystone/src/generate_local_ocr3_config.go b/core/scripts/keystone/src/generate_local_ocr3_config.go index 68b1cade0c5..5dff8019179 100644 --- a/core/scripts/keystone/src/generate_local_ocr3_config.go +++ b/core/scripts/keystone/src/generate_local_ocr3_config.go @@ -76,7 +76,7 @@ func (g *generateLocalOCR3Config) Run(args []string) { "MaxQueryLengthBytes": 1000000, "MaxObservationLengthBytes": 1000000, "MaxReportLengthBytes": 1000000, - "MaxRequestBatchSize": 1000, + "MaxBatchSize": 20, "UniqueReports": true, "DeltaProgressMillis": 5000, "DeltaResendMillis": 5000, @@ -90,8 +90,8 @@ func (g *generateLocalOCR3Config) Run(args []string) { "MaxDurationQueryMillis": 1000, "MaxDurationObservationMillis": 1000, "MaxDurationReportMillis": 1000, - "MaxDurationAcceptMillis": 1000, - "MaxDurationTransmitMillis": 1000, + "MaxDurationShouldAcceptMillis": 1000, + "MaxDurationShouldTransmitMillis": 1000, "MaxFaultyOracles": 1}`) var cfg changeset.OracleConfig err = json.Unmarshal(config, &cfg) diff --git a/core/scripts/keystone/src/testdata/SampleConfig.json b/core/scripts/keystone/src/testdata/SampleConfig.json index 5d7893cb432..d39dc759af7 100644 --- a/core/scripts/keystone/src/testdata/SampleConfig.json +++ b/core/scripts/keystone/src/testdata/SampleConfig.json @@ -3,8 +3,9 @@ "MaxQueryLengthBytes": 1000000, "MaxObservationLengthBytes": 1000000, "MaxReportLengthBytes": 1000000, - "MaxRequestBatchSize": 1000, + "MaxBatchSize": 20, "UniqueReports": true, + "RequestTimeout": "30s", "DeltaProgressMillis": 5000, "DeltaResendMillis": 5000, "DeltaInitialMillis": 5000, @@ -19,8 +20,9 @@ "MaxDurationQueryMillis": 1000, "MaxDurationObservationMillis": 1000, "MaxDurationReportMillis": 1000, - "MaxDurationAcceptMillis": 1000, - "MaxDurationTransmitMillis": 1000, + "MaxDurationShouldAcceptMillis": 1000, + "MaxDurationShouldTransmitMillis": 1000, + "MaxFaultyOracles": 1 } } \ No newline at end of file diff --git a/deployment/environment/nodeclient/chainlink_models_test.go b/deployment/environment/nodeclient/chainlink_models_test.go index ae1e35eb33f..4f4c06dcbf2 100644 --- a/deployment/environment/nodeclient/chainlink_models_test.go +++ b/deployment/environment/nodeclient/chainlink_models_test.go @@ -6,6 +6,7 @@ import ( "github.com/stretchr/testify/require" "github.com/smartcontractkit/chainlink-common/pkg/codec" + "github.com/smartcontractkit/chainlink/v2/core/services/job" evmtypes "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/types" ) diff --git a/deployment/go.mod b/deployment/go.mod index aba9cc0aaec..f1a0f6fb3f3 100644 --- a/deployment/go.mod +++ b/deployment/go.mod @@ -7,7 +7,7 @@ replace github.com/smartcontractkit/chainlink/v2 => ../ // Using a separate inline `require` here to avoid surrounding line changes // creating potential merge conflicts. -require github.com/smartcontractkit/chainlink/v2 v2.0.0-20250128231431-9279badae2f0 +require github.com/smartcontractkit/chainlink/v2 v2.0.0-20250221182743-098d1b0a763a require ( github.com/Khan/genqlient v0.7.0 @@ -32,7 +32,7 @@ require ( github.com/smartcontractkit/chain-selectors v1.0.40 github.com/smartcontractkit/chainlink-ccip v0.0.0-20250224132459-c57ae4a97dcb 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-common v0.4.2-0.20250221174903-e1e47fdb11b0 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/job-distributor v0.9.0 diff --git a/deployment/go.sum b/deployment/go.sum index c37601139cf..df1bf1dc209 100644 --- a/deployment/go.sum +++ b/deployment/go.sum @@ -1138,8 +1138,8 @@ github.com/smartcontractkit/chainlink-ccip v0.0.0-20250224132459-c57ae4a97dcb h1 github.com/smartcontractkit/chainlink-ccip v0.0.0-20250224132459-c57ae4a97dcb/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= -github.com/smartcontractkit/chainlink-common v0.4.2-0.20250214231858-f365e2bdecea/go.mod h1:Z2e1ynSJ4pg83b4Qldbmryc5lmnrI3ojOdg1FUloa68= +github.com/smartcontractkit/chainlink-common v0.4.2-0.20250221174903-e1e47fdb11b0 h1:BTN2nQgFKBxgas6oqY3ym82O+wT++WlpP1+a6KzIfY0= +github.com/smartcontractkit/chainlink-common v0.4.2-0.20250221174903-e1e47fdb11b0/go.mod h1:YQuXIqQpmpAqstWV0LHaDTJ5nsSWuip5ivEM+Fisb+4= github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20250128203428-08031923fbe5 h1:CvDfgWoLoYPapOumE/UZCplfCu5oNmy9BuH+6V6+fJ8= github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20250128203428-08031923fbe5/go.mod h1:pDZagSGjs9U+l4YIFhveDznMHqxuuz+5vRxvVgpbdr8= github.com/smartcontractkit/chainlink-feeds v0.1.1 h1:JzvUOM/OgGQA1sOqTXXl52R6AnNt+Wg64sVG+XSA49c= diff --git a/deployment/keystone/changeset/accept_ownership.go b/deployment/keystone/changeset/accept_ownership.go index dd709523bc2..684df720164 100644 --- a/deployment/keystone/changeset/accept_ownership.go +++ b/deployment/keystone/changeset/accept_ownership.go @@ -5,8 +5,6 @@ import ( "github.com/ethereum/go-ethereum/common" - kslib "github.com/smartcontractkit/chainlink/deployment/keystone/changeset/internal" - "github.com/smartcontractkit/chainlink/deployment" "github.com/smartcontractkit/chainlink/deployment/common/changeset" ) @@ -25,7 +23,7 @@ func AcceptAllOwnershipsProposal(e deployment.Environment, req *AcceptAllOwnersh chain := e.Chains[chainSelector] addrBook := e.ExistingAddresses - r, err := kslib.GetContractSets(e.Logger, &kslib.GetContractSetsRequest{ + r, err := GetContractSets(e.Logger, &GetContractSetsRequest{ Chains: map[uint64]deployment.Chain{ req.ChainSelector: chain, }, diff --git a/deployment/keystone/changeset/append_node_capabilities.go b/deployment/keystone/changeset/append_node_capabilities.go index fcd20b856ad..c2c3739a566 100644 --- a/deployment/keystone/changeset/append_node_capabilities.go +++ b/deployment/keystone/changeset/append_node_capabilities.go @@ -70,7 +70,7 @@ func (req *AppendNodeCapabilitiesRequest) convert(e deployment.Environment) (*in return nil, nil, fmt.Errorf("failed to validate UpdateNodeCapabilitiesRequest: %w", err) } registryChain := e.Chains[req.RegistryChainSel] // exists because of the validation above - resp, err := internal.GetContractSets(e.Logger, &internal.GetContractSetsRequest{ + resp, err := GetContractSets(e.Logger, &GetContractSetsRequest{ Chains: map[uint64]deployment.Chain{req.RegistryChainSel: registryChain}, AddressBook: e.ExistingAddresses, }) diff --git a/deployment/keystone/changeset/compatiblity.go b/deployment/keystone/changeset/compatiblity.go index b7a6e1b7c95..96e665f2525 100644 --- a/deployment/keystone/changeset/compatiblity.go +++ b/deployment/keystone/changeset/compatiblity.go @@ -19,21 +19,6 @@ type TopLevelConfigSource = internal.TopLevelConfigSource // GenerateOCR3Config generates an OCR3 config var GenerateOCR3Config = internal.GenerateOCR3Config -// FeedConsumer is a feed consumer contract type -var FeedConsumer = internal.FeedConsumer - -// KeystoneForwarder is a keystone forwarder contract type -var KeystoneForwarder = internal.KeystoneForwarder - -// GetContractSetsRequest is a request to get contract sets -type GetContractSetsRequest = internal.GetContractSetsRequest - -// GetContractSetsResponse is a response to get contract sets -type GetContractSetsResponse = internal.GetContractSetsResponse - -// GetContractSets gets contract sets -var GetContractSets = internal.GetContractSets - // RegisterNOPSRequest is a request to register NOPS type RegisterNOPSRequest = internal.RegisterNOPSRequest @@ -87,5 +72,3 @@ type DONCapabilityWithConfig = internal.DONCapabilityWithConfig type DeployRequest = internal.DeployRequest type DeployResponse = internal.DeployResponse - -type ContractSet = internal.ContractSet diff --git a/deployment/keystone/changeset/deploy_forwarder.go b/deployment/keystone/changeset/deploy_forwarder.go index 8a9cdf4d681..feccc14b6ce 100644 --- a/deployment/keystone/changeset/deploy_forwarder.go +++ b/deployment/keystone/changeset/deploy_forwarder.go @@ -87,7 +87,7 @@ func ConfigureForwardContracts(env deployment.Environment, req ConfigureForwardC return deployment.ChangesetOutput{}, fmt.Errorf("failed to configure forward contracts: %w", err) } - cresp, err := internal.GetContractSets(env.Logger, &internal.GetContractSetsRequest{ + cresp, err := GetContractSets(env.Logger, &GetContractSetsRequest{ Chains: env.Chains, AddressBook: env.ExistingAddresses, }) diff --git a/deployment/keystone/changeset/deploy_ocr3.go b/deployment/keystone/changeset/deploy_ocr3.go index c9da8b81237..070c7ef59ce 100644 --- a/deployment/keystone/changeset/deploy_ocr3.go +++ b/deployment/keystone/changeset/deploy_ocr3.go @@ -84,7 +84,7 @@ func ConfigureOCR3Contract(env deployment.Environment, cfg ConfigureOCR3Config) if resp.Ops == nil { return out, errors.New("expected MCMS operation to be non-nil") } - r, err := kslib.GetContractSets(env.Logger, &kslib.GetContractSetsRequest{ + r, err := GetContractSets(env.Logger, &GetContractSetsRequest{ Chains: env.Chains, AddressBook: env.ExistingAddresses, }) diff --git a/deployment/keystone/changeset/internal/deploy.go b/deployment/keystone/changeset/internal/deploy.go index bed5fd5e23c..e67ea047d7d 100644 --- a/deployment/keystone/changeset/internal/deploy.go +++ b/deployment/keystone/changeset/internal/deploy.go @@ -317,7 +317,7 @@ func ConfigureOCR3Contract(env *deployment.Environment, chainSel uint64, dons [] return fmt.Errorf("failed to get contract set for chain %d", chainSel) } - contract, err := contracts.GetOCR3Contract(nil) + contract, err := contracts.getOCR3Contract(nil) if err != nil { env.Logger.Errorf("failed to get OCR3 contract: %s", err) return fmt.Errorf("failed to get OCR3 contract: %w", err) @@ -375,7 +375,7 @@ func ConfigureOCR3ContractFromJD(env *deployment.Environment, cfg ConfigureOCR3C return nil, fmt.Errorf("failed to get contract set for chain %d", cfg.ChainSel) } - contract, err := contracts.GetOCR3Contract(cfg.Address) + contract, err := contracts.getOCR3Contract(cfg.Address) if err != nil { env.Logger.Errorf("%sfailed to get OCR3 contract at %s : %s", prefix, cfg.Address, err) return nil, fmt.Errorf("failed to get OCR3 contract: %w", err) diff --git a/deployment/keystone/changeset/internal/ocr3config.go b/deployment/keystone/changeset/internal/ocr3config.go index e8038134f02..39f1c3817b2 100644 --- a/deployment/keystone/changeset/internal/ocr3config.go +++ b/deployment/keystone/changeset/internal/ocr3config.go @@ -13,11 +13,15 @@ import ( "time" "github.com/ethereum/go-ethereum/common" - mcmstypes "github.com/smartcontractkit/mcms/types" + "google.golang.org/protobuf/proto" + "google.golang.org/protobuf/types/known/durationpb" "github.com/smartcontractkit/libocr/offchainreporting2plus/confighelper" "github.com/smartcontractkit/libocr/offchainreporting2plus/ocr3confighelper" "github.com/smartcontractkit/libocr/offchainreporting2plus/types" + mcmstypes "github.com/smartcontractkit/mcms/types" + + capocr3types "github.com/smartcontractkit/chainlink-common/pkg/capabilities/consensus/ocr3/types" "github.com/smartcontractkit/chainlink/deployment" "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" @@ -35,8 +39,12 @@ type OracleConfig struct { MaxQueryLengthBytes uint32 MaxObservationLengthBytes uint32 MaxReportLengthBytes uint32 - MaxRequestBatchSize uint32 + MaxOutcomeLengthBytes uint32 + MaxReportCount uint32 + MaxBatchSize uint32 + OutcomePruningThreshold uint64 UniqueReports bool + RequestTimeout time.Duration DeltaProgressMillis uint32 DeltaResendMillis uint32 @@ -48,14 +56,50 @@ type OracleConfig struct { MaxRoundsPerEpoch uint64 TransmissionSchedule []int - MaxDurationQueryMillis uint32 - MaxDurationObservationMillis uint32 - MaxDurationAcceptMillis uint32 - MaxDurationTransmitMillis uint32 + MaxDurationQueryMillis uint32 + MaxDurationObservationMillis uint32 + MaxDurationShouldAcceptMillis uint32 + MaxDurationShouldTransmitMillis uint32 MaxFaultyOracles int } +func (oc *OracleConfig) UnmarshalJSON(data []byte) error { + type aliasT OracleConfig + temp := &struct { + RequestTimeout string `json:"RequestTimeout"` + *aliasT + }{ + aliasT: (*aliasT)(oc), + } + if err := json.Unmarshal(data, temp); err != nil { + return fmt.Errorf("failed to unmarshal OracleConfig: %w", err) + } + + if temp.RequestTimeout == "" { + oc.RequestTimeout = 0 + } else { + requestTimeout, err := time.ParseDuration(temp.RequestTimeout) + if err != nil { + return fmt.Errorf("failed to parse RequestTimeout: %w", err) + } + oc.RequestTimeout = requestTimeout + } + + return nil +} + +func (oc OracleConfig) MarshalJSON() ([]byte, error) { + type aliasT OracleConfig + return json.Marshal(&struct { + RequestTimeout string `json:"RequestTimeout"` + *aliasT + }{ + RequestTimeout: oc.RequestTimeout.String(), + aliasT: (*aliasT)(&oc), + }) +} + type NodeKeys struct { EthAddress string `json:"EthAddress"` AptosAccount string `json:"AptosAccount"` @@ -202,7 +246,7 @@ func GenerateOCR3Config(cfg OracleConfig, nca []NodeKeys, secrets deployment.OCR return OCR2OracleConfig{}, fmt.Errorf("wrong num elements copied from ocr2 offchain public key. expected %d but got %d", ed25519.PublicKeySize, nCopied) } - offchainPubKeysBytes = append(offchainPubKeysBytes, types.OffchainPublicKey(pkBytesFixed)) + offchainPubKeysBytes = append(offchainPubKeysBytes, pkBytesFixed) } configPubKeysBytes := []types.ConfigEncryptionPublicKey{} @@ -218,7 +262,7 @@ func GenerateOCR3Config(cfg OracleConfig, nca []NodeKeys, secrets deployment.OCR return OCR2OracleConfig{}, fmt.Errorf("wrong num elements copied from ocr2 config public key. expected %d but got %d", ed25519.PublicKeySize, n) } - configPubKeysBytes = append(configPubKeysBytes, types.ConfigEncryptionPublicKey(pkBytesFixed)) + configPubKeysBytes = append(configPubKeysBytes, pkBytesFixed) } identities := []confighelper.OracleIdentityExtra{} @@ -234,6 +278,26 @@ func GenerateOCR3Config(cfg OracleConfig, nca []NodeKeys, secrets deployment.OCR }) } + // let's keep reqTimeout as nil if it's 0, so we can use the default value within `chainlink-common`. + // See: https://github.com/smartcontractkit/chainlink-common/blob/main/pkg/capabilities/consensus/ocr3/factory.go#L73 + var reqTimeout *durationpb.Duration + if cfg.RequestTimeout > 0 { + reqTimeout = durationpb.New(cfg.RequestTimeout) + } + cfgBytes, err := proto.Marshal(&capocr3types.ReportingPluginConfig{ + MaxQueryLengthBytes: cfg.MaxQueryLengthBytes, + MaxObservationLengthBytes: cfg.MaxObservationLengthBytes, + MaxReportLengthBytes: cfg.MaxReportLengthBytes, + MaxOutcomeLengthBytes: cfg.MaxOutcomeLengthBytes, + MaxReportCount: cfg.MaxReportCount, + MaxBatchSize: cfg.MaxBatchSize, + OutcomePruningThreshold: cfg.OutcomePruningThreshold, + RequestTimeout: reqTimeout, + }) + if err != nil { + return OCR2OracleConfig{}, fmt.Errorf("failed to marshal ReportingPluginConfig: %w", err) + } + signers, transmitters, f, onchainConfig, offchainConfigVersion, offchainConfig, err := ocr3confighelper.ContractSetConfigArgsDeterministic( secrets.EphemeralSk, secrets.SharedSecret, @@ -247,12 +311,12 @@ func GenerateOCR3Config(cfg OracleConfig, nca []NodeKeys, secrets deployment.OCR cfg.MaxRoundsPerEpoch, cfg.TransmissionSchedule, identities, - nil, // reportingPluginConfig - nil, // maxDurationInitialization + cfgBytes, // reportingPluginConfig + nil, // maxDurationInitialization time.Duration(cfg.MaxDurationQueryMillis)*time.Millisecond, time.Duration(cfg.MaxDurationObservationMillis)*time.Millisecond, - time.Duration(cfg.MaxDurationAcceptMillis)*time.Millisecond, - time.Duration(cfg.MaxDurationTransmitMillis)*time.Millisecond, + time.Duration(cfg.MaxDurationShouldAcceptMillis)*time.Millisecond, + time.Duration(cfg.MaxDurationShouldTransmitMillis)*time.Millisecond, cfg.MaxFaultyOracles, nil, // empty onChain config ) diff --git a/deployment/keystone/changeset/internal/ocr3config_test.go b/deployment/keystone/changeset/internal/ocr3config_test.go index 6703f4d9b04..1c7f8e5b7ef 100644 --- a/deployment/keystone/changeset/internal/ocr3config_test.go +++ b/deployment/keystone/changeset/internal/ocr3config_test.go @@ -49,7 +49,7 @@ var wantOCR3Config = `{ "F": 3, "OnchainConfig": "0x", "OffchainConfigVersion": 30, - "OffchainConfig": "0xc80180e497d012d00180e497d012d80180a8d6b907e00180cab5ee01e80180d88ee16ff0010afa01010a82022003dacd15fc96c965c648e3623180de002b71a97cf6eeca9affb91f461dcd6ce1820220255096a3b7ade10e29c648e0b407fc486180464f713446b1da04f013df6179c8820220dba3c61e5f8bec594be481bcaf67ecea0d1c2950edb15b158ce3dbc77877def3820220b4c4993d6c15fee63800db901a8b35fa419057610962caab1c1d7bed557091278202202a4c7dec127fdd8145e48c5edb9467225098bd8c8ad1dade868325b787affbde820220283471ed66d61fbe11f64eff65d738b59a0301c9a4f846280db26c64c9fdd3f8820220aa3419628ea3536783742d17d8adf05681aa6a6bd2b206fbde78c7e5aa38586d82022001496edce35663071d74472e02119432ba059b3904d205e4358014410e4f2be3820220ad08c2a5878cada53521f4e2bb449f191ccca7899246721a0deeea19f7b83f70820220c805572b813a072067eab2087ddbee8aa719090e12890b15c01094f0d3f74a5f8a02008a02008a02008a02008a02008a02008a02008a02008a02008a020098028094ebdc03a0028094ebdc03a8028094ebdc03b0028094ebdc03ba02f8010a20da47a8cc1c10796dd43f98ed113c648625e2e504c16ac5da9c65669e2377241b1220f5beca3bb11406079dc174183105c474c862a73c257ce8b3d9f5ca065e6264691a10805015e4203740495a23e93c1bd06ba81a10ca58ff36ffb0545dc3f800ddd6f8d0481a1076f664639ca8b5209e488895faa5460f1a104a1e89a7f2d8c89158f18856bf289c2a1a10c2f4330787831f419713ad4990e347d31a10fd403ec0797c001a2794b51d6178916d1a10e14fff88fdd3d1554ed861104ddc56a81a10b0284b9817fec2c3066c6f2651d17fc41a10b090233a67d502f78191c9e19a2a032b1a10e483414860bb612af50ee15ce8cd8ef5c00280e497d012c8028094ebdc03" + "OffchainConfig": "0xc80180e497d012d00180e497d012d80180a8d6b907e00180cab5ee01e80180d88ee16ff0010afa01010a82022003dacd15fc96c965c648e3623180de002b71a97cf6eeca9affb91f461dcd6ce1820220255096a3b7ade10e29c648e0b407fc486180464f713446b1da04f013df6179c8820220dba3c61e5f8bec594be481bcaf67ecea0d1c2950edb15b158ce3dbc77877def3820220b4c4993d6c15fee63800db901a8b35fa419057610962caab1c1d7bed557091278202202a4c7dec127fdd8145e48c5edb9467225098bd8c8ad1dade868325b787affbde820220283471ed66d61fbe11f64eff65d738b59a0301c9a4f846280db26c64c9fdd3f8820220aa3419628ea3536783742d17d8adf05681aa6a6bd2b206fbde78c7e5aa38586d82022001496edce35663071d74472e02119432ba059b3904d205e4358014410e4f2be3820220ad08c2a5878cada53521f4e2bb449f191ccca7899246721a0deeea19f7b83f70820220c805572b813a072067eab2087ddbee8aa719090e12890b15c01094f0d3f74a5f8a02008a02008a02008a02008a02008a02008a02008a02008a02008a020092021b08c0843d10c0843d18c0843d20c0843d2814301438901c4202081e98028094ebdc03a0028094ebdc03a8028094ebdc03b0028094ebdc03ba02f8010a20da47a8cc1c10796dd43f98ed113c648625e2e504c16ac5da9c65669e2377241b1220f5beca3bb11406079dc174183105c474c862a73c257ce8b3d9f5ca065e6264691a10805015e4203740495a23e93c1bd06ba81a10ca58ff36ffb0545dc3f800ddd6f8d0481a1076f664639ca8b5209e488895faa5460f1a104a1e89a7f2d8c89158f18856bf289c2a1a10c2f4330787831f419713ad4990e347d31a10fd403ec0797c001a2794b51d6178916d1a10e14fff88fdd3d1554ed861104ddc56a81a10b0284b9817fec2c3066c6f2651d17fc41a10b090233a67d502f78191c9e19a2a032b1a10e483414860bb612af50ee15ce8cd8ef5c00280e497d012c8028094ebdc03" }` var ocr3Cfg = ` @@ -57,8 +57,12 @@ var ocr3Cfg = ` "MaxQueryLengthBytes": 1000000, "MaxObservationLengthBytes": 1000000, "MaxReportLengthBytes": 1000000, - "MaxRequestBatchSize": 1000, + "MaxOutcomeLengthBytes": 1000000, + "MaxReportCount": 20, + "MaxBatchSize": 20, + "OutcomePruningThreshold": 3600, "UniqueReports": true, + "RequestTimeout": "30s", "DeltaProgressMillis": 5000, "DeltaResendMillis": 5000, "DeltaInitialMillis": 5000, @@ -73,8 +77,8 @@ var ocr3Cfg = ` "MaxDurationQueryMillis": 1000, "MaxDurationObservationMillis": 1000, "MaxDurationReportMillis": 1000, - "MaxDurationAcceptMillis": 1000, - "MaxDurationTransmitMillis": 1000, + "MaxDurationShouldAcceptMillis": 1000, + "MaxDurationShouldTransmitMillis": 1000, "MaxFaultyOracles": 3 }` diff --git a/deployment/keystone/changeset/internal/state.go b/deployment/keystone/changeset/internal/state.go index 1a4a1ea34aa..2c68688b67b 100644 --- a/deployment/keystone/changeset/internal/state.go +++ b/deployment/keystone/changeset/internal/state.go @@ -10,8 +10,7 @@ import ( "github.com/smartcontractkit/chainlink/deployment" commonchangeset "github.com/smartcontractkit/chainlink/deployment/common/changeset" - common_v1_0 "github.com/smartcontractkit/chainlink/deployment/common/view/v1_0" - "github.com/smartcontractkit/chainlink/deployment/keystone/view" + capabilities_registry "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/keystone/generated/capabilities_registry_1_1_0" forwarder "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/keystone/generated/forwarder_1_0_0" ocr3_capability "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/keystone/generated/ocr3_capability_1_0_0" @@ -32,7 +31,10 @@ type GetContractSetsResponse struct { ContractSets map[uint64]ContractSet } -// TODO move this out of internal +// ContractSet is a set of contracts for a single chain +// It is a mirror of changeset.ContractSet, and acts an an adapter to the internal package +// +// TODO: remove after CRE-227 type ContractSet struct { commonchangeset.MCMSWithTimelockState OCR3 map[common.Address]*ocr3_capability.OCR3Capability @@ -41,52 +43,7 @@ type ContractSet struct { WorkflowRegistry *workflow_registry.WorkflowRegistry } -func (cs ContractSet) TransferableContracts() []common.Address { - var out []common.Address - if cs.OCR3 != nil { - for _, ocr := range cs.OCR3 { - out = append(out, ocr.Address()) - } - } - if cs.Forwarder != nil { - out = append(out, cs.Forwarder.Address()) - } - if cs.CapabilitiesRegistry != nil { - out = append(out, cs.CapabilitiesRegistry.Address()) - } - if cs.WorkflowRegistry != nil { - out = append(out, cs.WorkflowRegistry.Address()) - } - return out -} - -func (cs ContractSet) View() (view.KeystoneChainView, error) { - out := view.NewKeystoneChainView() - if cs.CapabilitiesRegistry != nil { - capRegView, err := common_v1_0.GenerateCapabilityRegistryView(cs.CapabilitiesRegistry) - if err != nil { - return view.KeystoneChainView{}, err - } - out.CapabilityRegistry[cs.CapabilitiesRegistry.Address().String()] = capRegView - } - - // Process the workflow registry and print if WorkflowRegistryError errors. - if cs.WorkflowRegistry != nil { - wrView, wrErrs := common_v1_0.GenerateWorkflowRegistryView(cs.WorkflowRegistry) - for _, err := range wrErrs { - var wre *common_v1_0.WorkflowRegistryError - if !errors.As(err, &wre) { - return view.KeystoneChainView{}, err - } - fmt.Println("WorkflowRegistry error:", err) - } - out.WorkflowRegistry[cs.WorkflowRegistry.Address().String()] = wrView - } - - return out, nil -} - -func (cs ContractSet) GetOCR3Contract(addr *common.Address) (*ocr3_capability.OCR3Capability, error) { +func (cs ContractSet) getOCR3Contract(addr *common.Address) (*ocr3_capability.OCR3Capability, error) { return getOCR3Contract(cs.OCR3, addr) } diff --git a/deployment/keystone/changeset/internal/state_test.go b/deployment/keystone/changeset/internal/state_test.go index bfed62266ca..057cad4c10c 100644 --- a/deployment/keystone/changeset/internal/state_test.go +++ b/deployment/keystone/changeset/internal/state_test.go @@ -8,6 +8,7 @@ import ( chainsel "github.com/smartcontractkit/chain-selectors" "github.com/smartcontractkit/chainlink-common/pkg/logger" + "github.com/smartcontractkit/chainlink/deployment" commonchangeset "github.com/smartcontractkit/chainlink/deployment/common/changeset" "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" diff --git a/deployment/keystone/changeset/state.go b/deployment/keystone/changeset/state.go new file mode 100644 index 00000000000..be7f63b7410 --- /dev/null +++ b/deployment/keystone/changeset/state.go @@ -0,0 +1,213 @@ +package changeset + +import ( + "errors" + "fmt" + + "github.com/ethereum/go-ethereum/common" + + "github.com/smartcontractkit/chainlink-common/pkg/logger" + + "github.com/smartcontractkit/chainlink/deployment" + commonchangeset "github.com/smartcontractkit/chainlink/deployment/common/changeset" + common_v1_0 "github.com/smartcontractkit/chainlink/deployment/common/view/v1_0" + "github.com/smartcontractkit/chainlink/deployment/keystone/changeset/internal" + + capabilities_registry "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/keystone/generated/capabilities_registry_1_1_0" + forwarder "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/keystone/generated/forwarder_1_0_0" + ocr3_capability "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/keystone/generated/ocr3_capability_1_0_0" + workflow_registry "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/workflow/generated/workflow_registry_wrapper" +) + +type GetContractSetsRequest struct { + Chains map[uint64]deployment.Chain + AddressBook deployment.AddressBook +} + +type GetContractSetsResponse struct { + ContractSets map[uint64]ContractSet +} + +type ContractSet struct { + commonchangeset.MCMSWithTimelockState + OCR3 map[common.Address]*ocr3_capability.OCR3Capability + Forwarder *forwarder.KeystoneForwarder + CapabilitiesRegistry *capabilities_registry.CapabilitiesRegistry + WorkflowRegistry *workflow_registry.WorkflowRegistry +} + +func (cs ContractSet) Convert() internal.ContractSet { + return internal.ContractSet{ + MCMSWithTimelockState: commonchangeset.MCMSWithTimelockState{ + MCMSWithTimelockContracts: cs.MCMSWithTimelockContracts, + }, + Forwarder: cs.Forwarder, + WorkflowRegistry: cs.WorkflowRegistry, + OCR3: cs.OCR3, + CapabilitiesRegistry: cs.CapabilitiesRegistry, + } +} + +func (cs ContractSet) TransferableContracts() []common.Address { + var out []common.Address + if cs.OCR3 != nil { + for _, ocr := range cs.OCR3 { + out = append(out, ocr.Address()) + } + } + if cs.Forwarder != nil { + out = append(out, cs.Forwarder.Address()) + } + if cs.CapabilitiesRegistry != nil { + out = append(out, cs.CapabilitiesRegistry.Address()) + } + if cs.WorkflowRegistry != nil { + out = append(out, cs.WorkflowRegistry.Address()) + } + return out +} + +// View is a view of the keystone chain +// It is best effort and logs errors +func (cs ContractSet) View(lggr logger.Logger) (KeystoneChainView, error) { + out := NewKeystoneChainView() + var allErrs error + if cs.CapabilitiesRegistry != nil { + capRegView, err := common_v1_0.GenerateCapabilityRegistryView(cs.CapabilitiesRegistry) + if err != nil { + allErrs = errors.Join(allErrs, err) + lggr.Warn("failed to generate capability registry view: %w", err) + } + out.CapabilityRegistry[cs.CapabilitiesRegistry.Address().String()] = capRegView + } + + if cs.OCR3 != nil { + for addr, ocr3Cap := range cs.OCR3 { + oc := *ocr3Cap + addrCopy := addr + ocrView, err := GenerateOCR3ConfigView(oc) + if err != nil { + allErrs = errors.Join(allErrs, err) + // don't block view on single OCR3 not being configured + if errors.Is(err, ErrOCR3NotConfigured) { + lggr.Warnf("ocr3 not configured for address %s", addr) + } else { + lggr.Errorf("failed to generate OCR3 config view: %v", err) + } + } + out.OCRContracts[addrCopy.String()] = ocrView + } + } + + // Process the workflow registry and print if WorkflowRegistryError errors. + if cs.WorkflowRegistry != nil { + wrView, wrErrs := common_v1_0.GenerateWorkflowRegistryView(cs.WorkflowRegistry) + for _, err := range wrErrs { + allErrs = errors.Join(allErrs, err) + lggr.Errorf("WorkflowRegistry error: %v", err) + } + out.WorkflowRegistry[cs.WorkflowRegistry.Address().String()] = wrView + } + + return out, allErrs +} + +func (cs ContractSet) GetOCR3Contract(addr *common.Address) (*ocr3_capability.OCR3Capability, error) { + return getOCR3Contract(cs.OCR3, addr) +} + +func GetContractSets(lggr logger.Logger, req *GetContractSetsRequest) (*GetContractSetsResponse, error) { + resp := &GetContractSetsResponse{ + ContractSets: make(map[uint64]ContractSet), + } + for id, chain := range req.Chains { + addrs, err := req.AddressBook.AddressesForChain(id) + if err != nil { + return nil, fmt.Errorf("failed to get addresses for chain %d: %w", id, err) + } + cs, err := loadContractSet(lggr, chain, addrs) + if err != nil { + return nil, fmt.Errorf("failed to load contract set for chain %d: %w", id, err) + } + resp.ContractSets[id] = *cs + } + return resp, nil +} + +func loadContractSet(lggr logger.Logger, chain deployment.Chain, addresses map[string]deployment.TypeAndVersion) (*ContractSet, error) { + var out ContractSet + mcmsWithTimelock, err := commonchangeset.MaybeLoadMCMSWithTimelockChainState(chain, addresses) + if err != nil { + return nil, fmt.Errorf("failed to load mcms contract: %w", err) + } + out.MCMSWithTimelockState = *mcmsWithTimelock + + for addr, tv := range addresses { + // todo handle versions + switch tv.Type { + case CapabilitiesRegistry: + c, err := capabilities_registry.NewCapabilitiesRegistry(common.HexToAddress(addr), chain.Client) + if err != nil { + return nil, fmt.Errorf("failed to create capability registry contract from address %s: %w", addr, err) + } + out.CapabilitiesRegistry = c + case KeystoneForwarder: + c, err := forwarder.NewKeystoneForwarder(common.HexToAddress(addr), chain.Client) + if err != nil { + return nil, fmt.Errorf("failed to create forwarder contract from address %s: %w", addr, err) + } + out.Forwarder = c + case OCR3Capability: + c, err := ocr3_capability.NewOCR3Capability(common.HexToAddress(addr), chain.Client) + if err != nil { + return nil, fmt.Errorf("failed to create OCR3Capability contract from address %s: %w", addr, err) + } + if out.OCR3 == nil { + out.OCR3 = make(map[common.Address]*ocr3_capability.OCR3Capability) + } + out.OCR3[common.HexToAddress(addr)] = c + case WorkflowRegistry: + c, err := workflow_registry.NewWorkflowRegistry(common.HexToAddress(addr), chain.Client) + if err != nil { + return nil, fmt.Errorf("failed to create OCR3Capability contract from address %s: %w", addr, err) + } + out.WorkflowRegistry = c + default: + lggr.Warnw("unknown contract type", "type", tv.Type) + // ignore unknown contract types + } + } + return &out, nil +} + +// getOCR3Contract returns the OCR3 contract from the contract set. By default, it returns the only +// contract in the set if there is no address specified. If an address is specified, it returns the +// contract with that address. If the address is specified but not found in the contract set, it returns +// an error. +func getOCR3Contract(contracts map[common.Address]*ocr3_capability.OCR3Capability, addr *common.Address) (*ocr3_capability.OCR3Capability, error) { + // Fail if the OCR3 contract address is unspecified and there are multiple OCR3 contracts + if addr == nil && len(contracts) > 1 { + return nil, errors.New("OCR contract address is unspecified") + } + + // Use the first OCR3 contract if the address is unspecified + if addr == nil && len(contracts) == 1 { + // use the first OCR3 contract + for _, c := range contracts { + return c, nil + } + } + + // Select the OCR3 contract by address + if contract, ok := contracts[*addr]; ok { + return contract, nil + } + + addrSet := make([]string, 0, len(contracts)) + for a := range contracts { + addrSet = append(addrSet, a.String()) + } + + // Fail if the OCR3 contract address is specified but not found in the contract set + return nil, fmt.Errorf("OCR3 contract address %s not found in contract set %v", *addr, addrSet) +} diff --git a/deployment/keystone/changeset/test/env_setup.go b/deployment/keystone/changeset/test/env_setup.go index 2bce7fd3db7..036762dade6 100644 --- a/deployment/keystone/changeset/test/env_setup.go +++ b/deployment/keystone/changeset/test/env_setup.go @@ -21,7 +21,7 @@ import ( commontypes "github.com/smartcontractkit/chainlink/deployment/common/types" "github.com/smartcontractkit/chainlink/deployment/environment/memory" envtest "github.com/smartcontractkit/chainlink/deployment/environment/test" - kschangeset "github.com/smartcontractkit/chainlink/deployment/keystone/changeset" + changeset "github.com/smartcontractkit/chainlink/deployment/keystone/changeset" "github.com/smartcontractkit/chainlink/deployment/keystone/changeset/internal" "github.com/smartcontractkit/chainlink/deployment/keystone/changeset/workflowregistry" @@ -51,7 +51,7 @@ func (c DonConfig) Validate() error { } type testEnvIface interface { - ContractSets() map[uint64]internal.ContractSet + ContractSets() map[uint64]changeset.ContractSet CapabilitiesRegistry() *kcr.CapabilitiesRegistry CapabilityInfos() []kcr.CapabilitiesRegistryCapabilityInfo Nops() []kcr.CapabilitiesRegistryNodeOperatorAdded @@ -102,8 +102,8 @@ type EnvWrapper struct { dons testDons } -func (te EnvWrapper) ContractSets() map[uint64]internal.ContractSet { - r, err := internal.GetContractSets(te.Env.Logger, &internal.GetContractSetsRequest{ +func (te EnvWrapper) ContractSets() map[uint64]changeset.ContractSet { + r, err := changeset.GetContractSets(te.Env.Logger, &changeset.GetContractSetsRequest{ Chains: te.Env.Chains, AddressBook: te.Env.ExistingAddresses, }) @@ -112,7 +112,7 @@ func (te EnvWrapper) ContractSets() map[uint64]internal.ContractSet { } func (te EnvWrapper) CapabilitiesRegistry() *kcr.CapabilitiesRegistry { - r, err := internal.GetContractSets(te.Env.Logger, &internal.GetContractSetsRequest{ + r, err := changeset.GetContractSets(te.Env.Logger, &changeset.GetContractSetsRequest{ Chains: te.Env.Chains, AddressBook: te.Env.ExistingAddresses, }) @@ -161,16 +161,16 @@ func initEnv(t *testing.T, nChains int) (registryChainSel uint64, env deployment } env, err := commonchangeset.Apply(t, env, nil, commonchangeset.Configure( - deployment.CreateLegacyChangeSet(kschangeset.DeployCapabilityRegistry), + deployment.CreateLegacyChangeSet(changeset.DeployCapabilityRegistry), registryChainSel, ), commonchangeset.Configure( - deployment.CreateLegacyChangeSet(kschangeset.DeployOCR3), + deployment.CreateLegacyChangeSet(changeset.DeployOCR3), registryChainSel, ), commonchangeset.Configure( - deployment.CreateLegacyChangeSet(kschangeset.DeployForwarder), - kschangeset.DeployForwarderRequest{}, + deployment.CreateLegacyChangeSet(changeset.DeployForwarder), + changeset.DeployForwarderRequest{}, ), commonchangeset.Configure( deployment.CreateLegacyChangeSet(workflowregistry.Deploy), @@ -263,7 +263,7 @@ func setupTestEnv(t *testing.T, c EnvWrapperConfig) EnvWrapper { } var allDons = []internal.DonCapabilities{wfDonCapabilities, cwDonCapabilities, assetDonCapabilities} - csOut, err := kschangeset.ConfigureInitialContractsChangeset(env, kschangeset.InitialContractsCfg{ + csOut, err := changeset.ConfigureInitialContractsChangeset(env, changeset.InitialContractsCfg{ RegistryChainSel: registryChainSel, Dons: allDons, OCR3Config: &ocr3Config, @@ -271,12 +271,12 @@ func setupTestEnv(t *testing.T, c EnvWrapperConfig) EnvWrapper { require.NoError(t, err) require.Nil(t, csOut.AddressBook, "no new addresses should be created in configure initial contracts") - req := &internal.GetContractSetsRequest{ + req := &changeset.GetContractSetsRequest{ Chains: env.Chains, AddressBook: env.ExistingAddresses, } - contractSetsResp, err := internal.GetContractSets(lggr, req) + contractSetsResp, err := changeset.GetContractSets(lggr, req) require.NoError(t, err) require.Len(t, contractSetsResp.ContractSets, len(env.Chains)) // check the registry @@ -311,7 +311,7 @@ func setupTestEnv(t *testing.T, c EnvWrapperConfig) EnvWrapper { ) require.NoError(t, err) // extract the MCMS address - r, err := internal.GetContractSets(lggr, &internal.GetContractSetsRequest{ + r, err := changeset.GetContractSets(lggr, &changeset.GetContractSetsRequest{ Chains: env.Chains, AddressBook: env.ExistingAddresses, }) @@ -327,8 +327,8 @@ func setupTestEnv(t *testing.T, c EnvWrapperConfig) EnvWrapper { sel: {Timelock: mcms.Timelock, CallProxy: mcms.CallProxy}, }, commonchangeset.Configure( - deployment.CreateLegacyChangeSet(kschangeset.AcceptAllOwnershipsProposal), - &kschangeset.AcceptAllOwnershipRequest{ + deployment.CreateLegacyChangeSet(changeset.AcceptAllOwnershipsProposal), + &changeset.AcceptAllOwnershipRequest{ ChainSelector: sel, MinDelay: 0, }, diff --git a/deployment/keystone/changeset/types.go b/deployment/keystone/changeset/types.go new file mode 100644 index 00000000000..ae5718c4e3f --- /dev/null +++ b/deployment/keystone/changeset/types.go @@ -0,0 +1,13 @@ +package changeset + +import "github.com/smartcontractkit/chainlink/deployment" + +var ( + CapabilitiesRegistry deployment.ContractType = "CapabilitiesRegistry" // https://github.com/smartcontractkit/chainlink/blob/50c1b3dbf31bd145b312739b08967600a5c67f30/contracts/src/v0.8/keystone/CapabilitiesRegistry.sol#L392 + WorkflowRegistry deployment.ContractType = "WorkflowRegistry" // https://github.com/smartcontractkit/chainlink/blob/develop/contracts/src/v0.8/workflow/WorkflowRegistry.sol + KeystoneForwarder deployment.ContractType = "KeystoneForwarder" // https://github.com/smartcontractkit/chainlink/blob/50c1b3dbf31bd145b312739b08967600a5c67f30/contracts/src/v0.8/keystone/KeystoneForwarder.sol#L90 + OCR3Capability deployment.ContractType = "OCR3Capability" // https://github.com/smartcontractkit/chainlink/blob/50c1b3dbf31bd145b312739b08967600a5c67f30/contracts/src/v0.8/keystone/OCR3Capability.sol#L12 + FeedConsumer deployment.ContractType = "FeedConsumer" // no type and a version in contract https://github.com/smartcontractkit/chainlink/blob/89183a8a5d22b1aeca0ade3b76d16aa84067aa57/contracts/src/v0.8/keystone/KeystoneFeedsConsumer.sol#L1 + RBACTimelock deployment.ContractType = "RBACTimelock" // no type and a version in contract https://github.com/smartcontractkit/ccip-owner-contracts/blob/main/src/RBACTimelock.sol + ProposerManyChainMultiSig deployment.ContractType = "ProposerManyChainMultiSig" // no type and a version in contract https://github.com/smartcontractkit/ccip-owner-contracts/blob/main/src/ManyChainMultiSig.sol +) diff --git a/deployment/keystone/changeset/update_don.go b/deployment/keystone/changeset/update_don.go index 7d02db0eda0..aa942a60542 100644 --- a/deployment/keystone/changeset/update_don.go +++ b/deployment/keystone/changeset/update_don.go @@ -98,7 +98,7 @@ func appendRequest(r *UpdateDonRequest) *AppendNodeCapabilitiesRequest { } func updateDonRequest(env deployment.Environment, r *UpdateDonRequest) (*internal.UpdateDonRequest, error) { - resp, err := internal.GetContractSets(env.Logger, &internal.GetContractSetsRequest{ + resp, err := GetContractSets(env.Logger, &GetContractSetsRequest{ Chains: env.Chains, AddressBook: env.ExistingAddresses, }) diff --git a/deployment/keystone/changeset/update_node_capabilities.go b/deployment/keystone/changeset/update_node_capabilities.go index 38cd8b6dfb5..6a9a22a78a9 100644 --- a/deployment/keystone/changeset/update_node_capabilities.go +++ b/deployment/keystone/changeset/update_node_capabilities.go @@ -85,7 +85,7 @@ func (req *MutateNodeCapabilitiesRequest) updateNodeCapabilitiesImplRequest(e de return nil, nil, fmt.Errorf("failed to validate UpdateNodeCapabilitiesRequest: %w", err) } registryChain := e.Chains[req.RegistryChainSel] // exists because of the validation above - resp, err := internal.GetContractSets(e.Logger, &internal.GetContractSetsRequest{ + resp, err := GetContractSets(e.Logger, &GetContractSetsRequest{ Chains: map[uint64]deployment.Chain{req.RegistryChainSel: registryChain}, AddressBook: e.ExistingAddresses, }) diff --git a/deployment/keystone/changeset/update_nodes.go b/deployment/keystone/changeset/update_nodes.go index a09a2b86ced..70857ef41c7 100644 --- a/deployment/keystone/changeset/update_nodes.go +++ b/deployment/keystone/changeset/update_nodes.go @@ -63,7 +63,7 @@ func UpdateNodes(env deployment.Environment, req *UpdateNodesRequest) (deploymen if !ok { return deployment.ChangesetOutput{}, fmt.Errorf("registry chain selector %d does not exist in environment", req.RegistryChainSel) } - cresp, err := internal.GetContractSets(env.Logger, &internal.GetContractSetsRequest{ + cresp, err := GetContractSets(env.Logger, &GetContractSetsRequest{ Chains: env.Chains, AddressBook: env.ExistingAddresses, }) diff --git a/deployment/keystone/changeset/view.go b/deployment/keystone/changeset/view.go index f6f495fd30b..0a5667781ed 100644 --- a/deployment/keystone/changeset/view.go +++ b/deployment/keystone/changeset/view.go @@ -2,48 +2,61 @@ package changeset import ( "encoding/json" + "errors" "fmt" chainsel "github.com/smartcontractkit/chain-selectors" "github.com/smartcontractkit/chainlink/deployment" commonview "github.com/smartcontractkit/chainlink/deployment/common/view" - "github.com/smartcontractkit/chainlink/deployment/keystone/changeset/internal" - "github.com/smartcontractkit/chainlink/deployment/keystone/view" ) var _ deployment.ViewState = ViewKeystone func ViewKeystone(e deployment.Environment) (json.Marshaler, error) { - state, err := internal.GetContractSets(e.Logger, &internal.GetContractSetsRequest{ + lggr := e.Logger + state, err := GetContractSets(e.Logger, &GetContractSetsRequest{ Chains: e.Chains, AddressBook: e.ExistingAddresses, }) + // this error is unrecoverable if err != nil { - return nil, err + return nil, fmt.Errorf("failed to get contract sets: %w", err) } - chainViews := make(map[string]view.KeystoneChainView) + var viewErrs error + chainViews := make(map[string]KeystoneChainView) for chainSel, contracts := range state.ContractSets { chainid, err := chainsel.ChainIdFromSelector(chainSel) if err != nil { - return nil, fmt.Errorf("failed to resolve chain id for selector %d: %w", chainSel, err) + err2 := fmt.Errorf("failed to resolve chain id for selector %d: %w", chainSel, err) + lggr.Error(err2) + viewErrs = errors.Join(viewErrs, err2) + continue } chainName, err := chainsel.NameFromChainId(chainid) if err != nil { - return nil, fmt.Errorf("failed to get name for chainid %d selector %d:%w", chainid, chainSel, err) + err2 := fmt.Errorf("failed to resolve chain name for chain id %d: %w", chainid, err) + lggr.Error(err2) + viewErrs = errors.Join(viewErrs, err2) + continue } - v, err := contracts.View() + v, err := contracts.View(e.Logger) if err != nil { - return nil, fmt.Errorf("failed to view contract set: %w", err) + err2 := fmt.Errorf("failed to view chain %s: %w", chainName, err) + lggr.Error(err2) + viewErrs = errors.Join(viewErrs, err2) + // don't continue; add the partial view } chainViews[chainName] = v } nopsView, err := commonview.GenerateNopsView(e.NodeIDs, e.Offchain) if err != nil { - return nil, fmt.Errorf("failed to view nops: %w", err) + err2 := fmt.Errorf("failed to view nops: %w", err) + lggr.Error(err2) + viewErrs = errors.Join(viewErrs, err2) } - return &view.KeystoneView{ + return &KeystoneView{ Chains: chainViews, Nops: nopsView, - }, nil + }, viewErrs } diff --git a/deployment/keystone/changeset/view_contracts.go b/deployment/keystone/changeset/view_contracts.go new file mode 100644 index 00000000000..a5868f4d74e --- /dev/null +++ b/deployment/keystone/changeset/view_contracts.go @@ -0,0 +1,164 @@ +package changeset + +import ( + "encoding/hex" + "encoding/json" + "errors" + "math" + "time" + + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "google.golang.org/protobuf/proto" + + "github.com/smartcontractkit/libocr/offchainreporting2plus/ocr3confighelper" + ocr2types "github.com/smartcontractkit/libocr/offchainreporting2plus/types" + + capocr3types "github.com/smartcontractkit/chainlink-common/pkg/capabilities/consensus/ocr3/types" + + ocr3_capability "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/keystone/generated/ocr3_capability_1_0_0" + + "github.com/smartcontractkit/chainlink/deployment/common/view" + common_v1_0 "github.com/smartcontractkit/chainlink/deployment/common/view/v1_0" +) + +type KeystoneChainView struct { + CapabilityRegistry map[string]common_v1_0.CapabilityRegistryView `json:"capabilityRegistry,omitempty"` + // OCRContracts is a map of OCR3 contract addresses to their configuration view + OCRContracts map[string]OCR3ConfigView `json:"ocrContracts,omitempty"` + WorkflowRegistry map[string]common_v1_0.WorkflowRegistryView `json:"workflowRegistry,omitempty"` +} + +type OCR3ConfigView struct { + Signers []string `json:"signers"` + Transmitters []ocr2types.Account `json:"transmitters"` + F uint8 `json:"f"` + OnchainConfig []byte `json:"onchainConfig"` + OffchainConfigVersion uint64 `json:"offchainConfigVersion"` + OffchainConfig OracleConfig `json:"offchainConfig"` +} + +var ErrOCR3NotConfigured = errors.New("OCR3 not configured") + +func GenerateOCR3ConfigView(ocr3Cap ocr3_capability.OCR3Capability) (OCR3ConfigView, error) { + details, err := ocr3Cap.LatestConfigDetails(nil) + if err != nil { + return OCR3ConfigView{}, err + } + + blockNumber := uint64(details.BlockNumber) + configIterator, err := ocr3Cap.FilterConfigSet(&bind.FilterOpts{ + Start: blockNumber, + End: &blockNumber, + Context: nil, + }) + if err != nil { + return OCR3ConfigView{}, err + } + var config *ocr3_capability.OCR3CapabilityConfigSet + for configIterator.Next() { + // We wait for the iterator to receive an event + if configIterator.Event == nil { + return OCR3ConfigView{}, ErrOCR3NotConfigured + } + + config = configIterator.Event + } + if config == nil { + return OCR3ConfigView{}, ErrOCR3NotConfigured + } + + var signers []ocr2types.OnchainPublicKey + var readableSigners []string + for _, s := range config.Signers { + signers = append(signers, s) + readableSigners = append(readableSigners, hex.EncodeToString(s)) + } + var transmitters []ocr2types.Account + for _, t := range config.Transmitters { + transmitters = append(transmitters, ocr2types.Account(t.String())) + } + // `PublicConfigFromContractConfig` returns the `ocr2types.PublicConfig` that contains all the `OracleConfig` fields we need, including the + // report plugin config. + publicConfig, err := ocr3confighelper.PublicConfigFromContractConfig(true, ocr2types.ContractConfig{ + ConfigDigest: config.ConfigDigest, + ConfigCount: config.ConfigCount, + Signers: signers, + Transmitters: transmitters, + F: config.F, + OnchainConfig: nil, // empty onChain config, currently we always use a nil onchain config when calling SetConfig + OffchainConfigVersion: config.OffchainConfigVersion, + OffchainConfig: config.OffchainConfig, + }) + if err != nil { + return OCR3ConfigView{}, err + } + var cfg capocr3types.ReportingPluginConfig + if err = proto.Unmarshal(publicConfig.ReportingPluginConfig, &cfg); err != nil { + return OCR3ConfigView{}, err + } + oracleConfig := OracleConfig{ + MaxQueryLengthBytes: cfg.MaxQueryLengthBytes, + MaxObservationLengthBytes: cfg.MaxObservationLengthBytes, + MaxReportLengthBytes: cfg.MaxReportLengthBytes, + MaxOutcomeLengthBytes: cfg.MaxOutcomeLengthBytes, + MaxReportCount: cfg.MaxReportCount, + MaxBatchSize: cfg.MaxBatchSize, + OutcomePruningThreshold: cfg.OutcomePruningThreshold, + RequestTimeout: cfg.RequestTimeout.AsDuration(), + UniqueReports: true, // This is hardcoded to true in the OCR3 contract + + DeltaProgressMillis: millisecondsToUint32(publicConfig.DeltaProgress), + DeltaResendMillis: millisecondsToUint32(publicConfig.DeltaResend), + DeltaInitialMillis: millisecondsToUint32(publicConfig.DeltaInitial), + DeltaRoundMillis: millisecondsToUint32(publicConfig.DeltaRound), + DeltaGraceMillis: millisecondsToUint32(publicConfig.DeltaGrace), + DeltaCertifiedCommitRequestMillis: millisecondsToUint32(publicConfig.DeltaCertifiedCommitRequest), + DeltaStageMillis: millisecondsToUint32(publicConfig.DeltaStage), + MaxRoundsPerEpoch: publicConfig.RMax, + TransmissionSchedule: publicConfig.S, + + MaxDurationQueryMillis: millisecondsToUint32(publicConfig.MaxDurationQuery), + MaxDurationObservationMillis: millisecondsToUint32(publicConfig.MaxDurationObservation), + MaxDurationShouldAcceptMillis: millisecondsToUint32(publicConfig.MaxDurationShouldAcceptAttestedReport), + MaxDurationShouldTransmitMillis: millisecondsToUint32(publicConfig.MaxDurationShouldTransmitAcceptedReport), + + MaxFaultyOracles: publicConfig.F, + } + + return OCR3ConfigView{ + Signers: readableSigners, + Transmitters: transmitters, + F: config.F, + OnchainConfig: nil, // empty onChain config + OffchainConfigVersion: config.OffchainConfigVersion, + OffchainConfig: oracleConfig, + }, nil +} + +func millisecondsToUint32(dur time.Duration) uint32 { + ms := dur.Milliseconds() + if ms > int64(math.MaxUint32) { + return math.MaxUint32 + } + //nolint:gosec // disable G115 as it is practically impossible to overflow here + return uint32(ms) +} + +func NewKeystoneChainView() KeystoneChainView { + return KeystoneChainView{ + CapabilityRegistry: make(map[string]common_v1_0.CapabilityRegistryView), + OCRContracts: make(map[string]OCR3ConfigView), + WorkflowRegistry: make(map[string]common_v1_0.WorkflowRegistryView), + } +} + +type KeystoneView struct { + Chains map[string]KeystoneChainView `json:"chains,omitempty"` + Nops map[string]view.NopView `json:"nops,omitempty"` +} + +func (v KeystoneView) MarshalJSON() ([]byte, error) { + // Alias to avoid recursive calls + type Alias KeystoneView + return json.MarshalIndent(&struct{ Alias }{Alias: Alias(v)}, "", " ") +} diff --git a/deployment/keystone/changeset/view_test.go b/deployment/keystone/changeset/view_test.go index 5b32699fd89..aa21ba4619b 100644 --- a/deployment/keystone/changeset/view_test.go +++ b/deployment/keystone/changeset/view_test.go @@ -1,40 +1,135 @@ -package changeset +package changeset_test import ( + "bytes" + "encoding/json" "testing" + "time" + "github.com/ethereum/go-ethereum/common" "github.com/stretchr/testify/require" - "go.uber.org/zap/zapcore" - "github.com/smartcontractkit/chainlink-common/pkg/logger" + chain_selectors "github.com/smartcontractkit/chain-selectors" - "github.com/smartcontractkit/chainlink/deployment/environment/memory" + "github.com/smartcontractkit/chainlink/deployment/keystone/changeset" + "github.com/smartcontractkit/chainlink/deployment/keystone/changeset/internal" + "github.com/smartcontractkit/chainlink/deployment/keystone/changeset/test" ) +var oracleConfig = changeset.OracleConfig{ + DeltaProgressMillis: 30000, + DeltaResendMillis: 5000, + DeltaInitialMillis: 5000, + DeltaRoundMillis: 2000, + DeltaGraceMillis: 500, + DeltaCertifiedCommitRequestMillis: 1000, + DeltaStageMillis: 30000, + MaxRoundsPerEpoch: 10, + TransmissionSchedule: []int{}, + MaxDurationQueryMillis: 1000, + MaxDurationObservationMillis: 1000, + MaxDurationShouldAcceptMillis: 1000, + MaxDurationShouldTransmitMillis: 1000, + MaxFaultyOracles: 1, + MaxQueryLengthBytes: 1000000, + MaxObservationLengthBytes: 1000000, + MaxReportLengthBytes: 1000000, + MaxOutcomeLengthBytes: 1000000, + MaxReportCount: 20, + MaxBatchSize: 20, + OutcomePruningThreshold: 3600, + UniqueReports: true, + RequestTimeout: 30 * time.Second, +} + func TestKeystoneView(t *testing.T) { t.Parallel() - env := memory.NewMemoryEnvironment(t, logger.Test(t), zapcore.DebugLevel, memory.MemoryEnvironmentConfig{ - Nodes: 1, - Chains: 2, + env := test.SetupContractTestEnv(t, test.EnvWrapperConfig{ + WFDonConfig: test.DonConfig{N: 4, Name: "wfDon"}, + AssetDonConfig: test.DonConfig{N: 4, Name: "assetDon"}, + WriterDonConfig: test.DonConfig{N: 4, Name: "writerDon"}, + NumChains: 1, }) - registryChain := env.AllChainSelectors()[0] - resp, err := DeployCapabilityRegistry(env, registryChain) - require.NoError(t, err) - require.NotNil(t, resp) - require.NoError(t, env.ExistingAddresses.Merge(resp.AddressBook)) - resp, err = DeployOCR3(env, registryChain) - require.NoError(t, err) - require.NotNil(t, resp) - require.NoError(t, env.ExistingAddresses.Merge(resp.AddressBook)) - resp, err = DeployForwarder(env, DeployForwarderRequest{}) - require.NoError(t, err) - require.NotNil(t, resp) - require.NoError(t, env.ExistingAddresses.Merge(resp.AddressBook)) + registryChain := env.Env.AllChainSelectors()[0] + oracleConfig.TransmissionSchedule = []int{len(env.Env.NodeIDs)} - a, err := ViewKeystone(env) + addrs, err := env.Env.ExistingAddresses.AddressesForChain(registryChain) require.NoError(t, err) - b, err := a.MarshalJSON() - require.NoError(t, err) - require.NotEmpty(t, b) - t.Log(string(b)) + + var newOCR3Addr string + for addr, tv := range addrs { + if tv.Type == internal.OCR3Capability { + newOCR3Addr = addr + break + } + } + + t.Run("successfully generates a view of the keystone state", func(t *testing.T) { + oracleConfigCopy := oracleConfig + + w := &bytes.Buffer{} + na := common.HexToAddress(newOCR3Addr) + cfg := changeset.ConfigureOCR3Config{ + ChainSel: env.RegistrySelector, + NodeIDs: env.Env.NodeIDs, + Address: &na, + OCR3Config: &oracleConfigCopy, + WriteGeneratedConfig: w, + } + _, err = changeset.ConfigureOCR3Contract(env.Env, cfg) + require.NoError(t, err) + + a, err := changeset.ViewKeystone(env.Env) + require.NoError(t, err) + b, err := a.MarshalJSON() + require.NoError(t, err) + require.NotEmpty(t, b) + + var outView changeset.KeystoneView + require.NoError(t, json.Unmarshal(b, &outView)) + + chainID, err := chain_selectors.ChainIdFromSelector(registryChain) + require.NoError(t, err) + chainName, err := chain_selectors.NameFromChainId(chainID) + require.NoError(t, err) + + viewChain, ok := outView.Chains[chainName] + require.True(t, ok) + viewOCR3Config, ok := viewChain.OCRContracts[newOCR3Addr] + require.True(t, ok) + require.Equal(t, oracleConfig, viewOCR3Config.OffchainConfig) + }) + + t.Run("fails to generate a view of the keystone state with OCR3 not configured", func(t *testing.T) { + // Deploy a new OCR3 contract + resp, err := changeset.DeployOCR3(env.Env, registryChain) + require.NoError(t, err) + require.NotNil(t, resp) + require.NoError(t, env.Env.ExistingAddresses.Merge(resp.AddressBook)) + + _, err = changeset.ViewKeystone(env.Env) + require.ErrorContains(t, err, "failed to view chain") + require.ErrorContains(t, err, "OCR3 not configured") + }) + + t.Run("fails to generate a view of the keystone state with a bad OracleConfig", func(t *testing.T) { + oracleConfigCopy := oracleConfig + oracleConfigCopy.DeltaRoundMillis = 0 + oracleConfigCopy.DeltaProgressMillis = 0 + + w := &bytes.Buffer{} + na := common.HexToAddress(newOCR3Addr) + cfg := changeset.ConfigureOCR3Config{ + ChainSel: env.RegistrySelector, + NodeIDs: env.Env.NodeIDs, + Address: &na, + OCR3Config: &oracleConfigCopy, + WriteGeneratedConfig: w, + } + _, err = changeset.ConfigureOCR3Contract(env.Env, cfg) + require.NoError(t, err) + _, err = changeset.ViewKeystone(env.Env) + require.ErrorContains(t, err, "failed to view chain") + require.ErrorContains(t, err, "DeltaRound (0s) must be less than DeltaProgress (0s)") + }) } diff --git a/deployment/keystone/view/view.go b/deployment/keystone/view/view.go deleted file mode 100644 index c74b4628d1e..00000000000 --- a/deployment/keystone/view/view.go +++ /dev/null @@ -1,32 +0,0 @@ -package view - -import ( - "encoding/json" - - "github.com/smartcontractkit/chainlink/deployment/common/view" - common_v1_0 "github.com/smartcontractkit/chainlink/deployment/common/view/v1_0" -) - -type KeystoneChainView struct { - CapabilityRegistry map[string]common_v1_0.CapabilityRegistryView `json:"capabilityRegistry,omitempty"` - WorkflowRegistry map[string]common_v1_0.WorkflowRegistryView `json:"workflowRegistry,omitempty"` - // TODO forwarders etc -} - -func NewKeystoneChainView() KeystoneChainView { - return KeystoneChainView{ - CapabilityRegistry: make(map[string]common_v1_0.CapabilityRegistryView), - WorkflowRegistry: make(map[string]common_v1_0.WorkflowRegistryView), - } -} - -type KeystoneView struct { - Chains map[string]KeystoneChainView `json:"chains,omitempty"` - Nops map[string]view.NopView `json:"nops,omitempty"` -} - -func (v KeystoneView) MarshalJSON() ([]byte, error) { - // Alias to avoid recursive calls - type Alias KeystoneView - return json.MarshalIndent(&struct{ Alias }{Alias: Alias(v)}, "", " ") -} diff --git a/integration-tests/go.mod b/integration-tests/go.mod index d6c4f6b6b93..47986b51869 100644 --- a/integration-tests/go.mod +++ b/integration-tests/go.mod @@ -12,8 +12,8 @@ replace github.com/smartcontractkit/chainlink/deployment => ../deployment // Using a separate `require` here to avoid surrounding line changes // creating potential merge conflicts. require ( - github.com/smartcontractkit/chainlink/deployment v0.0.0-20250128231431-9279badae2f0 - github.com/smartcontractkit/chainlink/v2 v2.0.0-20250128231431-9279badae2f0 + github.com/smartcontractkit/chainlink/deployment v0.0.0-20250221182743-098d1b0a763a + github.com/smartcontractkit/chainlink/v2 v2.0.0-20250221182743-098d1b0a763a ) require ( @@ -47,7 +47,7 @@ require ( github.com/smartcontractkit/chain-selectors v1.0.40 github.com/smartcontractkit/chainlink-automation v0.8.1 github.com/smartcontractkit/chainlink-ccip v0.0.0-20250224132459-c57ae4a97dcb - github.com/smartcontractkit/chainlink-common v0.4.2-0.20250214231858-f365e2bdecea + 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.2 diff --git a/integration-tests/go.sum b/integration-tests/go.sum index f59223f1a01..a8bf643a088 100644 --- a/integration-tests/go.sum +++ b/integration-tests/go.sum @@ -1388,8 +1388,8 @@ github.com/smartcontractkit/chainlink-ccip v0.0.0-20250224132459-c57ae4a97dcb h1 github.com/smartcontractkit/chainlink-ccip v0.0.0-20250224132459-c57ae4a97dcb/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= -github.com/smartcontractkit/chainlink-common v0.4.2-0.20250214231858-f365e2bdecea/go.mod h1:Z2e1ynSJ4pg83b4Qldbmryc5lmnrI3ojOdg1FUloa68= +github.com/smartcontractkit/chainlink-common v0.4.2-0.20250221174903-e1e47fdb11b0 h1:BTN2nQgFKBxgas6oqY3ym82O+wT++WlpP1+a6KzIfY0= +github.com/smartcontractkit/chainlink-common v0.4.2-0.20250221174903-e1e47fdb11b0/go.mod h1:YQuXIqQpmpAqstWV0LHaDTJ5nsSWuip5ivEM+Fisb+4= github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20250128203428-08031923fbe5 h1:CvDfgWoLoYPapOumE/UZCplfCu5oNmy9BuH+6V6+fJ8= github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20250128203428-08031923fbe5/go.mod h1:pDZagSGjs9U+l4YIFhveDznMHqxuuz+5vRxvVgpbdr8= github.com/smartcontractkit/chainlink-feeds v0.1.1 h1:JzvUOM/OgGQA1sOqTXXl52R6AnNt+Wg64sVG+XSA49c= diff --git a/integration-tests/load/go.mod b/integration-tests/load/go.mod index ca9802216f3..e699c548a0a 100644 --- a/integration-tests/load/go.mod +++ b/integration-tests/load/go.mod @@ -14,9 +14,9 @@ replace github.com/smartcontractkit/chainlink/integration-tests => ../ // Using a separate `require` here to avoid surrounding line changes // creating potential merge conflicts. require ( - github.com/smartcontractkit/chainlink/deployment v0.0.0-20250128231431-9279badae2f0 - github.com/smartcontractkit/chainlink/integration-tests v0.0.0-20250128231431-9279badae2f0 - github.com/smartcontractkit/chainlink/v2 v2.0.0-20250128231431-9279badae2f0 + github.com/smartcontractkit/chainlink/deployment v0.0.0-20250221182743-098d1b0a763a + github.com/smartcontractkit/chainlink/integration-tests v0.0.0-20250221184958-34c2d51a64bc + github.com/smartcontractkit/chainlink/v2 v2.0.0-20250221182743-098d1b0a763a ) require ( @@ -29,7 +29,7 @@ require ( github.com/slack-go/slack v0.15.0 github.com/smartcontractkit/chain-selectors v1.0.40 github.com/smartcontractkit/chainlink-ccip v0.0.0-20250224132459-c57ae4a97dcb - github.com/smartcontractkit/chainlink-common v0.4.2-0.20250214231858-f365e2bdecea + github.com/smartcontractkit/chainlink-common v0.4.2-0.20250221174903-e1e47fdb11b0 github.com/smartcontractkit/chainlink-integrations/evm v0.0.0-20250213145514-41d874782c02 github.com/smartcontractkit/chainlink-testing-framework/lib v1.51.0 github.com/smartcontractkit/chainlink-testing-framework/seth v1.50.10 diff --git a/integration-tests/load/go.sum b/integration-tests/load/go.sum index fa62425009d..04569532d2f 100644 --- a/integration-tests/load/go.sum +++ b/integration-tests/load/go.sum @@ -1373,8 +1373,8 @@ github.com/smartcontractkit/chainlink-ccip v0.0.0-20250224132459-c57ae4a97dcb h1 github.com/smartcontractkit/chainlink-ccip v0.0.0-20250224132459-c57ae4a97dcb/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= -github.com/smartcontractkit/chainlink-common v0.4.2-0.20250214231858-f365e2bdecea/go.mod h1:Z2e1ynSJ4pg83b4Qldbmryc5lmnrI3ojOdg1FUloa68= +github.com/smartcontractkit/chainlink-common v0.4.2-0.20250221174903-e1e47fdb11b0 h1:BTN2nQgFKBxgas6oqY3ym82O+wT++WlpP1+a6KzIfY0= +github.com/smartcontractkit/chainlink-common v0.4.2-0.20250221174903-e1e47fdb11b0/go.mod h1:YQuXIqQpmpAqstWV0LHaDTJ5nsSWuip5ivEM+Fisb+4= github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20250128203428-08031923fbe5 h1:CvDfgWoLoYPapOumE/UZCplfCu5oNmy9BuH+6V6+fJ8= github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20250128203428-08031923fbe5/go.mod h1:pDZagSGjs9U+l4YIFhveDznMHqxuuz+5vRxvVgpbdr8= github.com/smartcontractkit/chainlink-feeds v0.1.1 h1:JzvUOM/OgGQA1sOqTXXl52R6AnNt+Wg64sVG+XSA49c= diff --git a/system-tests/lib/cre/contracts/contracts.go b/system-tests/lib/cre/contracts/contracts.go index 84c63d02fe7..c86eaf79034 100644 --- a/system-tests/lib/cre/contracts/contracts.go +++ b/system-tests/lib/cre/contracts/contracts.go @@ -11,6 +11,7 @@ import ( "github.com/rs/zerolog" capabilitiespb "github.com/smartcontractkit/chainlink-common/pkg/capabilities/pb" + "github.com/smartcontractkit/chainlink/deployment" keystone_changeset "github.com/smartcontractkit/chainlink/deployment/keystone/changeset" kcr "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/keystone/generated/capabilities_registry_1_1_0" @@ -140,13 +141,13 @@ func ConfigureKeystone(input types.ConfigureKeystoneInput) error { TransmissionSchedule: transmissionSchedule, MaxDurationQueryMillis: 1000, MaxDurationObservationMillis: 1000, - MaxDurationAcceptMillis: 1000, - MaxDurationTransmitMillis: 1000, + MaxDurationShouldAcceptMillis: 1000, + MaxDurationShouldTransmitMillis: 1000, MaxFaultyOracles: 1, MaxQueryLengthBytes: 1000000, MaxObservationLengthBytes: 1000000, MaxReportLengthBytes: 1000000, - MaxRequestBatchSize: 1000, + MaxBatchSize: 1000, UniqueReports: true, } diff --git a/system-tests/lib/go.mod b/system-tests/lib/go.mod index b1453a2d2e2..8868a5e7f6e 100644 --- a/system-tests/lib/go.mod +++ b/system-tests/lib/go.mod @@ -3,8 +3,8 @@ module github.com/smartcontractkit/chainlink/system-tests/lib go 1.23.3 require ( - github.com/smartcontractkit/chainlink/deployment v0.0.0-20250206093113-4e72c05bdba6 - github.com/smartcontractkit/chainlink/v2 v2.19.0-ccip1.5.16-alpha.0.0.20250206093113-4e72c05bdba6 + github.com/smartcontractkit/chainlink/deployment v0.0.0-20250221182743-098d1b0a763a + github.com/smartcontractkit/chainlink/v2 v2.0.0-20250221182743-098d1b0a763a ) // Make sure we're working with the latest chainlink libs @@ -17,7 +17,7 @@ require ( github.com/google/uuid v1.6.0 github.com/pkg/errors v0.9.1 github.com/rs/zerolog v1.33.0 - github.com/smartcontractkit/chainlink-common v0.4.2-0.20250214231858-f365e2bdecea + 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 diff --git a/system-tests/lib/go.sum b/system-tests/lib/go.sum index f9f9026508d..a52fa0c717d 100644 --- a/system-tests/lib/go.sum +++ b/system-tests/lib/go.sum @@ -1126,8 +1126,8 @@ github.com/smartcontractkit/chainlink-ccip v0.0.0-20250224132459-c57ae4a97dcb h1 github.com/smartcontractkit/chainlink-ccip v0.0.0-20250224132459-c57ae4a97dcb/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= -github.com/smartcontractkit/chainlink-common v0.4.2-0.20250214231858-f365e2bdecea/go.mod h1:Z2e1ynSJ4pg83b4Qldbmryc5lmnrI3ojOdg1FUloa68= +github.com/smartcontractkit/chainlink-common v0.4.2-0.20250221174903-e1e47fdb11b0 h1:BTN2nQgFKBxgas6oqY3ym82O+wT++WlpP1+a6KzIfY0= +github.com/smartcontractkit/chainlink-common v0.4.2-0.20250221174903-e1e47fdb11b0/go.mod h1:YQuXIqQpmpAqstWV0LHaDTJ5nsSWuip5ivEM+Fisb+4= github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20250128203428-08031923fbe5 h1:CvDfgWoLoYPapOumE/UZCplfCu5oNmy9BuH+6V6+fJ8= github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20250128203428-08031923fbe5/go.mod h1:pDZagSGjs9U+l4YIFhveDznMHqxuuz+5vRxvVgpbdr8= github.com/smartcontractkit/chainlink-feeds v0.1.1 h1:JzvUOM/OgGQA1sOqTXXl52R6AnNt+Wg64sVG+XSA49c= diff --git a/system-tests/tests/go.mod b/system-tests/tests/go.mod index 42dd042a2df..c46809f5f61 100644 --- a/system-tests/tests/go.mod +++ b/system-tests/tests/go.mod @@ -5,8 +5,8 @@ go 1.23.3 // Using a separate `require` here to avoid surrounding line changes // creating potential merge conflicts. require ( - github.com/smartcontractkit/chainlink/deployment v0.0.0-20250206093113-4e72c05bdba6 - github.com/smartcontractkit/chainlink/v2 v2.19.0-ccip1.5.16-alpha.0.0.20250206093113-4e72c05bdba6 + github.com/smartcontractkit/chainlink/deployment v0.0.0-20250221182743-098d1b0a763a + github.com/smartcontractkit/chainlink/v2 v2.0.0-20250221182743-098d1b0a763a ) // Make sure we're working with the latest chainlink libs @@ -343,7 +343,7 @@ require ( github.com/smartcontractkit/chainlink-automation v0.8.1 // indirect github.com/smartcontractkit/chainlink-ccip v0.0.0-20250224132459-c57ae4a97dcb // indirect github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250214202341-4190f2db1c01 // indirect - github.com/smartcontractkit/chainlink-common v0.4.2-0.20250214231858-f365e2bdecea // indirect + github.com/smartcontractkit/chainlink-common v0.4.2-0.20250221174903-e1e47fdb11b0 // indirect github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20250128203428-08031923fbe5 // indirect github.com/smartcontractkit/chainlink-feeds v0.1.1 // indirect github.com/smartcontractkit/chainlink-framework/chains v0.0.0-20250207205350-420ccacab78a // indirect diff --git a/system-tests/tests/go.sum b/system-tests/tests/go.sum index 720962bbaa1..57a42423877 100644 --- a/system-tests/tests/go.sum +++ b/system-tests/tests/go.sum @@ -1126,8 +1126,8 @@ github.com/smartcontractkit/chainlink-ccip v0.0.0-20250224132459-c57ae4a97dcb h1 github.com/smartcontractkit/chainlink-ccip v0.0.0-20250224132459-c57ae4a97dcb/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= -github.com/smartcontractkit/chainlink-common v0.4.2-0.20250214231858-f365e2bdecea/go.mod h1:Z2e1ynSJ4pg83b4Qldbmryc5lmnrI3ojOdg1FUloa68= +github.com/smartcontractkit/chainlink-common v0.4.2-0.20250221174903-e1e47fdb11b0 h1:BTN2nQgFKBxgas6oqY3ym82O+wT++WlpP1+a6KzIfY0= +github.com/smartcontractkit/chainlink-common v0.4.2-0.20250221174903-e1e47fdb11b0/go.mod h1:YQuXIqQpmpAqstWV0LHaDTJ5nsSWuip5ivEM+Fisb+4= github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20250128203428-08031923fbe5 h1:CvDfgWoLoYPapOumE/UZCplfCu5oNmy9BuH+6V6+fJ8= github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20250128203428-08031923fbe5/go.mod h1:pDZagSGjs9U+l4YIFhveDznMHqxuuz+5vRxvVgpbdr8= github.com/smartcontractkit/chainlink-feeds v0.1.1 h1:JzvUOM/OgGQA1sOqTXXl52R6AnNt+Wg64sVG+XSA49c=