From df7c7413cad9008db4c9407fa387dbd2fe5b33b9 Mon Sep 17 00:00:00 2001 From: Prashant Yadav Date: Wed, 4 Mar 2026 13:34:38 -0800 Subject: [PATCH 01/15] Use limits framework instead o onchain config for Vault plugin ocr config --- core/scripts/go.mod | 2 +- core/scripts/go.sum | 4 +- core/services/ocr2/plugins/vault/plugin.go | 108 +++--------------- .../ocr2/plugins/vault/plugin_test.go | 51 +++++---- 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 +- 16 files changed, 63 insertions(+), 138 deletions(-) diff --git a/core/scripts/go.mod b/core/scripts/go.mod index ae7ffc521e8..014d1e055d7 100644 --- a/core/scripts/go.mod +++ b/core/scripts/go.mod @@ -46,7 +46,7 @@ require ( github.com/shopspring/decimal v1.4.0 github.com/smartcontractkit/chainlink-automation v0.8.1 github.com/smartcontractkit/chainlink-ccip v0.1.1-solana.0.20260303102708-6caf8c4ea3b4 - github.com/smartcontractkit/chainlink-common v0.10.1-0.20260302172713-40eba758f144 + github.com/smartcontractkit/chainlink-common v0.10.1-0.20260304203631-0eb0965cfee9 github.com/smartcontractkit/chainlink-common/keystore v1.0.2 github.com/smartcontractkit/chainlink-data-streams v0.1.12-0.20260227110503-42b236799872 github.com/smartcontractkit/chainlink-deployments-framework v0.80.1-0.20260209182815-b296b7df28a6 diff --git a/core/scripts/go.sum b/core/scripts/go.sum index a3dffbc8116..1afdd2e33cc 100644 --- a/core/scripts/go.sum +++ b/core/scripts/go.sum @@ -1607,8 +1607,8 @@ github.com/smartcontractkit/chainlink-ccip/deployment v0.0.0-20260129103204-4c84 github.com/smartcontractkit/chainlink-ccip/deployment v0.0.0-20260129103204-4c8453dd8139/go.mod h1:gUbichNQBqk+fBF2aV40ZkzFmAJ8SygH6DEPd3cJkQE= github.com/smartcontractkit/chainlink-ccv v0.0.0-20260225114453-965dabf4bcb0 h1:kaIN9AjmCEZAEmIMhIqmKddKFqGBVsKToNABk+TWsRY= github.com/smartcontractkit/chainlink-ccv v0.0.0-20260225114453-965dabf4bcb0/go.mod h1:RnuNcn7DZmjmzEkeEWX0uL5y1oslB3c9URPLOjFU+jE= -github.com/smartcontractkit/chainlink-common v0.10.1-0.20260302172713-40eba758f144 h1:XKvx3xnke2K7/5z6rM/r5k8kE1hWriDm8V/f2TKC/b4= -github.com/smartcontractkit/chainlink-common v0.10.1-0.20260302172713-40eba758f144/go.mod h1:0ghbAr7tRO0tT5ZqBXhOyzgUO37tNNe33Yn0hskauVM= +github.com/smartcontractkit/chainlink-common v0.10.1-0.20260304203631-0eb0965cfee9 h1:S3++V+hCbJuNPO9xyL2Puy4S7oF0ltzlKxpvfZGxxOM= +github.com/smartcontractkit/chainlink-common v0.10.1-0.20260304203631-0eb0965cfee9/go.mod h1:0ghbAr7tRO0tT5ZqBXhOyzgUO37tNNe33Yn0hskauVM= github.com/smartcontractkit/chainlink-common/keystore v1.0.2 h1:AWisx4JT3QV8tcgh6J5NCrex+wAgTYpWyHsyNPSXzsQ= github.com/smartcontractkit/chainlink-common/keystore v1.0.2/go.mod h1:rSkIHdomyak3YnUtXLenl6poIq8q0V3UZPiiyYqPdGA= github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.11-0.20251211140724-319861e514c4 h1:NOUsjsMzNecbjiPWUQGlRSRAutEvCFrqqyETDJeh5q4= diff --git a/core/services/ocr2/plugins/vault/plugin.go b/core/services/ocr2/plugins/vault/plugin.go index 71ca238cf9c..f78ba6319a9 100644 --- a/core/services/ocr2/plugins/vault/plugin.go +++ b/core/services/ocr2/plugins/vault/plugin.go @@ -42,28 +42,6 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/logger" ) -const ( - // The query is empty in this plugin. - defaultLimitsMaxQueryLength = 100 - - // Back of the envelope calculation: - // - An item can contain 2KB of ciphertext, 192 bytes of metadata (key, owner, namespace), - // a UUID (16 bytes) plus some overhead = ~2.5KB per item - // There can be 10 such items in a request, and 20 per batch, so 2.5KB * 10 * 20 = 500KB - defaultLimitsMaxObservationLength = 500 * 1024 // 500KB - defaultLimitsMaxReportsPlusPrecursorLength = 500 * 1024 // 500KB - defaultLimitsMaxReportLength = 500 * 1024 // 500KB - defaultLimitsMaxReportCount = 20 - defaultLimitsMaxKeyValueModifiedKeysPlusValuesLength = 1024 * 1024 // 1MB - defaultLimitsMaxKeyValueModifiedKeys = 500 // BatchSize (20) * ItemsPerBatch (10) * 2 keys (secret + metadata) + buffer (100) - - // Per above, a request is max 25KB, we add a bit of buffer to allow some room. - defaultLimitsMaxBlobPayloadLength = 25 * 1024 // 25KB - // Per docs, this should allow some additional buffer to allow for reaping time. - defaultLimitsMaxPerOracleUnexpiredBlobCumulativePayloadBytes = 30 * 1024 * 1024 // 30 MB - defaultLimitsMaxPerOracleUnexpiredBlobCount = 1000 -) - var ( isValidIDComponent = regexp.MustCompile(`^[a-zA-Z0-9_]+$`).MatchString ) @@ -162,14 +140,6 @@ func (r *ReportingPluginFactory) getKeyMaterial(ctx context.Context, instanceID return publicKey, privateKeyShare, nil } -func (r *ReportingPluginFactory) makeSizeLimiter(defaultSize settings.Setting[pkgconfig.Size], configSize int32) (limits.BoundLimiter[pkgconfig.Size], error) { - if configSize != 0 { - defaultSize.DefaultValue = pkgconfig.Size(configSize) * pkgconfig.Byte - } - - return limits.MakeBoundLimiter[pkgconfig.Size](r.limitsFactory, defaultSize) -} - func logLimit[N limits.Number](ctx context.Context, lggr logger.Logger, limiter limits.BoundLimiter[N]) N { ctx = contexts.WithCRE(ctx, contexts.CRE{Owner: "DUMMY-OWNER-FOR-LOGGING"}) limit, err := limiter.Limit(ctx) @@ -185,86 +155,38 @@ func (r *ReportingPluginFactory) NewReportingPlugin(ctx context.Context, config return nil, ocr3_1types.ReportingPluginInfo1{}, fmt.Errorf("could not unmarshal reporting plugin config: %w", err) } - maxSecretsPerOwnerLimit := cresettings.Default.PerOwner.VaultSecretsLimit - if configProto.MaxSecretsPerOwner != 0 { - maxSecretsPerOwnerLimit.DefaultValue = int(configProto.MaxSecretsPerOwner) - } - - maxSecretsPerOwnerLimiter, err := limits.MakeBoundLimiter(r.limitsFactory, maxSecretsPerOwnerLimit) + maxSecretsPerOwnerLimiter, err := limits.MakeBoundLimiter(r.limitsFactory, cresettings.Default.PerOwner.VaultSecretsLimit) if err != nil { return nil, ocr3_1types.ReportingPluginInfo1{}, fmt.Errorf("could not create max secrets per owner limiter: %w", err) } batchSize := cresettings.Default.VaultPluginBatchSizeLimit - if configProto.BatchSize != 0 { - batchSize.DefaultValue = int(configProto.BatchSize) - } maxBatchSizeLimiter, err := limits.MakeBoundLimiter(r.limitsFactory, batchSize) if err != nil { return nil, ocr3_1types.ReportingPluginInfo1{}, fmt.Errorf("could not create max batch size limiter: %w", err) } - maxCiphertextLengthBytesLimiter, err := r.makeSizeLimiter(cresettings.Default.VaultCiphertextSizeLimit, configProto.MaxCiphertextLengthBytes) + maxCiphertextLengthBytesLimiter, err := limits.MakeBoundLimiter(r.limitsFactory, cresettings.Default.VaultCiphertextSizeLimit) if err != nil { return nil, ocr3_1types.ReportingPluginInfo1{}, fmt.Errorf("could not create default max ciphertext length limiter: %w", err) } - maxIdentifierKeyLengthBytesLimiter, err := r.makeSizeLimiter(cresettings.Default.VaultIdentifierKeySizeLimit, configProto.MaxIdentifierKeyLengthBytes) + maxIdentifierKeyLengthBytesLimiter, err := limits.MakeBoundLimiter(r.limitsFactory, cresettings.Default.VaultIdentifierKeySizeLimit) if err != nil { return nil, ocr3_1types.ReportingPluginInfo1{}, fmt.Errorf("could not create default max identifier key length limiter: %w", err) } - maxIdentifierOwnerLengthBytesLimiter, err := r.makeSizeLimiter(cresettings.Default.VaultIdentifierOwnerSizeLimit, configProto.MaxIdentifierOwnerLengthBytes) + maxIdentifierOwnerLengthBytesLimiter, err := limits.MakeBoundLimiter(r.limitsFactory, cresettings.Default.VaultIdentifierOwnerSizeLimit) if err != nil { return nil, ocr3_1types.ReportingPluginInfo1{}, fmt.Errorf("could not create default max identifier owner length limiter: %w", err) } - maxIdentifierNamespaceLengthBytesLimiter, err := r.makeSizeLimiter(cresettings.Default.VaultIdentifierNamespaceSizeLimit, configProto.MaxIdentifierNamespaceLengthBytes) + maxIdentifierNamespaceLengthBytesLimiter, err := limits.MakeBoundLimiter(r.limitsFactory, cresettings.Default.VaultIdentifierNamespaceSizeLimit) if err != nil { return nil, ocr3_1types.ReportingPluginInfo1{}, fmt.Errorf("could not create default max identifier namespace length limiter: %w", err) } - if configProto.LimitsMaxQueryLength == 0 { - configProto.LimitsMaxQueryLength = defaultLimitsMaxQueryLength - } - - if configProto.LimitsMaxObservationLength == 0 { - configProto.LimitsMaxObservationLength = defaultLimitsMaxObservationLength - } - - if configProto.LimitsMaxReportsPlusPrecursorLength == 0 { - configProto.LimitsMaxReportsPlusPrecursorLength = defaultLimitsMaxReportsPlusPrecursorLength - } - - if configProto.LimitsMaxReportLength == 0 { - configProto.LimitsMaxReportLength = defaultLimitsMaxReportLength - } - - if configProto.LimitsMaxReportCount == 0 { - configProto.LimitsMaxReportCount = defaultLimitsMaxReportCount - } - - if configProto.LimitsMaxKeyValueModifiedKeysPlusValuesLength == 0 { - configProto.LimitsMaxKeyValueModifiedKeysPlusValuesLength = defaultLimitsMaxKeyValueModifiedKeysPlusValuesLength - } - - if configProto.LimitsMaxKeyValueModifiedKeys == 0 { - configProto.LimitsMaxKeyValueModifiedKeys = defaultLimitsMaxKeyValueModifiedKeys - } - - if configProto.LimitsMaxBlobPayloadLength == 0 { - configProto.LimitsMaxBlobPayloadLength = defaultLimitsMaxBlobPayloadLength - } - - if configProto.LimitsMaxPerOracleUnexpiredBlobCumulativePayloadBytes == 0 { - configProto.LimitsMaxPerOracleUnexpiredBlobCumulativePayloadBytes = defaultLimitsMaxPerOracleUnexpiredBlobCumulativePayloadBytes - } - - if configProto.LimitsMaxPerOracleUnexpiredBlobCount == 0 { - configProto.LimitsMaxPerOracleUnexpiredBlobCount = defaultLimitsMaxPerOracleUnexpiredBlobCount - } - if configProto.DKGInstanceID == nil { return nil, ocr3_1types.ReportingPluginInfo1{}, errors.New("DKG instance ID cannot be nil") } @@ -320,16 +242,16 @@ func (r *ReportingPluginFactory) NewReportingPlugin(ctx context.Context, config }, ocr3_1types.ReportingPluginInfo1{ Name: "VaultReportingPlugin", Limits: ocr3_1types.ReportingPluginLimits{ - MaxQueryBytes: int(configProto.LimitsMaxQueryLength), - MaxObservationBytes: int(configProto.LimitsMaxObservationLength), - MaxReportsPlusPrecursorBytes: int(configProto.LimitsMaxReportsPlusPrecursorLength), - MaxReportBytes: int(configProto.LimitsMaxReportLength), - MaxReportCount: int(configProto.LimitsMaxReportCount), - MaxKeyValueModifiedKeysPlusValuesBytes: int(configProto.LimitsMaxKeyValueModifiedKeysPlusValuesLength), - MaxKeyValueModifiedKeys: int(configProto.LimitsMaxKeyValueModifiedKeys), - MaxBlobPayloadBytes: int(configProto.LimitsMaxBlobPayloadLength), - MaxPerOracleUnexpiredBlobCumulativePayloadBytes: int(configProto.LimitsMaxPerOracleUnexpiredBlobCumulativePayloadBytes), - MaxPerOracleUnexpiredBlobCount: int(configProto.LimitsMaxPerOracleUnexpiredBlobCount), + MaxQueryBytes: cresettings.Default.VaultLimitsMaxQueryLength.DefaultValue, + MaxObservationBytes: cresettings.Default.VaultLimitsMaxObservationLength.DefaultValue, + MaxReportsPlusPrecursorBytes: cresettings.Default.VaultLimitsMaxReportsPlusPrecursorLength.DefaultValue, + MaxReportBytes: cresettings.Default.VaultLimitsMaxReportLength.DefaultValue, + MaxReportCount: cresettings.Default.VaultLimitsMaxReportCount.DefaultValue, + MaxKeyValueModifiedKeysPlusValuesBytes: cresettings.Default.VaultLimitsMaxKeyValueModifiedKeysPlusValuesLength.DefaultValue, + MaxKeyValueModifiedKeys: cresettings.Default.VaultLimitsMaxKeyValueModifiedKeys.DefaultValue, + MaxBlobPayloadBytes: cresettings.Default.VaultLimitsMaxBlobPayloadLength.DefaultValue, + MaxPerOracleUnexpiredBlobCumulativePayloadBytes: cresettings.Default.VaultLimitsMaxPerOracleUnexpiredBlobCumulativePayloadBytes.DefaultValue, + MaxPerOracleUnexpiredBlobCount: cresettings.Default.VaultLimitsMaxPerOracleUnexpiredBlobCount.DefaultValue, }, }, nil } diff --git a/core/services/ocr2/plugins/vault/plugin_test.go b/core/services/ocr2/plugins/vault/plugin_test.go index f32825db6c6..e5bcfe260c6 100644 --- a/core/services/ocr2/plugins/vault/plugin_test.go +++ b/core/services/ocr2/plugins/vault/plugin_test.go @@ -92,7 +92,7 @@ func TestPlugin_ReportingPluginFactory_UsesDefaultsIfNotProvidedInOffchainConfig require.NoError(t, err) typedRP := rp.(*ReportingPlugin) - assert.Equal(t, 20, typedRP.cfg.BatchSize.DefaultValue) + assert.Equal(t, cresettings.Default.VaultPluginBatchSizeLimit.DefaultValue, typedRP.cfg.BatchSize.DefaultValue) assert.NotNil(t, typedRP.cfg.PublicKey) assert.NotNil(t, typedRP.cfg.PrivateKeyShare) assertLimit(t, 100, typedRP.cfg.MaxSecretsPerOwner) @@ -104,14 +104,18 @@ func TestPlugin_ReportingPluginFactory_UsesDefaultsIfNotProvidedInOffchainConfig infoObject, ok := info.(ocr3_1types.ReportingPluginInfo1) assert.True(t, ok, "ReportingPluginInfo not of type ReportingPluginInfo1") assert.Equal(t, "VaultReportingPlugin", infoObject.Name) - assert.Equal(t, 100, infoObject.Limits.MaxQueryBytes) - assert.Equal(t, 512000, infoObject.Limits.MaxObservationBytes) - assert.Equal(t, 512000, infoObject.Limits.MaxReportsPlusPrecursorBytes) - assert.Equal(t, 512000, infoObject.Limits.MaxReportBytes) - assert.Equal(t, 20, infoObject.Limits.MaxReportCount) - assert.Equal(t, 1024*1024, infoObject.Limits.MaxKeyValueModifiedKeysPlusValuesBytes) - assert.Equal(t, 25*1024, infoObject.Limits.MaxBlobPayloadBytes) - + assert.Equal(t, cresettings.Default.VaultLimitsMaxQueryLength.DefaultValue, infoObject.Limits.MaxQueryBytes) + assert.Equal(t, cresettings.Default.VaultLimitsMaxObservationLength.DefaultValue, infoObject.Limits.MaxObservationBytes) + assert.Equal(t, cresettings.Default.VaultLimitsMaxReportsPlusPrecursorLength.DefaultValue, infoObject.Limits.MaxReportsPlusPrecursorBytes) + assert.Equal(t, cresettings.Default.VaultLimitsMaxReportLength.DefaultValue, infoObject.Limits.MaxReportBytes) + assert.Equal(t, cresettings.Default.VaultLimitsMaxReportCount.DefaultValue, infoObject.Limits.MaxReportCount) + assert.Equal(t, cresettings.Default.VaultLimitsMaxKeyValueModifiedKeysPlusValuesLength.DefaultValue, infoObject.Limits.MaxKeyValueModifiedKeysPlusValuesBytes) + assert.Equal(t, cresettings.Default.VaultLimitsMaxKeyValueModifiedKeys.DefaultValue, infoObject.Limits.MaxKeyValueModifiedKeys) + assert.Equal(t, cresettings.Default.VaultLimitsMaxBlobPayloadLength.DefaultValue, infoObject.Limits.MaxBlobPayloadBytes) + assert.Equal(t, cresettings.Default.VaultLimitsMaxPerOracleUnexpiredBlobCumulativePayloadBytes.DefaultValue, infoObject.Limits.MaxPerOracleUnexpiredBlobCumulativePayloadBytes) + assert.Equal(t, cresettings.Default.VaultLimitsMaxPerOracleUnexpiredBlobCount.DefaultValue, infoObject.Limits.MaxPerOracleUnexpiredBlobCount) + + // Verify that configProto overrides are ignored — values should remain at cresettings defaults. cfg = vaultcommon.ReportingPluginConfig{ BatchSize: 2, MaxSecretsPerOwner: 2, @@ -135,24 +139,23 @@ func TestPlugin_ReportingPluginFactory_UsesDefaultsIfNotProvidedInOffchainConfig require.NoError(t, err) typedRP = rp.(*ReportingPlugin) - assert.Equal(t, 2, typedRP.cfg.BatchSize.DefaultValue) - assertLimit(t, 2, typedRP.cfg.MaxSecretsPerOwner) - assertLimit(t, 2, typedRP.cfg.MaxCiphertextLengthBytes) - assertLimit(t, 2, typedRP.cfg.MaxCiphertextLengthBytes) - assertLimit(t, 2, typedRP.cfg.MaxIdentifierOwnerLengthBytes) - assertLimit(t, 2, typedRP.cfg.MaxIdentifierNamespaceLengthBytes) - assertLimit(t, 2, typedRP.cfg.MaxIdentifierKeyLengthBytes) + assert.Equal(t, cresettings.Default.VaultPluginBatchSizeLimit.DefaultValue, typedRP.cfg.BatchSize.DefaultValue) + assertLimit(t, 100, typedRP.cfg.MaxSecretsPerOwner) + assertLimit(t, 2000, typedRP.cfg.MaxCiphertextLengthBytes) + assertLimit(t, 64, typedRP.cfg.MaxIdentifierOwnerLengthBytes) + assertLimit(t, 64, typedRP.cfg.MaxIdentifierNamespaceLengthBytes) + assertLimit(t, 64, typedRP.cfg.MaxIdentifierKeyLengthBytes) infoObject, ok = info.(ocr3_1types.ReportingPluginInfo1) assert.True(t, ok, "ReportingPluginInfo not of type ReportingPluginInfo1") assert.Equal(t, "VaultReportingPlugin", infoObject.Name) - assert.Equal(t, 2, infoObject.Limits.MaxQueryBytes) - assert.Equal(t, 2, infoObject.Limits.MaxObservationBytes) - assert.Equal(t, 2, infoObject.Limits.MaxReportsPlusPrecursorBytes) - assert.Equal(t, 2, infoObject.Limits.MaxReportBytes) - assert.Equal(t, 2, infoObject.Limits.MaxReportCount) - assert.Equal(t, 2, infoObject.Limits.MaxKeyValueModifiedKeysPlusValuesBytes) - assert.Equal(t, 2, infoObject.Limits.MaxBlobPayloadBytes) + assert.Equal(t, cresettings.Default.VaultLimitsMaxQueryLength.DefaultValue, infoObject.Limits.MaxQueryBytes) + assert.Equal(t, cresettings.Default.VaultLimitsMaxObservationLength.DefaultValue, infoObject.Limits.MaxObservationBytes) + assert.Equal(t, cresettings.Default.VaultLimitsMaxReportsPlusPrecursorLength.DefaultValue, infoObject.Limits.MaxReportsPlusPrecursorBytes) + assert.Equal(t, cresettings.Default.VaultLimitsMaxReportLength.DefaultValue, infoObject.Limits.MaxReportBytes) + assert.Equal(t, cresettings.Default.VaultLimitsMaxReportCount.DefaultValue, infoObject.Limits.MaxReportCount) + assert.Equal(t, cresettings.Default.VaultLimitsMaxKeyValueModifiedKeysPlusValuesLength.DefaultValue, infoObject.Limits.MaxKeyValueModifiedKeysPlusValuesBytes) + assert.Equal(t, cresettings.Default.VaultLimitsMaxBlobPayloadLength.DefaultValue, infoObject.Limits.MaxBlobPayloadBytes) } func TestPlugin_ReportingPluginFactory_UseDKGResult(t *testing.T) { @@ -186,7 +189,7 @@ func TestPlugin_ReportingPluginFactory_UseDKGResult(t *testing.T) { require.NoError(t, err) typedRP := rp.(*ReportingPlugin) - assert.Equal(t, 20, typedRP.cfg.BatchSize.DefaultValue) + assert.Equal(t, cresettings.Default.VaultPluginBatchSizeLimit.DefaultValue, typedRP.cfg.BatchSize.DefaultValue) pkBytes, err := typedRP.cfg.PublicKey.Marshal() require.NoError(t, err) diff --git a/deployment/go.mod b/deployment/go.mod index 0b4d5becbe4..7c703155a13 100644 --- a/deployment/go.mod +++ b/deployment/go.mod @@ -43,7 +43,7 @@ require ( github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20260121163256-85accaf3d28d github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings v0.0.0-20250912190424-fd2e35d7deb5 github.com/smartcontractkit/chainlink-ccip/deployment v0.0.0-20260129103204-4c8453dd8139 - github.com/smartcontractkit/chainlink-common v0.10.1-0.20260302172713-40eba758f144 + github.com/smartcontractkit/chainlink-common v0.10.1-0.20260304203631-0eb0965cfee9 github.com/smartcontractkit/chainlink-common/keystore v1.0.2 github.com/smartcontractkit/chainlink-deployments-framework v0.80.1-0.20260209182815-b296b7df28a6 github.com/smartcontractkit/chainlink-evm v0.3.4-0.20260303141232-9cc3feb83863 diff --git a/deployment/go.sum b/deployment/go.sum index 8b723c7436b..24a0c9746ee 100644 --- a/deployment/go.sum +++ b/deployment/go.sum @@ -1370,8 +1370,8 @@ github.com/smartcontractkit/chainlink-ccip/deployment v0.0.0-20260129103204-4c84 github.com/smartcontractkit/chainlink-ccip/deployment v0.0.0-20260129103204-4c8453dd8139/go.mod h1:gUbichNQBqk+fBF2aV40ZkzFmAJ8SygH6DEPd3cJkQE= github.com/smartcontractkit/chainlink-ccv v0.0.0-20260225114453-965dabf4bcb0 h1:kaIN9AjmCEZAEmIMhIqmKddKFqGBVsKToNABk+TWsRY= github.com/smartcontractkit/chainlink-ccv v0.0.0-20260225114453-965dabf4bcb0/go.mod h1:RnuNcn7DZmjmzEkeEWX0uL5y1oslB3c9URPLOjFU+jE= -github.com/smartcontractkit/chainlink-common v0.10.1-0.20260302172713-40eba758f144 h1:XKvx3xnke2K7/5z6rM/r5k8kE1hWriDm8V/f2TKC/b4= -github.com/smartcontractkit/chainlink-common v0.10.1-0.20260302172713-40eba758f144/go.mod h1:0ghbAr7tRO0tT5ZqBXhOyzgUO37tNNe33Yn0hskauVM= +github.com/smartcontractkit/chainlink-common v0.10.1-0.20260304203631-0eb0965cfee9 h1:S3++V+hCbJuNPO9xyL2Puy4S7oF0ltzlKxpvfZGxxOM= +github.com/smartcontractkit/chainlink-common v0.10.1-0.20260304203631-0eb0965cfee9/go.mod h1:0ghbAr7tRO0tT5ZqBXhOyzgUO37tNNe33Yn0hskauVM= github.com/smartcontractkit/chainlink-common/keystore v1.0.2 h1:AWisx4JT3QV8tcgh6J5NCrex+wAgTYpWyHsyNPSXzsQ= github.com/smartcontractkit/chainlink-common/keystore v1.0.2/go.mod h1:rSkIHdomyak3YnUtXLenl6poIq8q0V3UZPiiyYqPdGA= github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.10 h1:FJAFgXS9oqASnkS03RE1HQwYQQxrO4l46O5JSzxqLgg= diff --git a/go.mod b/go.mod index 63339e3b18b..5b0a7ed7310 100644 --- a/go.mod +++ b/go.mod @@ -84,7 +84,7 @@ require ( github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20260121163256-85accaf3d28d github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings v0.0.0-20250912190424-fd2e35d7deb5 github.com/smartcontractkit/chainlink-ccv v0.0.0-20260225114453-965dabf4bcb0 - github.com/smartcontractkit/chainlink-common v0.10.1-0.20260302172713-40eba758f144 + github.com/smartcontractkit/chainlink-common v0.10.1-0.20260304203631-0eb0965cfee9 github.com/smartcontractkit/chainlink-common/keystore v1.0.2 github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.10 github.com/smartcontractkit/chainlink-data-streams v0.1.12-0.20260227110503-42b236799872 diff --git a/go.sum b/go.sum index d91c113a460..8055e1ddd2c 100644 --- a/go.sum +++ b/go.sum @@ -1180,8 +1180,8 @@ github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings v0.0.0-20250 github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings v0.0.0-20250912190424-fd2e35d7deb5/go.mod h1:xtZNi6pOKdC3sLvokDvXOhgHzT+cyBqH/gWwvxTxqrg= github.com/smartcontractkit/chainlink-ccv v0.0.0-20260225114453-965dabf4bcb0 h1:kaIN9AjmCEZAEmIMhIqmKddKFqGBVsKToNABk+TWsRY= github.com/smartcontractkit/chainlink-ccv v0.0.0-20260225114453-965dabf4bcb0/go.mod h1:RnuNcn7DZmjmzEkeEWX0uL5y1oslB3c9URPLOjFU+jE= -github.com/smartcontractkit/chainlink-common v0.10.1-0.20260302172713-40eba758f144 h1:XKvx3xnke2K7/5z6rM/r5k8kE1hWriDm8V/f2TKC/b4= -github.com/smartcontractkit/chainlink-common v0.10.1-0.20260302172713-40eba758f144/go.mod h1:0ghbAr7tRO0tT5ZqBXhOyzgUO37tNNe33Yn0hskauVM= +github.com/smartcontractkit/chainlink-common v0.10.1-0.20260304203631-0eb0965cfee9 h1:S3++V+hCbJuNPO9xyL2Puy4S7oF0ltzlKxpvfZGxxOM= +github.com/smartcontractkit/chainlink-common v0.10.1-0.20260304203631-0eb0965cfee9/go.mod h1:0ghbAr7tRO0tT5ZqBXhOyzgUO37tNNe33Yn0hskauVM= github.com/smartcontractkit/chainlink-common/keystore v1.0.2 h1:AWisx4JT3QV8tcgh6J5NCrex+wAgTYpWyHsyNPSXzsQ= github.com/smartcontractkit/chainlink-common/keystore v1.0.2/go.mod h1:rSkIHdomyak3YnUtXLenl6poIq8q0V3UZPiiyYqPdGA= github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.10 h1:FJAFgXS9oqASnkS03RE1HQwYQQxrO4l46O5JSzxqLgg= diff --git a/integration-tests/go.mod b/integration-tests/go.mod index f1462142f88..714a45ce9c2 100644 --- a/integration-tests/go.mod +++ b/integration-tests/go.mod @@ -50,7 +50,7 @@ require ( github.com/smartcontractkit/chainlink-ccip v0.1.1-solana.0.20260303102708-6caf8c4ea3b4 github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20260121163256-85accaf3d28d github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings v0.0.0-20250912190424-fd2e35d7deb5 - github.com/smartcontractkit/chainlink-common v0.10.1-0.20260302172713-40eba758f144 + github.com/smartcontractkit/chainlink-common v0.10.1-0.20260304203631-0eb0965cfee9 github.com/smartcontractkit/chainlink-common/keystore v1.0.2 github.com/smartcontractkit/chainlink-deployments-framework v0.80.1-0.20260209182815-b296b7df28a6 github.com/smartcontractkit/chainlink-evm v0.3.4-0.20260303141232-9cc3feb83863 diff --git a/integration-tests/go.sum b/integration-tests/go.sum index 6eb26b79045..4f78dcf2ab7 100644 --- a/integration-tests/go.sum +++ b/integration-tests/go.sum @@ -1614,8 +1614,8 @@ github.com/smartcontractkit/chainlink-ccip/deployment v0.0.0-20260129103204-4c84 github.com/smartcontractkit/chainlink-ccip/deployment v0.0.0-20260129103204-4c8453dd8139/go.mod h1:gUbichNQBqk+fBF2aV40ZkzFmAJ8SygH6DEPd3cJkQE= github.com/smartcontractkit/chainlink-ccv v0.0.0-20260225114453-965dabf4bcb0 h1:kaIN9AjmCEZAEmIMhIqmKddKFqGBVsKToNABk+TWsRY= github.com/smartcontractkit/chainlink-ccv v0.0.0-20260225114453-965dabf4bcb0/go.mod h1:RnuNcn7DZmjmzEkeEWX0uL5y1oslB3c9URPLOjFU+jE= -github.com/smartcontractkit/chainlink-common v0.10.1-0.20260302172713-40eba758f144 h1:XKvx3xnke2K7/5z6rM/r5k8kE1hWriDm8V/f2TKC/b4= -github.com/smartcontractkit/chainlink-common v0.10.1-0.20260302172713-40eba758f144/go.mod h1:0ghbAr7tRO0tT5ZqBXhOyzgUO37tNNe33Yn0hskauVM= +github.com/smartcontractkit/chainlink-common v0.10.1-0.20260304203631-0eb0965cfee9 h1:S3++V+hCbJuNPO9xyL2Puy4S7oF0ltzlKxpvfZGxxOM= +github.com/smartcontractkit/chainlink-common v0.10.1-0.20260304203631-0eb0965cfee9/go.mod h1:0ghbAr7tRO0tT5ZqBXhOyzgUO37tNNe33Yn0hskauVM= github.com/smartcontractkit/chainlink-common/keystore v1.0.2 h1:AWisx4JT3QV8tcgh6J5NCrex+wAgTYpWyHsyNPSXzsQ= github.com/smartcontractkit/chainlink-common/keystore v1.0.2/go.mod h1:rSkIHdomyak3YnUtXLenl6poIq8q0V3UZPiiyYqPdGA= github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.10 h1:FJAFgXS9oqASnkS03RE1HQwYQQxrO4l46O5JSzxqLgg= diff --git a/integration-tests/load/go.mod b/integration-tests/load/go.mod index c9892d72348..7828fa854ce 100644 --- a/integration-tests/load/go.mod +++ b/integration-tests/load/go.mod @@ -32,7 +32,7 @@ require ( github.com/smartcontractkit/chainlink-ccip v0.1.1-solana.0.20260303102708-6caf8c4ea3b4 github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20260121163256-85accaf3d28d github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings v0.0.0-20250912190424-fd2e35d7deb5 - github.com/smartcontractkit/chainlink-common v0.10.1-0.20260302172713-40eba758f144 + github.com/smartcontractkit/chainlink-common v0.10.1-0.20260304203631-0eb0965cfee9 github.com/smartcontractkit/chainlink-deployments-framework v0.80.1-0.20260209182815-b296b7df28a6 github.com/smartcontractkit/chainlink-evm v0.3.4-0.20260303141232-9cc3feb83863 github.com/smartcontractkit/chainlink-evm/gethwrappers v0.0.0-20251222115927-36a18321243c diff --git a/integration-tests/load/go.sum b/integration-tests/load/go.sum index b767dd686f1..139470a0ca2 100644 --- a/integration-tests/load/go.sum +++ b/integration-tests/load/go.sum @@ -1592,8 +1592,8 @@ github.com/smartcontractkit/chainlink-ccip/deployment v0.0.0-20260129103204-4c84 github.com/smartcontractkit/chainlink-ccip/deployment v0.0.0-20260129103204-4c8453dd8139/go.mod h1:gUbichNQBqk+fBF2aV40ZkzFmAJ8SygH6DEPd3cJkQE= github.com/smartcontractkit/chainlink-ccv v0.0.0-20260225114453-965dabf4bcb0 h1:kaIN9AjmCEZAEmIMhIqmKddKFqGBVsKToNABk+TWsRY= github.com/smartcontractkit/chainlink-ccv v0.0.0-20260225114453-965dabf4bcb0/go.mod h1:RnuNcn7DZmjmzEkeEWX0uL5y1oslB3c9URPLOjFU+jE= -github.com/smartcontractkit/chainlink-common v0.10.1-0.20260302172713-40eba758f144 h1:XKvx3xnke2K7/5z6rM/r5k8kE1hWriDm8V/f2TKC/b4= -github.com/smartcontractkit/chainlink-common v0.10.1-0.20260302172713-40eba758f144/go.mod h1:0ghbAr7tRO0tT5ZqBXhOyzgUO37tNNe33Yn0hskauVM= +github.com/smartcontractkit/chainlink-common v0.10.1-0.20260304203631-0eb0965cfee9 h1:S3++V+hCbJuNPO9xyL2Puy4S7oF0ltzlKxpvfZGxxOM= +github.com/smartcontractkit/chainlink-common v0.10.1-0.20260304203631-0eb0965cfee9/go.mod h1:0ghbAr7tRO0tT5ZqBXhOyzgUO37tNNe33Yn0hskauVM= github.com/smartcontractkit/chainlink-common/keystore v1.0.2 h1:AWisx4JT3QV8tcgh6J5NCrex+wAgTYpWyHsyNPSXzsQ= github.com/smartcontractkit/chainlink-common/keystore v1.0.2/go.mod h1:rSkIHdomyak3YnUtXLenl6poIq8q0V3UZPiiyYqPdGA= github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.10 h1:FJAFgXS9oqASnkS03RE1HQwYQQxrO4l46O5JSzxqLgg= diff --git a/system-tests/lib/go.mod b/system-tests/lib/go.mod index 7d1f0f451c9..e335bd7366f 100644 --- a/system-tests/lib/go.mod +++ b/system-tests/lib/go.mod @@ -32,7 +32,7 @@ require ( github.com/sethvargo/go-retry v0.3.0 github.com/smartcontractkit/chain-selectors v1.0.97 github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20260121163256-85accaf3d28d - github.com/smartcontractkit/chainlink-common v0.10.1-0.20260302172713-40eba758f144 + github.com/smartcontractkit/chainlink-common v0.10.1-0.20260304203631-0eb0965cfee9 github.com/smartcontractkit/chainlink-common/keystore v1.0.2 github.com/smartcontractkit/chainlink-deployments-framework v0.80.1-0.20260209182815-b296b7df28a6 github.com/smartcontractkit/chainlink-evm v0.3.4-0.20260303141232-9cc3feb83863 diff --git a/system-tests/lib/go.sum b/system-tests/lib/go.sum index 1fa6b2b1368..ed152c930ea 100644 --- a/system-tests/lib/go.sum +++ b/system-tests/lib/go.sum @@ -1570,8 +1570,8 @@ github.com/smartcontractkit/chainlink-ccip/deployment v0.0.0-20260129103204-4c84 github.com/smartcontractkit/chainlink-ccip/deployment v0.0.0-20260129103204-4c8453dd8139/go.mod h1:gUbichNQBqk+fBF2aV40ZkzFmAJ8SygH6DEPd3cJkQE= github.com/smartcontractkit/chainlink-ccv v0.0.0-20260225114453-965dabf4bcb0 h1:kaIN9AjmCEZAEmIMhIqmKddKFqGBVsKToNABk+TWsRY= github.com/smartcontractkit/chainlink-ccv v0.0.0-20260225114453-965dabf4bcb0/go.mod h1:RnuNcn7DZmjmzEkeEWX0uL5y1oslB3c9URPLOjFU+jE= -github.com/smartcontractkit/chainlink-common v0.10.1-0.20260302172713-40eba758f144 h1:XKvx3xnke2K7/5z6rM/r5k8kE1hWriDm8V/f2TKC/b4= -github.com/smartcontractkit/chainlink-common v0.10.1-0.20260302172713-40eba758f144/go.mod h1:0ghbAr7tRO0tT5ZqBXhOyzgUO37tNNe33Yn0hskauVM= +github.com/smartcontractkit/chainlink-common v0.10.1-0.20260304203631-0eb0965cfee9 h1:S3++V+hCbJuNPO9xyL2Puy4S7oF0ltzlKxpvfZGxxOM= +github.com/smartcontractkit/chainlink-common v0.10.1-0.20260304203631-0eb0965cfee9/go.mod h1:0ghbAr7tRO0tT5ZqBXhOyzgUO37tNNe33Yn0hskauVM= github.com/smartcontractkit/chainlink-common/keystore v1.0.2 h1:AWisx4JT3QV8tcgh6J5NCrex+wAgTYpWyHsyNPSXzsQ= github.com/smartcontractkit/chainlink-common/keystore v1.0.2/go.mod h1:rSkIHdomyak3YnUtXLenl6poIq8q0V3UZPiiyYqPdGA= github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.10 h1:FJAFgXS9oqASnkS03RE1HQwYQQxrO4l46O5JSzxqLgg= diff --git a/system-tests/tests/go.mod b/system-tests/tests/go.mod index 8107a4e6c32..e37e3dbc517 100644 --- a/system-tests/tests/go.mod +++ b/system-tests/tests/go.mod @@ -54,7 +54,7 @@ require ( github.com/rs/zerolog v1.34.0 github.com/shopspring/decimal v1.4.0 github.com/smartcontractkit/chain-selectors v1.0.97 - github.com/smartcontractkit/chainlink-common v0.10.1-0.20260302172713-40eba758f144 + github.com/smartcontractkit/chainlink-common v0.10.1-0.20260304203631-0eb0965cfee9 github.com/smartcontractkit/chainlink-common/keystore v1.0.2 github.com/smartcontractkit/chainlink-data-streams v0.1.12-0.20260227110503-42b236799872 github.com/smartcontractkit/chainlink-deployments-framework v0.80.1-0.20260209182815-b296b7df28a6 diff --git a/system-tests/tests/go.sum b/system-tests/tests/go.sum index 1f3d65d83f0..263b04db51a 100644 --- a/system-tests/tests/go.sum +++ b/system-tests/tests/go.sum @@ -1780,8 +1780,8 @@ github.com/smartcontractkit/chainlink-ccip/deployment v0.0.0-20260129103204-4c84 github.com/smartcontractkit/chainlink-ccip/deployment v0.0.0-20260129103204-4c8453dd8139/go.mod h1:gUbichNQBqk+fBF2aV40ZkzFmAJ8SygH6DEPd3cJkQE= github.com/smartcontractkit/chainlink-ccv v0.0.0-20260225114453-965dabf4bcb0 h1:kaIN9AjmCEZAEmIMhIqmKddKFqGBVsKToNABk+TWsRY= github.com/smartcontractkit/chainlink-ccv v0.0.0-20260225114453-965dabf4bcb0/go.mod h1:RnuNcn7DZmjmzEkeEWX0uL5y1oslB3c9URPLOjFU+jE= -github.com/smartcontractkit/chainlink-common v0.10.1-0.20260302172713-40eba758f144 h1:XKvx3xnke2K7/5z6rM/r5k8kE1hWriDm8V/f2TKC/b4= -github.com/smartcontractkit/chainlink-common v0.10.1-0.20260302172713-40eba758f144/go.mod h1:0ghbAr7tRO0tT5ZqBXhOyzgUO37tNNe33Yn0hskauVM= +github.com/smartcontractkit/chainlink-common v0.10.1-0.20260304203631-0eb0965cfee9 h1:S3++V+hCbJuNPO9xyL2Puy4S7oF0ltzlKxpvfZGxxOM= +github.com/smartcontractkit/chainlink-common v0.10.1-0.20260304203631-0eb0965cfee9/go.mod h1:0ghbAr7tRO0tT5ZqBXhOyzgUO37tNNe33Yn0hskauVM= github.com/smartcontractkit/chainlink-common/keystore v1.0.2 h1:AWisx4JT3QV8tcgh6J5NCrex+wAgTYpWyHsyNPSXzsQ= github.com/smartcontractkit/chainlink-common/keystore v1.0.2/go.mod h1:rSkIHdomyak3YnUtXLenl6poIq8q0V3UZPiiyYqPdGA= github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.11-0.20251211140724-319861e514c4 h1:NOUsjsMzNecbjiPWUQGlRSRAutEvCFrqqyETDJeh5q4= From c62cf931f8dc0cb2d5dd1d86ef0eae78be12cc05 Mon Sep 17 00:00:00 2001 From: Prashant Yadav Date: Wed, 4 Mar 2026 14:06:40 -0800 Subject: [PATCH 02/15] Refactor --- core/services/ocr2/plugins/vault/plugin.go | 172 ++++++++++++++------- 1 file changed, 119 insertions(+), 53 deletions(-) diff --git a/core/services/ocr2/plugins/vault/plugin.go b/core/services/ocr2/plugins/vault/plugin.go index f78ba6319a9..228323df8af 100644 --- a/core/services/ocr2/plugins/vault/plugin.go +++ b/core/services/ocr2/plugins/vault/plugin.go @@ -140,51 +140,132 @@ func (r *ReportingPluginFactory) getKeyMaterial(ctx context.Context, instanceID return publicKey, privateKeyShare, nil } -func logLimit[N limits.Number](ctx context.Context, lggr logger.Logger, limiter limits.BoundLimiter[N]) N { - ctx = contexts.WithCRE(ctx, contexts.CRE{Owner: "DUMMY-OWNER-FOR-LOGGING"}) - limit, err := limiter.Limit(ctx) +func resolvePluginLimits(ctx context.Context, factory limits.Factory) (ocr3_1types.ReportingPluginLimits, error) { + resolve := func(s settings.Setting[int]) (int, error) { + limiter, err := limits.MakeBoundLimiter(factory, s) + if err != nil { + return 0, err + } + return limiter.Limit(ctx) + } + + maxQueryBytes, err := resolve(cresettings.Default.VaultLimitsMaxQueryLength) if err != nil { - lggr.Errorw("could not fetch limit", "error", err) + return ocr3_1types.ReportingPluginLimits{}, fmt.Errorf("VaultLimitsMaxQueryLength: %w", err) } - return limit + maxObservationBytes, err := resolve(cresettings.Default.VaultLimitsMaxObservationLength) + if err != nil { + return ocr3_1types.ReportingPluginLimits{}, fmt.Errorf("VaultLimitsMaxObservationLength: %w", err) + } + maxReportsPlusPrecursorBytes, err := resolve(cresettings.Default.VaultLimitsMaxReportsPlusPrecursorLength) + if err != nil { + return ocr3_1types.ReportingPluginLimits{}, fmt.Errorf("VaultLimitsMaxReportsPlusPrecursorLength: %w", err) + } + maxReportBytes, err := resolve(cresettings.Default.VaultLimitsMaxReportLength) + if err != nil { + return ocr3_1types.ReportingPluginLimits{}, fmt.Errorf("VaultLimitsMaxReportLength: %w", err) + } + maxReportCount, err := resolve(cresettings.Default.VaultLimitsMaxReportCount) + if err != nil { + return ocr3_1types.ReportingPluginLimits{}, fmt.Errorf("VaultLimitsMaxReportCount: %w", err) + } + maxKVModifiedKeysPlusValuesBytes, err := resolve(cresettings.Default.VaultLimitsMaxKeyValueModifiedKeysPlusValuesLength) + if err != nil { + return ocr3_1types.ReportingPluginLimits{}, fmt.Errorf("VaultLimitsMaxKeyValueModifiedKeysPlusValuesLength: %w", err) + } + maxKVModifiedKeys, err := resolve(cresettings.Default.VaultLimitsMaxKeyValueModifiedKeys) + if err != nil { + return ocr3_1types.ReportingPluginLimits{}, fmt.Errorf("VaultLimitsMaxKeyValueModifiedKeys: %w", err) + } + maxBlobPayloadBytes, err := resolve(cresettings.Default.VaultLimitsMaxBlobPayloadLength) + if err != nil { + return ocr3_1types.ReportingPluginLimits{}, fmt.Errorf("VaultLimitsMaxBlobPayloadLength: %w", err) + } + maxPerOracleUnexpiredBlobCumulativePayloadBytes, err := resolve(cresettings.Default.VaultLimitsMaxPerOracleUnexpiredBlobCumulativePayloadBytes) + if err != nil { + return ocr3_1types.ReportingPluginLimits{}, fmt.Errorf("VaultLimitsMaxPerOracleUnexpiredBlobCumulativePayloadBytes: %w", err) + } + maxPerOracleUnexpiredBlobCount, err := resolve(cresettings.Default.VaultLimitsMaxPerOracleUnexpiredBlobCount) + if err != nil { + return ocr3_1types.ReportingPluginLimits{}, fmt.Errorf("VaultLimitsMaxPerOracleUnexpiredBlobCount: %w", err) + } + + return ocr3_1types.ReportingPluginLimits{ + MaxQueryBytes: maxQueryBytes, + MaxObservationBytes: maxObservationBytes, + MaxReportsPlusPrecursorBytes: maxReportsPlusPrecursorBytes, + MaxReportBytes: maxReportBytes, + MaxReportCount: maxReportCount, + MaxKeyValueModifiedKeysPlusValuesBytes: maxKVModifiedKeysPlusValuesBytes, + MaxKeyValueModifiedKeys: maxKVModifiedKeys, + MaxBlobPayloadBytes: maxBlobPayloadBytes, + MaxPerOracleUnexpiredBlobCumulativePayloadBytes: maxPerOracleUnexpiredBlobCumulativePayloadBytes, + MaxPerOracleUnexpiredBlobCount: maxPerOracleUnexpiredBlobCount, + }, nil } -func (r *ReportingPluginFactory) NewReportingPlugin(ctx context.Context, config ocr3types.ReportingPluginConfig, fetcher ocr3_1types.BlobBroadcastFetcher) (ocr3_1types.ReportingPlugin[[]byte], ocr3_1types.ReportingPluginInfo, error) { - var configProto vaultcommon.ReportingPluginConfig - if err := proto.Unmarshal(config.OffchainConfig, &configProto); err != nil { - return nil, ocr3_1types.ReportingPluginInfo1{}, fmt.Errorf("could not unmarshal reporting plugin config: %w", err) +func newReportingPluginConfigLimiters(factory limits.Factory) (*ReportingPluginConfig, error) { + maxSecretsPerOwnerLimiter, err := limits.MakeBoundLimiter(factory, cresettings.Default.PerOwner.VaultSecretsLimit) + if err != nil { + return nil, fmt.Errorf("VaultSecretsLimit: %w", err) } - maxSecretsPerOwnerLimiter, err := limits.MakeBoundLimiter(r.limitsFactory, cresettings.Default.PerOwner.VaultSecretsLimit) + batchSize := cresettings.Default.VaultPluginBatchSizeLimit + + maxBatchSizeLimiter, err := limits.MakeBoundLimiter(factory, batchSize) if err != nil { - return nil, ocr3_1types.ReportingPluginInfo1{}, fmt.Errorf("could not create max secrets per owner limiter: %w", err) + return nil, fmt.Errorf("VaultPluginBatchSizeLimit: %w", err) } - batchSize := cresettings.Default.VaultPluginBatchSizeLimit + maxCiphertextLengthBytesLimiter, err := limits.MakeBoundLimiter(factory, cresettings.Default.VaultCiphertextSizeLimit) + if err != nil { + return nil, fmt.Errorf("VaultCiphertextSizeLimit: %w", err) + } - maxBatchSizeLimiter, err := limits.MakeBoundLimiter(r.limitsFactory, batchSize) + maxIdentifierKeyLengthBytesLimiter, err := limits.MakeBoundLimiter(factory, cresettings.Default.VaultIdentifierKeySizeLimit) if err != nil { - return nil, ocr3_1types.ReportingPluginInfo1{}, fmt.Errorf("could not create max batch size limiter: %w", err) + return nil, fmt.Errorf("VaultIdentifierKeySizeLimit: %w", err) } - maxCiphertextLengthBytesLimiter, err := limits.MakeBoundLimiter(r.limitsFactory, cresettings.Default.VaultCiphertextSizeLimit) + maxIdentifierOwnerLengthBytesLimiter, err := limits.MakeBoundLimiter(factory, cresettings.Default.VaultIdentifierOwnerSizeLimit) if err != nil { - return nil, ocr3_1types.ReportingPluginInfo1{}, fmt.Errorf("could not create default max ciphertext length limiter: %w", err) + return nil, fmt.Errorf("VaultIdentifierOwnerSizeLimit: %w", err) } - maxIdentifierKeyLengthBytesLimiter, err := limits.MakeBoundLimiter(r.limitsFactory, cresettings.Default.VaultIdentifierKeySizeLimit) + maxIdentifierNamespaceLengthBytesLimiter, err := limits.MakeBoundLimiter(factory, cresettings.Default.VaultIdentifierNamespaceSizeLimit) if err != nil { - return nil, ocr3_1types.ReportingPluginInfo1{}, fmt.Errorf("could not create default max identifier key length limiter: %w", err) + return nil, fmt.Errorf("VaultIdentifierNamespaceSizeLimit: %w", err) } - maxIdentifierOwnerLengthBytesLimiter, err := limits.MakeBoundLimiter(r.limitsFactory, cresettings.Default.VaultIdentifierOwnerSizeLimit) + return &ReportingPluginConfig{ + MaxSecretsPerOwner: maxSecretsPerOwnerLimiter, + MaxCiphertextLengthBytes: maxCiphertextLengthBytesLimiter, + MaxIdentifierKeyLengthBytes: maxIdentifierKeyLengthBytesLimiter, + MaxIdentifierOwnerLengthBytes: maxIdentifierOwnerLengthBytesLimiter, + MaxIdentifierNamespaceLengthBytes: maxIdentifierNamespaceLengthBytesLimiter, + BatchSize: batchSize, + MaxBatchSize: maxBatchSizeLimiter, + }, nil +} + +func logLimit[N limits.Number](ctx context.Context, lggr logger.Logger, limiter limits.BoundLimiter[N]) N { + ctx = contexts.WithCRE(ctx, contexts.CRE{Owner: "DUMMY-OWNER-FOR-LOGGING"}) + limit, err := limiter.Limit(ctx) if err != nil { - return nil, ocr3_1types.ReportingPluginInfo1{}, fmt.Errorf("could not create default max identifier owner length limiter: %w", err) + lggr.Errorw("could not fetch limit", "error", err) } + return limit +} - maxIdentifierNamespaceLengthBytesLimiter, err := limits.MakeBoundLimiter(r.limitsFactory, cresettings.Default.VaultIdentifierNamespaceSizeLimit) +func (r *ReportingPluginFactory) NewReportingPlugin(ctx context.Context, config ocr3types.ReportingPluginConfig, fetcher ocr3_1types.BlobBroadcastFetcher) (ocr3_1types.ReportingPlugin[[]byte], ocr3_1types.ReportingPluginInfo, error) { + var configProto vaultcommon.ReportingPluginConfig + if err := proto.Unmarshal(config.OffchainConfig, &configProto); err != nil { + return nil, ocr3_1types.ReportingPluginInfo1{}, fmt.Errorf("could not unmarshal reporting plugin config: %w", err) + } + + cfg, err := newReportingPluginConfigLimiters(r.limitsFactory) if err != nil { - return nil, ocr3_1types.ReportingPluginInfo1{}, fmt.Errorf("could not create default max identifier namespace length limiter: %w", err) + return nil, ocr3_1types.ReportingPluginInfo1{}, fmt.Errorf("could not create reporting plugin config limiters: %w", err) } if configProto.DKGInstanceID == nil { @@ -199,32 +280,28 @@ func (r *ReportingPluginFactory) NewReportingPlugin(ctx context.Context, config r.cfg.LazyPublicKey.Set(publicKey) + cfg.PublicKey = publicKey + cfg.PrivateKeyShare = privateKeyShare + r.lggr.Debugw("instantiating VaultReportingPlugin with config", - "maxSecretsPerOwner", logLimit(ctx, r.lggr, maxSecretsPerOwnerLimiter), - "maxCiphertextLengthBytes", logLimit(ctx, r.lggr, maxCiphertextLengthBytesLimiter), - "maxIdentifierKeyLengthBytes", logLimit(ctx, r.lggr, maxIdentifierKeyLengthBytesLimiter), - "maxIdentifierOwnerLengthBytes", logLimit(ctx, r.lggr, maxIdentifierOwnerLengthBytesLimiter), - "maxIdentifierNamespaceLengthBytes", logLimit(ctx, r.lggr, maxIdentifierNamespaceLengthBytesLimiter), - "batchSize", logLimit(ctx, r.lggr, maxBatchSizeLimiter), + "maxSecretsPerOwner", logLimit(ctx, r.lggr, cfg.MaxSecretsPerOwner), + "maxCiphertextLengthBytes", logLimit(ctx, r.lggr, cfg.MaxCiphertextLengthBytes), + "maxIdentifierKeyLengthBytes", logLimit(ctx, r.lggr, cfg.MaxIdentifierKeyLengthBytes), + "maxIdentifierOwnerLengthBytes", logLimit(ctx, r.lggr, cfg.MaxIdentifierOwnerLengthBytes), + "maxIdentifierNamespaceLengthBytes", logLimit(ctx, r.lggr, cfg.MaxIdentifierNamespaceLengthBytes), + "batchSize", logLimit(ctx, r.lggr, cfg.MaxBatchSize), ) - cfg := &ReportingPluginConfig{ - PublicKey: publicKey, - PrivateKeyShare: privateKeyShare, - MaxSecretsPerOwner: maxSecretsPerOwnerLimiter, - MaxCiphertextLengthBytes: maxCiphertextLengthBytesLimiter, - MaxIdentifierKeyLengthBytes: maxIdentifierKeyLengthBytesLimiter, - MaxIdentifierOwnerLengthBytes: maxIdentifierOwnerLengthBytesLimiter, - MaxIdentifierNamespaceLengthBytes: maxIdentifierNamespaceLengthBytesLimiter, - BatchSize: batchSize, - MaxBatchSize: maxBatchSizeLimiter, - } - metrics, err := newPluginMetrics(config.ConfigDigest.String()) if err != nil { return nil, ocr3_1types.ReportingPluginInfo1{}, fmt.Errorf("could not create plugin metrics: %w", err) } + pluginLimits, err := resolvePluginLimits(ctx, r.limitsFactory) + if err != nil { + return nil, ocr3_1types.ReportingPluginInfo1{}, fmt.Errorf("could not resolve plugin limits: %w", err) + } + return &ReportingPlugin{ lggr: r.lggr.Named("VaultReportingPlugin"), store: r.store, @@ -240,19 +317,8 @@ func (r *ReportingPluginFactory) NewReportingPlugin(ctx context.Context, config return handle.MarshalBinary() }, }, ocr3_1types.ReportingPluginInfo1{ - Name: "VaultReportingPlugin", - Limits: ocr3_1types.ReportingPluginLimits{ - MaxQueryBytes: cresettings.Default.VaultLimitsMaxQueryLength.DefaultValue, - MaxObservationBytes: cresettings.Default.VaultLimitsMaxObservationLength.DefaultValue, - MaxReportsPlusPrecursorBytes: cresettings.Default.VaultLimitsMaxReportsPlusPrecursorLength.DefaultValue, - MaxReportBytes: cresettings.Default.VaultLimitsMaxReportLength.DefaultValue, - MaxReportCount: cresettings.Default.VaultLimitsMaxReportCount.DefaultValue, - MaxKeyValueModifiedKeysPlusValuesBytes: cresettings.Default.VaultLimitsMaxKeyValueModifiedKeysPlusValuesLength.DefaultValue, - MaxKeyValueModifiedKeys: cresettings.Default.VaultLimitsMaxKeyValueModifiedKeys.DefaultValue, - MaxBlobPayloadBytes: cresettings.Default.VaultLimitsMaxBlobPayloadLength.DefaultValue, - MaxPerOracleUnexpiredBlobCumulativePayloadBytes: cresettings.Default.VaultLimitsMaxPerOracleUnexpiredBlobCumulativePayloadBytes.DefaultValue, - MaxPerOracleUnexpiredBlobCount: cresettings.Default.VaultLimitsMaxPerOracleUnexpiredBlobCount.DefaultValue, - }, + Name: "VaultReportingPlugin", + Limits: pluginLimits, }, nil } From ed26a173210ac1a96ba89918ca142dce1ccfd800 Mon Sep 17 00:00:00 2001 From: Prashant Yadav Date: Wed, 4 Mar 2026 14:16:39 -0800 Subject: [PATCH 03/15] lint --- core/services/ocr2/plugins/vault/plugin.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/core/services/ocr2/plugins/vault/plugin.go b/core/services/ocr2/plugins/vault/plugin.go index 228323df8af..cc3945a7bc1 100644 --- a/core/services/ocr2/plugins/vault/plugin.go +++ b/core/services/ocr2/plugins/vault/plugin.go @@ -142,7 +142,7 @@ func (r *ReportingPluginFactory) getKeyMaterial(ctx context.Context, instanceID func resolvePluginLimits(ctx context.Context, factory limits.Factory) (ocr3_1types.ReportingPluginLimits, error) { resolve := func(s settings.Setting[int]) (int, error) { - limiter, err := limits.MakeBoundLimiter(factory, s) + limiter, err := limits.MakeUpperBoundLimiter(factory, s) if err != nil { return 0, err } @@ -205,34 +205,34 @@ func resolvePluginLimits(ctx context.Context, factory limits.Factory) (ocr3_1typ } func newReportingPluginConfigLimiters(factory limits.Factory) (*ReportingPluginConfig, error) { - maxSecretsPerOwnerLimiter, err := limits.MakeBoundLimiter(factory, cresettings.Default.PerOwner.VaultSecretsLimit) + maxSecretsPerOwnerLimiter, err := limits.MakeUpperBoundLimiter(factory, cresettings.Default.PerOwner.VaultSecretsLimit) if err != nil { return nil, fmt.Errorf("VaultSecretsLimit: %w", err) } batchSize := cresettings.Default.VaultPluginBatchSizeLimit - maxBatchSizeLimiter, err := limits.MakeBoundLimiter(factory, batchSize) + maxBatchSizeLimiter, err := limits.MakeUpperBoundLimiter(factory, batchSize) if err != nil { return nil, fmt.Errorf("VaultPluginBatchSizeLimit: %w", err) } - maxCiphertextLengthBytesLimiter, err := limits.MakeBoundLimiter(factory, cresettings.Default.VaultCiphertextSizeLimit) + maxCiphertextLengthBytesLimiter, err := limits.MakeUpperBoundLimiter(factory, cresettings.Default.VaultCiphertextSizeLimit) if err != nil { return nil, fmt.Errorf("VaultCiphertextSizeLimit: %w", err) } - maxIdentifierKeyLengthBytesLimiter, err := limits.MakeBoundLimiter(factory, cresettings.Default.VaultIdentifierKeySizeLimit) + maxIdentifierKeyLengthBytesLimiter, err := limits.MakeUpperBoundLimiter(factory, cresettings.Default.VaultIdentifierKeySizeLimit) if err != nil { return nil, fmt.Errorf("VaultIdentifierKeySizeLimit: %w", err) } - maxIdentifierOwnerLengthBytesLimiter, err := limits.MakeBoundLimiter(factory, cresettings.Default.VaultIdentifierOwnerSizeLimit) + maxIdentifierOwnerLengthBytesLimiter, err := limits.MakeUpperBoundLimiter(factory, cresettings.Default.VaultIdentifierOwnerSizeLimit) if err != nil { return nil, fmt.Errorf("VaultIdentifierOwnerSizeLimit: %w", err) } - maxIdentifierNamespaceLengthBytesLimiter, err := limits.MakeBoundLimiter(factory, cresettings.Default.VaultIdentifierNamespaceSizeLimit) + maxIdentifierNamespaceLengthBytesLimiter, err := limits.MakeUpperBoundLimiter(factory, cresettings.Default.VaultIdentifierNamespaceSizeLimit) if err != nil { return nil, fmt.Errorf("VaultIdentifierNamespaceSizeLimit: %w", err) } From a47678d8dde0dc10ff6ad658bafcb06c55cf2661 Mon Sep 17 00:00:00 2001 From: Prashant Yadav Date: Thu, 5 Mar 2026 17:44:30 -0800 Subject: [PATCH 04/15] revert 2 fields --- core/services/ocr2/plugins/vault/plugin.go | 34 +++++++++++-------- .../ocr2/plugins/vault/plugin_test.go | 7 ++-- 2 files changed, 23 insertions(+), 18 deletions(-) diff --git a/core/services/ocr2/plugins/vault/plugin.go b/core/services/ocr2/plugins/vault/plugin.go index cc3945a7bc1..f97fae9a714 100644 --- a/core/services/ocr2/plugins/vault/plugin.go +++ b/core/services/ocr2/plugins/vault/plugin.go @@ -205,18 +205,6 @@ func resolvePluginLimits(ctx context.Context, factory limits.Factory) (ocr3_1typ } func newReportingPluginConfigLimiters(factory limits.Factory) (*ReportingPluginConfig, error) { - maxSecretsPerOwnerLimiter, err := limits.MakeUpperBoundLimiter(factory, cresettings.Default.PerOwner.VaultSecretsLimit) - if err != nil { - return nil, fmt.Errorf("VaultSecretsLimit: %w", err) - } - - batchSize := cresettings.Default.VaultPluginBatchSizeLimit - - maxBatchSizeLimiter, err := limits.MakeUpperBoundLimiter(factory, batchSize) - if err != nil { - return nil, fmt.Errorf("VaultPluginBatchSizeLimit: %w", err) - } - maxCiphertextLengthBytesLimiter, err := limits.MakeUpperBoundLimiter(factory, cresettings.Default.VaultCiphertextSizeLimit) if err != nil { return nil, fmt.Errorf("VaultCiphertextSizeLimit: %w", err) @@ -238,13 +226,10 @@ func newReportingPluginConfigLimiters(factory limits.Factory) (*ReportingPluginC } return &ReportingPluginConfig{ - MaxSecretsPerOwner: maxSecretsPerOwnerLimiter, MaxCiphertextLengthBytes: maxCiphertextLengthBytesLimiter, MaxIdentifierKeyLengthBytes: maxIdentifierKeyLengthBytesLimiter, MaxIdentifierOwnerLengthBytes: maxIdentifierOwnerLengthBytesLimiter, MaxIdentifierNamespaceLengthBytes: maxIdentifierNamespaceLengthBytesLimiter, - BatchSize: batchSize, - MaxBatchSize: maxBatchSizeLimiter, }, nil } @@ -268,6 +253,25 @@ func (r *ReportingPluginFactory) NewReportingPlugin(ctx context.Context, config return nil, ocr3_1types.ReportingPluginInfo1{}, fmt.Errorf("could not create reporting plugin config limiters: %w", err) } + maxSecretsPerOwnerLimit := cresettings.Default.PerOwner.VaultSecretsLimit + if configProto.MaxSecretsPerOwner != 0 { + maxSecretsPerOwnerLimit.DefaultValue = int(configProto.MaxSecretsPerOwner) + } + cfg.MaxSecretsPerOwner, err = limits.MakeUpperBoundLimiter(r.limitsFactory, maxSecretsPerOwnerLimit) + if err != nil { + return nil, ocr3_1types.ReportingPluginInfo1{}, fmt.Errorf("could not create max secrets per owner limiter: %w", err) + } + + batchSize := cresettings.Default.VaultPluginBatchSizeLimit + if configProto.BatchSize != 0 { + batchSize.DefaultValue = int(configProto.BatchSize) + } + cfg.BatchSize = batchSize + cfg.MaxBatchSize, err = limits.MakeUpperBoundLimiter(r.limitsFactory, batchSize) + if err != nil { + return nil, ocr3_1types.ReportingPluginInfo1{}, fmt.Errorf("could not create max batch size limiter: %w", err) + } + if configProto.DKGInstanceID == nil { return nil, ocr3_1types.ReportingPluginInfo1{}, errors.New("DKG instance ID cannot be nil") } diff --git a/core/services/ocr2/plugins/vault/plugin_test.go b/core/services/ocr2/plugins/vault/plugin_test.go index e5bcfe260c6..141083a66c0 100644 --- a/core/services/ocr2/plugins/vault/plugin_test.go +++ b/core/services/ocr2/plugins/vault/plugin_test.go @@ -115,7 +115,8 @@ func TestPlugin_ReportingPluginFactory_UsesDefaultsIfNotProvidedInOffchainConfig assert.Equal(t, cresettings.Default.VaultLimitsMaxPerOracleUnexpiredBlobCumulativePayloadBytes.DefaultValue, infoObject.Limits.MaxPerOracleUnexpiredBlobCumulativePayloadBytes) assert.Equal(t, cresettings.Default.VaultLimitsMaxPerOracleUnexpiredBlobCount.DefaultValue, infoObject.Limits.MaxPerOracleUnexpiredBlobCount) - // Verify that configProto overrides are ignored — values should remain at cresettings defaults. + // Verify that configProto overrides apply to BatchSize and MaxSecretsPerOwner, + // while other fields remain at cresettings defaults. cfg = vaultcommon.ReportingPluginConfig{ BatchSize: 2, MaxSecretsPerOwner: 2, @@ -139,8 +140,8 @@ func TestPlugin_ReportingPluginFactory_UsesDefaultsIfNotProvidedInOffchainConfig require.NoError(t, err) typedRP = rp.(*ReportingPlugin) - assert.Equal(t, cresettings.Default.VaultPluginBatchSizeLimit.DefaultValue, typedRP.cfg.BatchSize.DefaultValue) - assertLimit(t, 100, typedRP.cfg.MaxSecretsPerOwner) + assert.Equal(t, 2, typedRP.cfg.BatchSize.DefaultValue) + assertLimit(t, 2, typedRP.cfg.MaxSecretsPerOwner) assertLimit(t, 2000, typedRP.cfg.MaxCiphertextLengthBytes) assertLimit(t, 64, typedRP.cfg.MaxIdentifierOwnerLengthBytes) assertLimit(t, 64, typedRP.cfg.MaxIdentifierNamespaceLengthBytes) From 10402446b4b067b0726d5262dc5623e78819947b Mon Sep 17 00:00:00 2001 From: Prashant Yadav Date: Mon, 9 Mar 2026 12:32:16 -0700 Subject: [PATCH 05/15] go mod --- core/scripts/go.mod | 2 +- core/scripts/go.sum | 4 +- core/services/ocr2/plugins/vault/plugin.go | 50 +++++++++++-------- .../ocr2/plugins/vault/plugin_test.go | 34 ++++++------- 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 +- 16 files changed, 67 insertions(+), 59 deletions(-) diff --git a/core/scripts/go.mod b/core/scripts/go.mod index c492702cb6c..590e5d9853c 100644 --- a/core/scripts/go.mod +++ b/core/scripts/go.mod @@ -46,7 +46,7 @@ require ( github.com/shopspring/decimal v1.4.0 github.com/smartcontractkit/chainlink-automation v0.8.1 github.com/smartcontractkit/chainlink-ccip v0.1.1-solana.0.20260303102708-6caf8c4ea3b4 - github.com/smartcontractkit/chainlink-common v0.10.1-0.20260304203631-0eb0965cfee9 + github.com/smartcontractkit/chainlink-common v0.10.1-0.20260309192008-52eea801855c github.com/smartcontractkit/chainlink-common/keystore v1.0.2 github.com/smartcontractkit/chainlink-data-streams v0.1.12-0.20260227110503-42b236799872 github.com/smartcontractkit/chainlink-deployments-framework v0.80.1-0.20260209182815-b296b7df28a6 diff --git a/core/scripts/go.sum b/core/scripts/go.sum index 118b492c4fc..56ce0110cb7 100644 --- a/core/scripts/go.sum +++ b/core/scripts/go.sum @@ -1607,8 +1607,8 @@ github.com/smartcontractkit/chainlink-ccip/deployment v0.0.0-20260129103204-4c84 github.com/smartcontractkit/chainlink-ccip/deployment v0.0.0-20260129103204-4c8453dd8139/go.mod h1:gUbichNQBqk+fBF2aV40ZkzFmAJ8SygH6DEPd3cJkQE= github.com/smartcontractkit/chainlink-ccv v0.0.0-20260225114453-965dabf4bcb0 h1:kaIN9AjmCEZAEmIMhIqmKddKFqGBVsKToNABk+TWsRY= github.com/smartcontractkit/chainlink-ccv v0.0.0-20260225114453-965dabf4bcb0/go.mod h1:RnuNcn7DZmjmzEkeEWX0uL5y1oslB3c9URPLOjFU+jE= -github.com/smartcontractkit/chainlink-common v0.10.1-0.20260304203631-0eb0965cfee9 h1:S3++V+hCbJuNPO9xyL2Puy4S7oF0ltzlKxpvfZGxxOM= -github.com/smartcontractkit/chainlink-common v0.10.1-0.20260304203631-0eb0965cfee9/go.mod h1:0ghbAr7tRO0tT5ZqBXhOyzgUO37tNNe33Yn0hskauVM= +github.com/smartcontractkit/chainlink-common v0.10.1-0.20260309192008-52eea801855c h1:atc8EEM0vmsYutiq4mU2Zcc0TpxoezTniPtsRs6YX14= +github.com/smartcontractkit/chainlink-common v0.10.1-0.20260309192008-52eea801855c/go.mod h1:0ghbAr7tRO0tT5ZqBXhOyzgUO37tNNe33Yn0hskauVM= github.com/smartcontractkit/chainlink-common/keystore v1.0.2 h1:AWisx4JT3QV8tcgh6J5NCrex+wAgTYpWyHsyNPSXzsQ= github.com/smartcontractkit/chainlink-common/keystore v1.0.2/go.mod h1:rSkIHdomyak3YnUtXLenl6poIq8q0V3UZPiiyYqPdGA= github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.11-0.20251211140724-319861e514c4 h1:NOUsjsMzNecbjiPWUQGlRSRAutEvCFrqqyETDJeh5q4= diff --git a/core/services/ocr2/plugins/vault/plugin.go b/core/services/ocr2/plugins/vault/plugin.go index f97fae9a714..c2990f6d910 100644 --- a/core/services/ocr2/plugins/vault/plugin.go +++ b/core/services/ocr2/plugins/vault/plugin.go @@ -141,7 +141,15 @@ func (r *ReportingPluginFactory) getKeyMaterial(ctx context.Context, instanceID } func resolvePluginLimits(ctx context.Context, factory limits.Factory) (ocr3_1types.ReportingPluginLimits, error) { - resolve := func(s settings.Setting[int]) (int, error) { + resolveSize := func(s settings.Setting[pkgconfig.Size]) (int, error) { + limiter, err := limits.MakeUpperBoundLimiter(factory, s) + if err != nil { + return 0, err + } + v, err := limiter.Limit(ctx) + return int(v), err + } + resolveInt := func(s settings.Setting[int]) (int, error) { limiter, err := limits.MakeUpperBoundLimiter(factory, s) if err != nil { return 0, err @@ -149,45 +157,45 @@ func resolvePluginLimits(ctx context.Context, factory limits.Factory) (ocr3_1typ return limiter.Limit(ctx) } - maxQueryBytes, err := resolve(cresettings.Default.VaultLimitsMaxQueryLength) + maxQueryBytes, err := resolveSize(cresettings.Default.VaultMaxQuerySizeLimit) if err != nil { - return ocr3_1types.ReportingPluginLimits{}, fmt.Errorf("VaultLimitsMaxQueryLength: %w", err) + return ocr3_1types.ReportingPluginLimits{}, fmt.Errorf("VaultMaxQuerySizeLimit: %w", err) } - maxObservationBytes, err := resolve(cresettings.Default.VaultLimitsMaxObservationLength) + maxObservationBytes, err := resolveSize(cresettings.Default.VaultMaxObservationSizeLimit) if err != nil { - return ocr3_1types.ReportingPluginLimits{}, fmt.Errorf("VaultLimitsMaxObservationLength: %w", err) + return ocr3_1types.ReportingPluginLimits{}, fmt.Errorf("VaultMaxObservationSizeLimit: %w", err) } - maxReportsPlusPrecursorBytes, err := resolve(cresettings.Default.VaultLimitsMaxReportsPlusPrecursorLength) + maxReportsPlusPrecursorBytes, err := resolveSize(cresettings.Default.VaultMaxReportsPlusPrecursorSizeLimit) if err != nil { - return ocr3_1types.ReportingPluginLimits{}, fmt.Errorf("VaultLimitsMaxReportsPlusPrecursorLength: %w", err) + return ocr3_1types.ReportingPluginLimits{}, fmt.Errorf("VaultMaxReportsPlusPrecursorSizeLimit: %w", err) } - maxReportBytes, err := resolve(cresettings.Default.VaultLimitsMaxReportLength) + maxReportBytes, err := resolveSize(cresettings.Default.VaultMaxReportSizeLimit) if err != nil { - return ocr3_1types.ReportingPluginLimits{}, fmt.Errorf("VaultLimitsMaxReportLength: %w", err) + return ocr3_1types.ReportingPluginLimits{}, fmt.Errorf("VaultMaxReportSizeLimit: %w", err) } - maxReportCount, err := resolve(cresettings.Default.VaultLimitsMaxReportCount) + maxReportCount, err := resolveInt(cresettings.Default.VaultMaxReportCount) if err != nil { - return ocr3_1types.ReportingPluginLimits{}, fmt.Errorf("VaultLimitsMaxReportCount: %w", err) + return ocr3_1types.ReportingPluginLimits{}, fmt.Errorf("VaultMaxReportCount: %w", err) } - maxKVModifiedKeysPlusValuesBytes, err := resolve(cresettings.Default.VaultLimitsMaxKeyValueModifiedKeysPlusValuesLength) + maxKVModifiedKeysPlusValuesBytes, err := resolveSize(cresettings.Default.VaultMaxKeyValueModifiedKeysPlusValuesSizeLimit) if err != nil { - return ocr3_1types.ReportingPluginLimits{}, fmt.Errorf("VaultLimitsMaxKeyValueModifiedKeysPlusValuesLength: %w", err) + return ocr3_1types.ReportingPluginLimits{}, fmt.Errorf("VaultMaxKeyValueModifiedKeysPlusValuesSizeLimit: %w", err) } - maxKVModifiedKeys, err := resolve(cresettings.Default.VaultLimitsMaxKeyValueModifiedKeys) + maxKVModifiedKeys, err := resolveInt(cresettings.Default.VaultMaxKeyValueModifiedKeys) if err != nil { - return ocr3_1types.ReportingPluginLimits{}, fmt.Errorf("VaultLimitsMaxKeyValueModifiedKeys: %w", err) + return ocr3_1types.ReportingPluginLimits{}, fmt.Errorf("VaultMaxKeyValueModifiedKeys: %w", err) } - maxBlobPayloadBytes, err := resolve(cresettings.Default.VaultLimitsMaxBlobPayloadLength) + maxBlobPayloadBytes, err := resolveSize(cresettings.Default.VaultMaxBlobPayloadSizeLimit) if err != nil { - return ocr3_1types.ReportingPluginLimits{}, fmt.Errorf("VaultLimitsMaxBlobPayloadLength: %w", err) + return ocr3_1types.ReportingPluginLimits{}, fmt.Errorf("VaultMaxBlobPayloadSizeLimit: %w", err) } - maxPerOracleUnexpiredBlobCumulativePayloadBytes, err := resolve(cresettings.Default.VaultLimitsMaxPerOracleUnexpiredBlobCumulativePayloadBytes) + maxPerOracleUnexpiredBlobCumulativePayloadBytes, err := resolveSize(cresettings.Default.VaultMaxPerOracleUnexpiredBlobCumulativePayloadSizeLimit) if err != nil { - return ocr3_1types.ReportingPluginLimits{}, fmt.Errorf("VaultLimitsMaxPerOracleUnexpiredBlobCumulativePayloadBytes: %w", err) + return ocr3_1types.ReportingPluginLimits{}, fmt.Errorf("VaultMaxPerOracleUnexpiredBlobCumulativePayloadSizeLimit: %w", err) } - maxPerOracleUnexpiredBlobCount, err := resolve(cresettings.Default.VaultLimitsMaxPerOracleUnexpiredBlobCount) + maxPerOracleUnexpiredBlobCount, err := resolveInt(cresettings.Default.VaultMaxPerOracleUnexpiredBlobCount) if err != nil { - return ocr3_1types.ReportingPluginLimits{}, fmt.Errorf("VaultLimitsMaxPerOracleUnexpiredBlobCount: %w", err) + return ocr3_1types.ReportingPluginLimits{}, fmt.Errorf("VaultMaxPerOracleUnexpiredBlobCount: %w", err) } return ocr3_1types.ReportingPluginLimits{ diff --git a/core/services/ocr2/plugins/vault/plugin_test.go b/core/services/ocr2/plugins/vault/plugin_test.go index 141083a66c0..cb824e684a9 100644 --- a/core/services/ocr2/plugins/vault/plugin_test.go +++ b/core/services/ocr2/plugins/vault/plugin_test.go @@ -104,16 +104,16 @@ func TestPlugin_ReportingPluginFactory_UsesDefaultsIfNotProvidedInOffchainConfig infoObject, ok := info.(ocr3_1types.ReportingPluginInfo1) assert.True(t, ok, "ReportingPluginInfo not of type ReportingPluginInfo1") assert.Equal(t, "VaultReportingPlugin", infoObject.Name) - assert.Equal(t, cresettings.Default.VaultLimitsMaxQueryLength.DefaultValue, infoObject.Limits.MaxQueryBytes) - assert.Equal(t, cresettings.Default.VaultLimitsMaxObservationLength.DefaultValue, infoObject.Limits.MaxObservationBytes) - assert.Equal(t, cresettings.Default.VaultLimitsMaxReportsPlusPrecursorLength.DefaultValue, infoObject.Limits.MaxReportsPlusPrecursorBytes) - assert.Equal(t, cresettings.Default.VaultLimitsMaxReportLength.DefaultValue, infoObject.Limits.MaxReportBytes) - assert.Equal(t, cresettings.Default.VaultLimitsMaxReportCount.DefaultValue, infoObject.Limits.MaxReportCount) - assert.Equal(t, cresettings.Default.VaultLimitsMaxKeyValueModifiedKeysPlusValuesLength.DefaultValue, infoObject.Limits.MaxKeyValueModifiedKeysPlusValuesBytes) - assert.Equal(t, cresettings.Default.VaultLimitsMaxKeyValueModifiedKeys.DefaultValue, infoObject.Limits.MaxKeyValueModifiedKeys) - assert.Equal(t, cresettings.Default.VaultLimitsMaxBlobPayloadLength.DefaultValue, infoObject.Limits.MaxBlobPayloadBytes) - assert.Equal(t, cresettings.Default.VaultLimitsMaxPerOracleUnexpiredBlobCumulativePayloadBytes.DefaultValue, infoObject.Limits.MaxPerOracleUnexpiredBlobCumulativePayloadBytes) - assert.Equal(t, cresettings.Default.VaultLimitsMaxPerOracleUnexpiredBlobCount.DefaultValue, infoObject.Limits.MaxPerOracleUnexpiredBlobCount) + assert.Equal(t, int(cresettings.Default.VaultMaxQuerySizeLimit.DefaultValue), infoObject.Limits.MaxQueryBytes) + assert.Equal(t, int(cresettings.Default.VaultMaxObservationSizeLimit.DefaultValue), infoObject.Limits.MaxObservationBytes) + assert.Equal(t, int(cresettings.Default.VaultMaxReportsPlusPrecursorSizeLimit.DefaultValue), infoObject.Limits.MaxReportsPlusPrecursorBytes) + assert.Equal(t, int(cresettings.Default.VaultMaxReportSizeLimit.DefaultValue), infoObject.Limits.MaxReportBytes) + assert.Equal(t, cresettings.Default.VaultMaxReportCount.DefaultValue, infoObject.Limits.MaxReportCount) + assert.Equal(t, int(cresettings.Default.VaultMaxKeyValueModifiedKeysPlusValuesSizeLimit.DefaultValue), infoObject.Limits.MaxKeyValueModifiedKeysPlusValuesBytes) + assert.Equal(t, cresettings.Default.VaultMaxKeyValueModifiedKeys.DefaultValue, infoObject.Limits.MaxKeyValueModifiedKeys) + assert.Equal(t, int(cresettings.Default.VaultMaxBlobPayloadSizeLimit.DefaultValue), infoObject.Limits.MaxBlobPayloadBytes) + assert.Equal(t, int(cresettings.Default.VaultMaxPerOracleUnexpiredBlobCumulativePayloadSizeLimit.DefaultValue), infoObject.Limits.MaxPerOracleUnexpiredBlobCumulativePayloadBytes) + assert.Equal(t, cresettings.Default.VaultMaxPerOracleUnexpiredBlobCount.DefaultValue, infoObject.Limits.MaxPerOracleUnexpiredBlobCount) // Verify that configProto overrides apply to BatchSize and MaxSecretsPerOwner, // while other fields remain at cresettings defaults. @@ -150,13 +150,13 @@ func TestPlugin_ReportingPluginFactory_UsesDefaultsIfNotProvidedInOffchainConfig infoObject, ok = info.(ocr3_1types.ReportingPluginInfo1) assert.True(t, ok, "ReportingPluginInfo not of type ReportingPluginInfo1") assert.Equal(t, "VaultReportingPlugin", infoObject.Name) - assert.Equal(t, cresettings.Default.VaultLimitsMaxQueryLength.DefaultValue, infoObject.Limits.MaxQueryBytes) - assert.Equal(t, cresettings.Default.VaultLimitsMaxObservationLength.DefaultValue, infoObject.Limits.MaxObservationBytes) - assert.Equal(t, cresettings.Default.VaultLimitsMaxReportsPlusPrecursorLength.DefaultValue, infoObject.Limits.MaxReportsPlusPrecursorBytes) - assert.Equal(t, cresettings.Default.VaultLimitsMaxReportLength.DefaultValue, infoObject.Limits.MaxReportBytes) - assert.Equal(t, cresettings.Default.VaultLimitsMaxReportCount.DefaultValue, infoObject.Limits.MaxReportCount) - assert.Equal(t, cresettings.Default.VaultLimitsMaxKeyValueModifiedKeysPlusValuesLength.DefaultValue, infoObject.Limits.MaxKeyValueModifiedKeysPlusValuesBytes) - assert.Equal(t, cresettings.Default.VaultLimitsMaxBlobPayloadLength.DefaultValue, infoObject.Limits.MaxBlobPayloadBytes) + assert.Equal(t, int(cresettings.Default.VaultMaxQuerySizeLimit.DefaultValue), infoObject.Limits.MaxQueryBytes) + assert.Equal(t, int(cresettings.Default.VaultMaxObservationSizeLimit.DefaultValue), infoObject.Limits.MaxObservationBytes) + assert.Equal(t, int(cresettings.Default.VaultMaxReportsPlusPrecursorSizeLimit.DefaultValue), infoObject.Limits.MaxReportsPlusPrecursorBytes) + assert.Equal(t, int(cresettings.Default.VaultMaxReportSizeLimit.DefaultValue), infoObject.Limits.MaxReportBytes) + assert.Equal(t, cresettings.Default.VaultMaxReportCount.DefaultValue, infoObject.Limits.MaxReportCount) + assert.Equal(t, int(cresettings.Default.VaultMaxKeyValueModifiedKeysPlusValuesSizeLimit.DefaultValue), infoObject.Limits.MaxKeyValueModifiedKeysPlusValuesBytes) + assert.Equal(t, int(cresettings.Default.VaultMaxBlobPayloadSizeLimit.DefaultValue), infoObject.Limits.MaxBlobPayloadBytes) } func TestPlugin_ReportingPluginFactory_UseDKGResult(t *testing.T) { diff --git a/deployment/go.mod b/deployment/go.mod index 02d923f30f7..75606ceb6c1 100644 --- a/deployment/go.mod +++ b/deployment/go.mod @@ -43,7 +43,7 @@ require ( github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20260121163256-85accaf3d28d github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings v0.0.0-20250912190424-fd2e35d7deb5 github.com/smartcontractkit/chainlink-ccip/deployment v0.0.0-20260129103204-4c8453dd8139 - github.com/smartcontractkit/chainlink-common v0.10.1-0.20260304203631-0eb0965cfee9 + github.com/smartcontractkit/chainlink-common v0.10.1-0.20260309192008-52eea801855c github.com/smartcontractkit/chainlink-common/keystore v1.0.2 github.com/smartcontractkit/chainlink-deployments-framework v0.80.1-0.20260209182815-b296b7df28a6 github.com/smartcontractkit/chainlink-evm v0.3.4-0.20260303141232-9cc3feb83863 diff --git a/deployment/go.sum b/deployment/go.sum index a6253ca8c9f..bfd02302abc 100644 --- a/deployment/go.sum +++ b/deployment/go.sum @@ -1370,8 +1370,8 @@ github.com/smartcontractkit/chainlink-ccip/deployment v0.0.0-20260129103204-4c84 github.com/smartcontractkit/chainlink-ccip/deployment v0.0.0-20260129103204-4c8453dd8139/go.mod h1:gUbichNQBqk+fBF2aV40ZkzFmAJ8SygH6DEPd3cJkQE= github.com/smartcontractkit/chainlink-ccv v0.0.0-20260225114453-965dabf4bcb0 h1:kaIN9AjmCEZAEmIMhIqmKddKFqGBVsKToNABk+TWsRY= github.com/smartcontractkit/chainlink-ccv v0.0.0-20260225114453-965dabf4bcb0/go.mod h1:RnuNcn7DZmjmzEkeEWX0uL5y1oslB3c9URPLOjFU+jE= -github.com/smartcontractkit/chainlink-common v0.10.1-0.20260304203631-0eb0965cfee9 h1:S3++V+hCbJuNPO9xyL2Puy4S7oF0ltzlKxpvfZGxxOM= -github.com/smartcontractkit/chainlink-common v0.10.1-0.20260304203631-0eb0965cfee9/go.mod h1:0ghbAr7tRO0tT5ZqBXhOyzgUO37tNNe33Yn0hskauVM= +github.com/smartcontractkit/chainlink-common v0.10.1-0.20260309192008-52eea801855c h1:atc8EEM0vmsYutiq4mU2Zcc0TpxoezTniPtsRs6YX14= +github.com/smartcontractkit/chainlink-common v0.10.1-0.20260309192008-52eea801855c/go.mod h1:0ghbAr7tRO0tT5ZqBXhOyzgUO37tNNe33Yn0hskauVM= github.com/smartcontractkit/chainlink-common/keystore v1.0.2 h1:AWisx4JT3QV8tcgh6J5NCrex+wAgTYpWyHsyNPSXzsQ= github.com/smartcontractkit/chainlink-common/keystore v1.0.2/go.mod h1:rSkIHdomyak3YnUtXLenl6poIq8q0V3UZPiiyYqPdGA= github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.10 h1:FJAFgXS9oqASnkS03RE1HQwYQQxrO4l46O5JSzxqLgg= diff --git a/go.mod b/go.mod index 940aa7c417e..5f40192a766 100644 --- a/go.mod +++ b/go.mod @@ -84,7 +84,7 @@ require ( github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20260121163256-85accaf3d28d github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings v0.0.0-20250912190424-fd2e35d7deb5 github.com/smartcontractkit/chainlink-ccv v0.0.0-20260225114453-965dabf4bcb0 - github.com/smartcontractkit/chainlink-common v0.10.1-0.20260304203631-0eb0965cfee9 + github.com/smartcontractkit/chainlink-common v0.10.1-0.20260309192008-52eea801855c github.com/smartcontractkit/chainlink-common/keystore v1.0.2 github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.10 github.com/smartcontractkit/chainlink-data-streams v0.1.12-0.20260227110503-42b236799872 diff --git a/go.sum b/go.sum index 4cb93ceebf2..9dc62136c18 100644 --- a/go.sum +++ b/go.sum @@ -1180,8 +1180,8 @@ github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings v0.0.0-20250 github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings v0.0.0-20250912190424-fd2e35d7deb5/go.mod h1:xtZNi6pOKdC3sLvokDvXOhgHzT+cyBqH/gWwvxTxqrg= github.com/smartcontractkit/chainlink-ccv v0.0.0-20260225114453-965dabf4bcb0 h1:kaIN9AjmCEZAEmIMhIqmKddKFqGBVsKToNABk+TWsRY= github.com/smartcontractkit/chainlink-ccv v0.0.0-20260225114453-965dabf4bcb0/go.mod h1:RnuNcn7DZmjmzEkeEWX0uL5y1oslB3c9URPLOjFU+jE= -github.com/smartcontractkit/chainlink-common v0.10.1-0.20260304203631-0eb0965cfee9 h1:S3++V+hCbJuNPO9xyL2Puy4S7oF0ltzlKxpvfZGxxOM= -github.com/smartcontractkit/chainlink-common v0.10.1-0.20260304203631-0eb0965cfee9/go.mod h1:0ghbAr7tRO0tT5ZqBXhOyzgUO37tNNe33Yn0hskauVM= +github.com/smartcontractkit/chainlink-common v0.10.1-0.20260309192008-52eea801855c h1:atc8EEM0vmsYutiq4mU2Zcc0TpxoezTniPtsRs6YX14= +github.com/smartcontractkit/chainlink-common v0.10.1-0.20260309192008-52eea801855c/go.mod h1:0ghbAr7tRO0tT5ZqBXhOyzgUO37tNNe33Yn0hskauVM= github.com/smartcontractkit/chainlink-common/keystore v1.0.2 h1:AWisx4JT3QV8tcgh6J5NCrex+wAgTYpWyHsyNPSXzsQ= github.com/smartcontractkit/chainlink-common/keystore v1.0.2/go.mod h1:rSkIHdomyak3YnUtXLenl6poIq8q0V3UZPiiyYqPdGA= github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.10 h1:FJAFgXS9oqASnkS03RE1HQwYQQxrO4l46O5JSzxqLgg= diff --git a/integration-tests/go.mod b/integration-tests/go.mod index a70847644d2..db9861901e1 100644 --- a/integration-tests/go.mod +++ b/integration-tests/go.mod @@ -50,7 +50,7 @@ require ( github.com/smartcontractkit/chainlink-ccip v0.1.1-solana.0.20260303102708-6caf8c4ea3b4 github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20260121163256-85accaf3d28d github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings v0.0.0-20250912190424-fd2e35d7deb5 - github.com/smartcontractkit/chainlink-common v0.10.1-0.20260304203631-0eb0965cfee9 + github.com/smartcontractkit/chainlink-common v0.10.1-0.20260309192008-52eea801855c github.com/smartcontractkit/chainlink-common/keystore v1.0.2 github.com/smartcontractkit/chainlink-deployments-framework v0.80.1-0.20260209182815-b296b7df28a6 github.com/smartcontractkit/chainlink-evm v0.3.4-0.20260303141232-9cc3feb83863 diff --git a/integration-tests/go.sum b/integration-tests/go.sum index 5e4ccbf2d88..c9471157b5f 100644 --- a/integration-tests/go.sum +++ b/integration-tests/go.sum @@ -1614,8 +1614,8 @@ github.com/smartcontractkit/chainlink-ccip/deployment v0.0.0-20260129103204-4c84 github.com/smartcontractkit/chainlink-ccip/deployment v0.0.0-20260129103204-4c8453dd8139/go.mod h1:gUbichNQBqk+fBF2aV40ZkzFmAJ8SygH6DEPd3cJkQE= github.com/smartcontractkit/chainlink-ccv v0.0.0-20260225114453-965dabf4bcb0 h1:kaIN9AjmCEZAEmIMhIqmKddKFqGBVsKToNABk+TWsRY= github.com/smartcontractkit/chainlink-ccv v0.0.0-20260225114453-965dabf4bcb0/go.mod h1:RnuNcn7DZmjmzEkeEWX0uL5y1oslB3c9URPLOjFU+jE= -github.com/smartcontractkit/chainlink-common v0.10.1-0.20260304203631-0eb0965cfee9 h1:S3++V+hCbJuNPO9xyL2Puy4S7oF0ltzlKxpvfZGxxOM= -github.com/smartcontractkit/chainlink-common v0.10.1-0.20260304203631-0eb0965cfee9/go.mod h1:0ghbAr7tRO0tT5ZqBXhOyzgUO37tNNe33Yn0hskauVM= +github.com/smartcontractkit/chainlink-common v0.10.1-0.20260309192008-52eea801855c h1:atc8EEM0vmsYutiq4mU2Zcc0TpxoezTniPtsRs6YX14= +github.com/smartcontractkit/chainlink-common v0.10.1-0.20260309192008-52eea801855c/go.mod h1:0ghbAr7tRO0tT5ZqBXhOyzgUO37tNNe33Yn0hskauVM= github.com/smartcontractkit/chainlink-common/keystore v1.0.2 h1:AWisx4JT3QV8tcgh6J5NCrex+wAgTYpWyHsyNPSXzsQ= github.com/smartcontractkit/chainlink-common/keystore v1.0.2/go.mod h1:rSkIHdomyak3YnUtXLenl6poIq8q0V3UZPiiyYqPdGA= github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.10 h1:FJAFgXS9oqASnkS03RE1HQwYQQxrO4l46O5JSzxqLgg= diff --git a/integration-tests/load/go.mod b/integration-tests/load/go.mod index 9b88f589f95..4984aaa2eae 100644 --- a/integration-tests/load/go.mod +++ b/integration-tests/load/go.mod @@ -32,7 +32,7 @@ require ( github.com/smartcontractkit/chainlink-ccip v0.1.1-solana.0.20260303102708-6caf8c4ea3b4 github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20260121163256-85accaf3d28d github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings v0.0.0-20250912190424-fd2e35d7deb5 - github.com/smartcontractkit/chainlink-common v0.10.1-0.20260304203631-0eb0965cfee9 + github.com/smartcontractkit/chainlink-common v0.10.1-0.20260309192008-52eea801855c github.com/smartcontractkit/chainlink-deployments-framework v0.80.1-0.20260209182815-b296b7df28a6 github.com/smartcontractkit/chainlink-evm v0.3.4-0.20260303141232-9cc3feb83863 github.com/smartcontractkit/chainlink-evm/gethwrappers v0.0.0-20251222115927-36a18321243c diff --git a/integration-tests/load/go.sum b/integration-tests/load/go.sum index abcd4d52c0a..34dee16fb2c 100644 --- a/integration-tests/load/go.sum +++ b/integration-tests/load/go.sum @@ -1592,8 +1592,8 @@ github.com/smartcontractkit/chainlink-ccip/deployment v0.0.0-20260129103204-4c84 github.com/smartcontractkit/chainlink-ccip/deployment v0.0.0-20260129103204-4c8453dd8139/go.mod h1:gUbichNQBqk+fBF2aV40ZkzFmAJ8SygH6DEPd3cJkQE= github.com/smartcontractkit/chainlink-ccv v0.0.0-20260225114453-965dabf4bcb0 h1:kaIN9AjmCEZAEmIMhIqmKddKFqGBVsKToNABk+TWsRY= github.com/smartcontractkit/chainlink-ccv v0.0.0-20260225114453-965dabf4bcb0/go.mod h1:RnuNcn7DZmjmzEkeEWX0uL5y1oslB3c9URPLOjFU+jE= -github.com/smartcontractkit/chainlink-common v0.10.1-0.20260304203631-0eb0965cfee9 h1:S3++V+hCbJuNPO9xyL2Puy4S7oF0ltzlKxpvfZGxxOM= -github.com/smartcontractkit/chainlink-common v0.10.1-0.20260304203631-0eb0965cfee9/go.mod h1:0ghbAr7tRO0tT5ZqBXhOyzgUO37tNNe33Yn0hskauVM= +github.com/smartcontractkit/chainlink-common v0.10.1-0.20260309192008-52eea801855c h1:atc8EEM0vmsYutiq4mU2Zcc0TpxoezTniPtsRs6YX14= +github.com/smartcontractkit/chainlink-common v0.10.1-0.20260309192008-52eea801855c/go.mod h1:0ghbAr7tRO0tT5ZqBXhOyzgUO37tNNe33Yn0hskauVM= github.com/smartcontractkit/chainlink-common/keystore v1.0.2 h1:AWisx4JT3QV8tcgh6J5NCrex+wAgTYpWyHsyNPSXzsQ= github.com/smartcontractkit/chainlink-common/keystore v1.0.2/go.mod h1:rSkIHdomyak3YnUtXLenl6poIq8q0V3UZPiiyYqPdGA= github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.10 h1:FJAFgXS9oqASnkS03RE1HQwYQQxrO4l46O5JSzxqLgg= diff --git a/system-tests/lib/go.mod b/system-tests/lib/go.mod index 62aff1b42b3..07024fb79a0 100644 --- a/system-tests/lib/go.mod +++ b/system-tests/lib/go.mod @@ -32,7 +32,7 @@ require ( github.com/sethvargo/go-retry v0.3.0 github.com/smartcontractkit/chain-selectors v1.0.97 github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20260121163256-85accaf3d28d - github.com/smartcontractkit/chainlink-common v0.10.1-0.20260304203631-0eb0965cfee9 + github.com/smartcontractkit/chainlink-common v0.10.1-0.20260309192008-52eea801855c github.com/smartcontractkit/chainlink-common/keystore v1.0.2 github.com/smartcontractkit/chainlink-deployments-framework v0.80.1-0.20260209182815-b296b7df28a6 github.com/smartcontractkit/chainlink-evm v0.3.4-0.20260303141232-9cc3feb83863 diff --git a/system-tests/lib/go.sum b/system-tests/lib/go.sum index 8d0d70098d4..dafce1ebb7c 100644 --- a/system-tests/lib/go.sum +++ b/system-tests/lib/go.sum @@ -1570,8 +1570,8 @@ github.com/smartcontractkit/chainlink-ccip/deployment v0.0.0-20260129103204-4c84 github.com/smartcontractkit/chainlink-ccip/deployment v0.0.0-20260129103204-4c8453dd8139/go.mod h1:gUbichNQBqk+fBF2aV40ZkzFmAJ8SygH6DEPd3cJkQE= github.com/smartcontractkit/chainlink-ccv v0.0.0-20260225114453-965dabf4bcb0 h1:kaIN9AjmCEZAEmIMhIqmKddKFqGBVsKToNABk+TWsRY= github.com/smartcontractkit/chainlink-ccv v0.0.0-20260225114453-965dabf4bcb0/go.mod h1:RnuNcn7DZmjmzEkeEWX0uL5y1oslB3c9URPLOjFU+jE= -github.com/smartcontractkit/chainlink-common v0.10.1-0.20260304203631-0eb0965cfee9 h1:S3++V+hCbJuNPO9xyL2Puy4S7oF0ltzlKxpvfZGxxOM= -github.com/smartcontractkit/chainlink-common v0.10.1-0.20260304203631-0eb0965cfee9/go.mod h1:0ghbAr7tRO0tT5ZqBXhOyzgUO37tNNe33Yn0hskauVM= +github.com/smartcontractkit/chainlink-common v0.10.1-0.20260309192008-52eea801855c h1:atc8EEM0vmsYutiq4mU2Zcc0TpxoezTniPtsRs6YX14= +github.com/smartcontractkit/chainlink-common v0.10.1-0.20260309192008-52eea801855c/go.mod h1:0ghbAr7tRO0tT5ZqBXhOyzgUO37tNNe33Yn0hskauVM= github.com/smartcontractkit/chainlink-common/keystore v1.0.2 h1:AWisx4JT3QV8tcgh6J5NCrex+wAgTYpWyHsyNPSXzsQ= github.com/smartcontractkit/chainlink-common/keystore v1.0.2/go.mod h1:rSkIHdomyak3YnUtXLenl6poIq8q0V3UZPiiyYqPdGA= github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.10 h1:FJAFgXS9oqASnkS03RE1HQwYQQxrO4l46O5JSzxqLgg= diff --git a/system-tests/tests/go.mod b/system-tests/tests/go.mod index ab9ea3813ca..8518da8b7d9 100644 --- a/system-tests/tests/go.mod +++ b/system-tests/tests/go.mod @@ -54,7 +54,7 @@ require ( github.com/rs/zerolog v1.34.0 github.com/shopspring/decimal v1.4.0 github.com/smartcontractkit/chain-selectors v1.0.97 - github.com/smartcontractkit/chainlink-common v0.10.1-0.20260304203631-0eb0965cfee9 + github.com/smartcontractkit/chainlink-common v0.10.1-0.20260309192008-52eea801855c github.com/smartcontractkit/chainlink-common/keystore v1.0.2 github.com/smartcontractkit/chainlink-data-streams v0.1.12-0.20260227110503-42b236799872 github.com/smartcontractkit/chainlink-deployments-framework v0.80.1-0.20260209182815-b296b7df28a6 diff --git a/system-tests/tests/go.sum b/system-tests/tests/go.sum index 0ad2e75797d..a130a613399 100644 --- a/system-tests/tests/go.sum +++ b/system-tests/tests/go.sum @@ -1780,8 +1780,8 @@ github.com/smartcontractkit/chainlink-ccip/deployment v0.0.0-20260129103204-4c84 github.com/smartcontractkit/chainlink-ccip/deployment v0.0.0-20260129103204-4c8453dd8139/go.mod h1:gUbichNQBqk+fBF2aV40ZkzFmAJ8SygH6DEPd3cJkQE= github.com/smartcontractkit/chainlink-ccv v0.0.0-20260225114453-965dabf4bcb0 h1:kaIN9AjmCEZAEmIMhIqmKddKFqGBVsKToNABk+TWsRY= github.com/smartcontractkit/chainlink-ccv v0.0.0-20260225114453-965dabf4bcb0/go.mod h1:RnuNcn7DZmjmzEkeEWX0uL5y1oslB3c9URPLOjFU+jE= -github.com/smartcontractkit/chainlink-common v0.10.1-0.20260304203631-0eb0965cfee9 h1:S3++V+hCbJuNPO9xyL2Puy4S7oF0ltzlKxpvfZGxxOM= -github.com/smartcontractkit/chainlink-common v0.10.1-0.20260304203631-0eb0965cfee9/go.mod h1:0ghbAr7tRO0tT5ZqBXhOyzgUO37tNNe33Yn0hskauVM= +github.com/smartcontractkit/chainlink-common v0.10.1-0.20260309192008-52eea801855c h1:atc8EEM0vmsYutiq4mU2Zcc0TpxoezTniPtsRs6YX14= +github.com/smartcontractkit/chainlink-common v0.10.1-0.20260309192008-52eea801855c/go.mod h1:0ghbAr7tRO0tT5ZqBXhOyzgUO37tNNe33Yn0hskauVM= github.com/smartcontractkit/chainlink-common/keystore v1.0.2 h1:AWisx4JT3QV8tcgh6J5NCrex+wAgTYpWyHsyNPSXzsQ= github.com/smartcontractkit/chainlink-common/keystore v1.0.2/go.mod h1:rSkIHdomyak3YnUtXLenl6poIq8q0V3UZPiiyYqPdGA= github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.11-0.20251211140724-319861e514c4 h1:NOUsjsMzNecbjiPWUQGlRSRAutEvCFrqqyETDJeh5q4= From e0e0399effb0e372e2b324ca0eb00d7396deba6e Mon Sep 17 00:00:00 2001 From: Prashant Yadav Date: Mon, 9 Mar 2026 15:12:56 -0700 Subject: [PATCH 06/15] test --- .../ocr2/plugins/vault/plugin_test.go | 145 ++++++++++++++++++ 1 file changed, 145 insertions(+) diff --git a/core/services/ocr2/plugins/vault/plugin_test.go b/core/services/ocr2/plugins/vault/plugin_test.go index dfc8b51abf2..d078b5c7ed4 100644 --- a/core/services/ocr2/plugins/vault/plugin_test.go +++ b/core/services/ocr2/plugins/vault/plugin_test.go @@ -2,10 +2,14 @@ package vault import ( "crypto/rand" + "encoding/base64" "encoding/hex" + "fmt" + "strings" "testing" "github.com/ethereum/go-ethereum/common" + "github.com/smartcontractkit/libocr/commontypes" "github.com/smartcontractkit/libocr/offchainreporting2plus/ocr3_1types" "github.com/smartcontractkit/libocr/offchainreporting2plus/ocr3types" "github.com/smartcontractkit/libocr/offchainreporting2plus/types" @@ -1984,6 +1988,74 @@ func TestPlugin_Observation_CreateSecretsRequest_Success(t *testing.T) { assert.Empty(t, resp.GetError()) } +func makeEncryptedShares(t *testing.T, ciphertext *tdh2easy.Ciphertext, privateShare *tdh2easy.PrivateShare, keys []string) []*vaultcommon.EncryptedShares { + t.Helper() + share, err := tdh2easy.Decrypt(ciphertext, privateShare) + require.NoError(t, err) + shareBytes, err := share.Marshal() + require.NoError(t, err) + + result := make([]*vaultcommon.EncryptedShares, len(keys)) + for i, pk := range keys { + pkBytes, err := hex.DecodeString(pk) + require.NoError(t, err) + pubKey := [32]byte(pkBytes) + encrypted, err := box.SealAnonymous(nil, shareBytes, &pubKey, rand.Reader) + require.NoError(t, err) + result[i] = &vaultcommon.EncryptedShares{ + EncryptionKey: pk, + Shares: []string{base64.StdEncoding.EncodeToString(encrypted)}, + } + } + return result +} + +func makeGetSecretsObservations( + t *testing.T, + numRequests int, + owner string, + namespace string, + encryptionKeys []string, + encryptedValue string, + ciphertext *tdh2easy.Ciphertext, + privateShare *tdh2easy.PrivateShare, +) []byte { + t.Helper() + var obs []observation + for i := range numRequests { + maxKey := fmt.Sprintf("%s%d", strings.Repeat("c", 64-1), i) + + id := &vaultcommon.SecretIdentifier{ + Owner: owner, + Namespace: namespace, + Key: maxKey, + } + req := &vaultcommon.GetSecretsRequest{ + Requests: []*vaultcommon.SecretRequest{ + { + Id: id, + EncryptionKeys: encryptionKeys, + }, + }, + } + resp := &vaultcommon.GetSecretsResponse{ + Responses: []*vaultcommon.SecretResponse{ + { + Id: id, + Result: &vaultcommon.SecretResponse_Data{ + Data: &vaultcommon.SecretData{ + EncryptedValue: encryptedValue, + EncryptedDecryptionKeyShares: makeEncryptedShares(t, ciphertext, privateShare, encryptionKeys), + }, + }, + }, + }, + } + obs = append(obs, observation{id, req, resp}) + } + return marshalObservations(t, obs...) +} + type observation struct { id *vaultcommon.SecretIdentifier req proto.Message @@ -2131,6 +2203,79 @@ func TestPlugin_StateTransition_InsufficientObservations(t *testing.T) { assert.Equal(t, 1, observed.FilterMessage("insufficient observations found for id").Len()) } +func TestPlugin_StateTransition_GetSecretsRequest_ResponseSizeWithinLimit(t *testing.T) { + lggr := logger.TestLogger(t) + store := requests.NewStore[*vaulttypes.Request]() + _, pk, shares, err := tdh2easy.GenerateKeys(4, 10) + require.NoError(t, err) + + numObservers := 10 + r := &ReportingPlugin{ + lggr: lggr, + onchainCfg: ocr3types.ReportingPluginConfig{ + N: 10, + F: 3, + }, + store: store, + cfg: makeReportingPluginConfig( + t, + 10, + pk, + shares[0], + 100, + 2000, + 64, + 64, + 64, + ), + } + + maxOwner := strings.Repeat("a", 64) + maxNamespace := strings.Repeat("b", 64) + + numEncryptionKeys := 10 + encryptionKeys := make([]string, numEncryptionKeys) + for i := range numEncryptionKeys { + pubK, _, err := box.GenerateKey(rand.Reader) + require.NoError(t, err) + encryptionKeys[i] = hex.EncodeToString(pubK[:]) + } + + plaintext := make([]byte, 1) + _, err = rand.Read(plaintext) + require.NoError(t, err) + var label [32]byte + copy(label[:], maxOwner[:32]) + ciphertext, err := tdh2easy.EncryptWithLabel(pk, plaintext, label) + require.NoError(t, err) + ciphertextBytes, err := ciphertext.Marshal() + require.NoError(t, err) + require.LessOrEqual(t, len(ciphertextBytes), 2000) + encryptedValue := hex.EncodeToString(ciphertextBytes) + + // Create 10 observations from different observers, each with a distinct decryption share. + aos := make([]types.AttributedObservation, numObservers) + for i := range numObservers { + aos[i] = types.AttributedObservation{ + Observer: commontypes.OracleID(i), + Observation: types.Observation(makeGetSecretsObservations(t, 10, maxOwner, maxNamespace, encryptionKeys, encryptedValue, ciphertext, shares[i])), + } + } + + kvStore := &kv{m: make(map[string]response)} + reportPrecursor, err := r.StateTransition( + t.Context(), + 1, + types.AttributedQuery{}, + aos, kvStore, nil) + require.NoError(t, err) + + t.Logf("StateTransition response size: %d bytes (%.2f KB)", len(reportPrecursor), float64(len(reportPrecursor))/1024.0) + maxResponseSize := 512 * 1024 + assert.LessOrEqual(t, len(reportPrecursor), maxResponseSize, + "StateTransition response size %d exceeds 512KB limit", len(reportPrecursor)) +} + func TestPlugin_ValidateObservations_InvalidObservations(t *testing.T) { lggr, _ := logger.TestLoggerObserved(t, zapcore.DebugLevel) store := requests.NewStore[*vaulttypes.Request]() From 5f9ed3ae29290462fc6eb78be28bb489c7ed6d56 Mon Sep 17 00:00:00 2001 From: Prashant Yadav Date: Tue, 10 Mar 2026 08:34:40 -0700 Subject: [PATCH 07/15] lint --- core/services/ocr2/plugins/vault/plugin_test.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/services/ocr2/plugins/vault/plugin_test.go b/core/services/ocr2/plugins/vault/plugin_test.go index d078b5c7ed4..fd698040084 100644 --- a/core/services/ocr2/plugins/vault/plugin_test.go +++ b/core/services/ocr2/plugins/vault/plugin_test.go @@ -2236,8 +2236,8 @@ func TestPlugin_StateTransition_GetSecretsRequest_ResponseSizeWithinLimit(t *tes numEncryptionKeys := 10 encryptionKeys := make([]string, numEncryptionKeys) for i := range numEncryptionKeys { - pubK, _, err := box.GenerateKey(rand.Reader) - require.NoError(t, err) + pubK, _, err2 := box.GenerateKey(rand.Reader) + require.NoError(t, err2) encryptionKeys[i] = hex.EncodeToString(pubK[:]) } @@ -2257,7 +2257,7 @@ func TestPlugin_StateTransition_GetSecretsRequest_ResponseSizeWithinLimit(t *tes aos := make([]types.AttributedObservation, numObservers) for i := range numObservers { aos[i] = types.AttributedObservation{ - Observer: commontypes.OracleID(i), + Observer: commontypes.OracleID(i), //nolint:gosec // G115 range is well within uint8 bounds Observation: types.Observation(makeGetSecretsObservations(t, 10, maxOwner, maxNamespace, encryptionKeys, encryptedValue, ciphertext, shares[i])), } } From f8486fd75cecaf0a94a2441950f60cadee281d6c Mon Sep 17 00:00:00 2001 From: Prashant Yadav Date: Tue, 10 Mar 2026 09:02:20 -0700 Subject: [PATCH 08/15] lint --- core/services/ocr2/plugins/vault/plugin_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/services/ocr2/plugins/vault/plugin_test.go b/core/services/ocr2/plugins/vault/plugin_test.go index fd698040084..ea50c182375 100644 --- a/core/services/ocr2/plugins/vault/plugin_test.go +++ b/core/services/ocr2/plugins/vault/plugin_test.go @@ -2021,7 +2021,7 @@ func makeGetSecretsObservations( privateShare *tdh2easy.PrivateShare, ) []byte { t.Helper() - var obs []observation + obs := make([]observation, 0, numRequests) for i := range numRequests { maxKey := fmt.Sprintf("%s%d", strings.Repeat("c", 64-1), i) From d1e9a08f6b3f396b8f320dd52982d8cc6596f06f Mon Sep 17 00:00:00 2001 From: Prashant Yadav Date: Tue, 10 Mar 2026 10:49:10 -0700 Subject: [PATCH 09/15] vault test plugin startup wait --- system-tests/tests/smoke/cre/v2_vault_don_test.go | 2 +- system-tests/tests/smoke/cre/v2_vault_don_test_helpers.go | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/system-tests/tests/smoke/cre/v2_vault_don_test.go b/system-tests/tests/smoke/cre/v2_vault_don_test.go index 8985a4f073f..254e247eaf7 100644 --- a/system-tests/tests/smoke/cre/v2_vault_don_test.go +++ b/system-tests/tests/smoke/cre/v2_vault_don_test.go @@ -63,7 +63,7 @@ func ExecuteVaultTest(t *testing.T, testEnv *ttypes.TestEnvironment) { }, time.Second*300, time.Second*5) // Wait a bit to ensure the Vault plugin is ready. - time.Sleep(30 * time.Second) + time.Sleep(60 * time.Second) testLogger.Info().Msg("Getting gateway configuration...") require.NotEmpty(t, testEnv.Dons.GatewayConnectors.Configurations, "expected at least one gateway configuration") diff --git a/system-tests/tests/smoke/cre/v2_vault_don_test_helpers.go b/system-tests/tests/smoke/cre/v2_vault_don_test_helpers.go index 30f0b87bb38..5de07f36f7a 100644 --- a/system-tests/tests/smoke/cre/v2_vault_don_test_helpers.go +++ b/system-tests/tests/smoke/cre/v2_vault_don_test_helpers.go @@ -6,6 +6,7 @@ import ( "io" "net/http" "testing" + "time" "github.com/google/uuid" "github.com/stretchr/testify/require" @@ -30,6 +31,13 @@ func FetchVaultPublicKey(t *testing.T, gatewayURL string) (publicKey string) { requestBody, err := json.Marshal(getPublicKeyRequest) require.NoError(t, err, "failed to marshal public key request") + require.Eventually(t, func() bool { + statusCode, _ := sendVaultRequestToGateway(t, gatewayURL, requestBody) + if statusCode == http.StatusOK { + return true + } + return false + }, time.Second*30, time.Second*5) statusCode, httpResponseBody := sendVaultRequestToGateway(t, gatewayURL, requestBody) require.Equal(t, http.StatusOK, statusCode, "Gateway endpoint should respond with 200 OK") From 0fd5e0b9587044877d16e0ca9b7e76de6c8e8d5c Mon Sep 17 00:00:00 2001 From: Prashant Yadav Date: Tue, 10 Mar 2026 13:52:04 -0700 Subject: [PATCH 10/15] Bump chainlink-common --- 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 ++-- system-tests/tests/smoke/cre/v2_vault_don_test.go | 3 --- system-tests/tests/smoke/cre/v2_vault_don_test_helpers.go | 7 ++----- 16 files changed, 23 insertions(+), 29 deletions(-) diff --git a/core/scripts/go.mod b/core/scripts/go.mod index bbea8b799a5..ffba3123c13 100644 --- a/core/scripts/go.mod +++ b/core/scripts/go.mod @@ -46,7 +46,7 @@ require ( github.com/shopspring/decimal v1.4.0 github.com/smartcontractkit/chainlink-automation v0.8.1 github.com/smartcontractkit/chainlink-ccip v0.1.1-solana.0.20260303213437-47af98c8ae82 - github.com/smartcontractkit/chainlink-common v0.10.1-0.20260309192008-52eea801855c + github.com/smartcontractkit/chainlink-common v0.10.1-0.20260310204254-f3e84643d9cd github.com/smartcontractkit/chainlink-common/keystore v1.0.2 github.com/smartcontractkit/chainlink-data-streams v0.1.12-0.20260227110503-42b236799872 github.com/smartcontractkit/chainlink-deployments-framework v0.86.0 diff --git a/core/scripts/go.sum b/core/scripts/go.sum index 49ef68b007e..f770ed1973a 100644 --- a/core/scripts/go.sum +++ b/core/scripts/go.sum @@ -1620,8 +1620,8 @@ github.com/smartcontractkit/chainlink-ccip/deployment v0.0.0-20260303213437-47af github.com/smartcontractkit/chainlink-ccip/deployment v0.0.0-20260303213437-47af98c8ae82/go.mod h1:r6gOO/602z5FQyRxsBHd93/oNsAgboo2+DMhPoisPuU= github.com/smartcontractkit/chainlink-ccv v0.0.0-20260306124118-a6395a14f619 h1:mM4TnyNkRnNXZ+3WkjL+B1/CvepoQ+Aw+Y1AuRIzJQY= github.com/smartcontractkit/chainlink-ccv v0.0.0-20260306124118-a6395a14f619/go.mod h1:RnuNcn7DZmjmzEkeEWX0uL5y1oslB3c9URPLOjFU+jE= -github.com/smartcontractkit/chainlink-common v0.10.1-0.20260309192008-52eea801855c h1:atc8EEM0vmsYutiq4mU2Zcc0TpxoezTniPtsRs6YX14= -github.com/smartcontractkit/chainlink-common v0.10.1-0.20260309192008-52eea801855c/go.mod h1:0ghbAr7tRO0tT5ZqBXhOyzgUO37tNNe33Yn0hskauVM= +github.com/smartcontractkit/chainlink-common v0.10.1-0.20260310204254-f3e84643d9cd h1:9hEKLyqLGl8juNUKRkNQDGRplchkSobV12BX0tE8RVQ= +github.com/smartcontractkit/chainlink-common v0.10.1-0.20260310204254-f3e84643d9cd/go.mod h1:0ghbAr7tRO0tT5ZqBXhOyzgUO37tNNe33Yn0hskauVM= github.com/smartcontractkit/chainlink-common/keystore v1.0.2 h1:AWisx4JT3QV8tcgh6J5NCrex+wAgTYpWyHsyNPSXzsQ= github.com/smartcontractkit/chainlink-common/keystore v1.0.2/go.mod h1:rSkIHdomyak3YnUtXLenl6poIq8q0V3UZPiiyYqPdGA= github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.11-0.20251211140724-319861e514c4 h1:NOUsjsMzNecbjiPWUQGlRSRAutEvCFrqqyETDJeh5q4= diff --git a/deployment/go.mod b/deployment/go.mod index 2649ab52cf2..40ae16e5213 100644 --- a/deployment/go.mod +++ b/deployment/go.mod @@ -43,7 +43,7 @@ require ( github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20260121163256-85accaf3d28d github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings v0.0.0-20250912190424-fd2e35d7deb5 github.com/smartcontractkit/chainlink-ccip/deployment v0.0.0-20260303213437-47af98c8ae82 - github.com/smartcontractkit/chainlink-common v0.10.1-0.20260309192008-52eea801855c + github.com/smartcontractkit/chainlink-common v0.10.1-0.20260310204254-f3e84643d9cd github.com/smartcontractkit/chainlink-common/keystore v1.0.2 github.com/smartcontractkit/chainlink-deployments-framework v0.86.0 github.com/smartcontractkit/chainlink-evm v0.3.4-0.20260309171438-f10976da0b9b diff --git a/deployment/go.sum b/deployment/go.sum index acf61b42497..08734c90fb0 100644 --- a/deployment/go.sum +++ b/deployment/go.sum @@ -1383,8 +1383,8 @@ github.com/smartcontractkit/chainlink-ccip/deployment v0.0.0-20260303213437-47af github.com/smartcontractkit/chainlink-ccip/deployment v0.0.0-20260303213437-47af98c8ae82/go.mod h1:r6gOO/602z5FQyRxsBHd93/oNsAgboo2+DMhPoisPuU= github.com/smartcontractkit/chainlink-ccv v0.0.0-20260306124118-a6395a14f619 h1:mM4TnyNkRnNXZ+3WkjL+B1/CvepoQ+Aw+Y1AuRIzJQY= github.com/smartcontractkit/chainlink-ccv v0.0.0-20260306124118-a6395a14f619/go.mod h1:RnuNcn7DZmjmzEkeEWX0uL5y1oslB3c9URPLOjFU+jE= -github.com/smartcontractkit/chainlink-common v0.10.1-0.20260309192008-52eea801855c h1:atc8EEM0vmsYutiq4mU2Zcc0TpxoezTniPtsRs6YX14= -github.com/smartcontractkit/chainlink-common v0.10.1-0.20260309192008-52eea801855c/go.mod h1:0ghbAr7tRO0tT5ZqBXhOyzgUO37tNNe33Yn0hskauVM= +github.com/smartcontractkit/chainlink-common v0.10.1-0.20260310204254-f3e84643d9cd h1:9hEKLyqLGl8juNUKRkNQDGRplchkSobV12BX0tE8RVQ= +github.com/smartcontractkit/chainlink-common v0.10.1-0.20260310204254-f3e84643d9cd/go.mod h1:0ghbAr7tRO0tT5ZqBXhOyzgUO37tNNe33Yn0hskauVM= github.com/smartcontractkit/chainlink-common/keystore v1.0.2 h1:AWisx4JT3QV8tcgh6J5NCrex+wAgTYpWyHsyNPSXzsQ= github.com/smartcontractkit/chainlink-common/keystore v1.0.2/go.mod h1:rSkIHdomyak3YnUtXLenl6poIq8q0V3UZPiiyYqPdGA= github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.10 h1:FJAFgXS9oqASnkS03RE1HQwYQQxrO4l46O5JSzxqLgg= diff --git a/go.mod b/go.mod index 32e403d72dc..ce8b2bb9f8d 100644 --- a/go.mod +++ b/go.mod @@ -85,7 +85,7 @@ require ( github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20260121163256-85accaf3d28d github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings v0.0.0-20250912190424-fd2e35d7deb5 github.com/smartcontractkit/chainlink-ccv v0.0.0-20260306124118-a6395a14f619 - github.com/smartcontractkit/chainlink-common v0.10.1-0.20260309192008-52eea801855c + github.com/smartcontractkit/chainlink-common v0.10.1-0.20260310204254-f3e84643d9cd github.com/smartcontractkit/chainlink-common/keystore v1.0.2 github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.10 github.com/smartcontractkit/chainlink-data-streams v0.1.12-0.20260227110503-42b236799872 diff --git a/go.sum b/go.sum index 26914d3d088..42ecb1bc856 100644 --- a/go.sum +++ b/go.sum @@ -1183,8 +1183,8 @@ github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings v0.0.0-20250 github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings v0.0.0-20250912190424-fd2e35d7deb5/go.mod h1:xtZNi6pOKdC3sLvokDvXOhgHzT+cyBqH/gWwvxTxqrg= github.com/smartcontractkit/chainlink-ccv v0.0.0-20260306124118-a6395a14f619 h1:mM4TnyNkRnNXZ+3WkjL+B1/CvepoQ+Aw+Y1AuRIzJQY= github.com/smartcontractkit/chainlink-ccv v0.0.0-20260306124118-a6395a14f619/go.mod h1:RnuNcn7DZmjmzEkeEWX0uL5y1oslB3c9URPLOjFU+jE= -github.com/smartcontractkit/chainlink-common v0.10.1-0.20260309192008-52eea801855c h1:atc8EEM0vmsYutiq4mU2Zcc0TpxoezTniPtsRs6YX14= -github.com/smartcontractkit/chainlink-common v0.10.1-0.20260309192008-52eea801855c/go.mod h1:0ghbAr7tRO0tT5ZqBXhOyzgUO37tNNe33Yn0hskauVM= +github.com/smartcontractkit/chainlink-common v0.10.1-0.20260310204254-f3e84643d9cd h1:9hEKLyqLGl8juNUKRkNQDGRplchkSobV12BX0tE8RVQ= +github.com/smartcontractkit/chainlink-common v0.10.1-0.20260310204254-f3e84643d9cd/go.mod h1:0ghbAr7tRO0tT5ZqBXhOyzgUO37tNNe33Yn0hskauVM= github.com/smartcontractkit/chainlink-common/keystore v1.0.2 h1:AWisx4JT3QV8tcgh6J5NCrex+wAgTYpWyHsyNPSXzsQ= github.com/smartcontractkit/chainlink-common/keystore v1.0.2/go.mod h1:rSkIHdomyak3YnUtXLenl6poIq8q0V3UZPiiyYqPdGA= github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.10 h1:FJAFgXS9oqASnkS03RE1HQwYQQxrO4l46O5JSzxqLgg= diff --git a/integration-tests/go.mod b/integration-tests/go.mod index d9bec7aee38..d3e3b3b8b28 100644 --- a/integration-tests/go.mod +++ b/integration-tests/go.mod @@ -50,7 +50,7 @@ require ( github.com/smartcontractkit/chainlink-ccip v0.1.1-solana.0.20260303213437-47af98c8ae82 github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20260121163256-85accaf3d28d github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings v0.0.0-20250912190424-fd2e35d7deb5 - github.com/smartcontractkit/chainlink-common v0.10.1-0.20260309192008-52eea801855c + github.com/smartcontractkit/chainlink-common v0.10.1-0.20260310204254-f3e84643d9cd github.com/smartcontractkit/chainlink-common/keystore v1.0.2 github.com/smartcontractkit/chainlink-deployments-framework v0.86.0 github.com/smartcontractkit/chainlink-evm v0.3.4-0.20260309171438-f10976da0b9b diff --git a/integration-tests/go.sum b/integration-tests/go.sum index 365ea320e3f..9ade30e2a75 100644 --- a/integration-tests/go.sum +++ b/integration-tests/go.sum @@ -1624,8 +1624,8 @@ github.com/smartcontractkit/chainlink-ccip/deployment v0.0.0-20260303213437-47af github.com/smartcontractkit/chainlink-ccip/deployment v0.0.0-20260303213437-47af98c8ae82/go.mod h1:r6gOO/602z5FQyRxsBHd93/oNsAgboo2+DMhPoisPuU= github.com/smartcontractkit/chainlink-ccv v0.0.0-20260306124118-a6395a14f619 h1:mM4TnyNkRnNXZ+3WkjL+B1/CvepoQ+Aw+Y1AuRIzJQY= github.com/smartcontractkit/chainlink-ccv v0.0.0-20260306124118-a6395a14f619/go.mod h1:RnuNcn7DZmjmzEkeEWX0uL5y1oslB3c9URPLOjFU+jE= -github.com/smartcontractkit/chainlink-common v0.10.1-0.20260309192008-52eea801855c h1:atc8EEM0vmsYutiq4mU2Zcc0TpxoezTniPtsRs6YX14= -github.com/smartcontractkit/chainlink-common v0.10.1-0.20260309192008-52eea801855c/go.mod h1:0ghbAr7tRO0tT5ZqBXhOyzgUO37tNNe33Yn0hskauVM= +github.com/smartcontractkit/chainlink-common v0.10.1-0.20260310204254-f3e84643d9cd h1:9hEKLyqLGl8juNUKRkNQDGRplchkSobV12BX0tE8RVQ= +github.com/smartcontractkit/chainlink-common v0.10.1-0.20260310204254-f3e84643d9cd/go.mod h1:0ghbAr7tRO0tT5ZqBXhOyzgUO37tNNe33Yn0hskauVM= github.com/smartcontractkit/chainlink-common/keystore v1.0.2 h1:AWisx4JT3QV8tcgh6J5NCrex+wAgTYpWyHsyNPSXzsQ= github.com/smartcontractkit/chainlink-common/keystore v1.0.2/go.mod h1:rSkIHdomyak3YnUtXLenl6poIq8q0V3UZPiiyYqPdGA= github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.10 h1:FJAFgXS9oqASnkS03RE1HQwYQQxrO4l46O5JSzxqLgg= diff --git a/integration-tests/load/go.mod b/integration-tests/load/go.mod index d3ecc77a01b..bf383b3d1b0 100644 --- a/integration-tests/load/go.mod +++ b/integration-tests/load/go.mod @@ -32,7 +32,7 @@ require ( github.com/smartcontractkit/chainlink-ccip v0.1.1-solana.0.20260303213437-47af98c8ae82 github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20260121163256-85accaf3d28d github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings v0.0.0-20250912190424-fd2e35d7deb5 - github.com/smartcontractkit/chainlink-common v0.10.1-0.20260309192008-52eea801855c + github.com/smartcontractkit/chainlink-common v0.10.1-0.20260310204254-f3e84643d9cd github.com/smartcontractkit/chainlink-deployments-framework v0.86.0 github.com/smartcontractkit/chainlink-evm v0.3.4-0.20260309171438-f10976da0b9b github.com/smartcontractkit/chainlink-evm/gethwrappers v0.0.0-20251222115927-36a18321243c diff --git a/integration-tests/load/go.sum b/integration-tests/load/go.sum index 10e30b1915d..1a2d1bab467 100644 --- a/integration-tests/load/go.sum +++ b/integration-tests/load/go.sum @@ -1602,8 +1602,8 @@ github.com/smartcontractkit/chainlink-ccip/deployment v0.0.0-20260303213437-47af github.com/smartcontractkit/chainlink-ccip/deployment v0.0.0-20260303213437-47af98c8ae82/go.mod h1:r6gOO/602z5FQyRxsBHd93/oNsAgboo2+DMhPoisPuU= github.com/smartcontractkit/chainlink-ccv v0.0.0-20260306124118-a6395a14f619 h1:mM4TnyNkRnNXZ+3WkjL+B1/CvepoQ+Aw+Y1AuRIzJQY= github.com/smartcontractkit/chainlink-ccv v0.0.0-20260306124118-a6395a14f619/go.mod h1:RnuNcn7DZmjmzEkeEWX0uL5y1oslB3c9URPLOjFU+jE= -github.com/smartcontractkit/chainlink-common v0.10.1-0.20260309192008-52eea801855c h1:atc8EEM0vmsYutiq4mU2Zcc0TpxoezTniPtsRs6YX14= -github.com/smartcontractkit/chainlink-common v0.10.1-0.20260309192008-52eea801855c/go.mod h1:0ghbAr7tRO0tT5ZqBXhOyzgUO37tNNe33Yn0hskauVM= +github.com/smartcontractkit/chainlink-common v0.10.1-0.20260310204254-f3e84643d9cd h1:9hEKLyqLGl8juNUKRkNQDGRplchkSobV12BX0tE8RVQ= +github.com/smartcontractkit/chainlink-common v0.10.1-0.20260310204254-f3e84643d9cd/go.mod h1:0ghbAr7tRO0tT5ZqBXhOyzgUO37tNNe33Yn0hskauVM= github.com/smartcontractkit/chainlink-common/keystore v1.0.2 h1:AWisx4JT3QV8tcgh6J5NCrex+wAgTYpWyHsyNPSXzsQ= github.com/smartcontractkit/chainlink-common/keystore v1.0.2/go.mod h1:rSkIHdomyak3YnUtXLenl6poIq8q0V3UZPiiyYqPdGA= github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.10 h1:FJAFgXS9oqASnkS03RE1HQwYQQxrO4l46O5JSzxqLgg= diff --git a/system-tests/lib/go.mod b/system-tests/lib/go.mod index 60e97b7225b..cce61e24cc6 100644 --- a/system-tests/lib/go.mod +++ b/system-tests/lib/go.mod @@ -32,7 +32,7 @@ require ( github.com/sethvargo/go-retry v0.3.0 github.com/smartcontractkit/chain-selectors v1.0.97 github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20260121163256-85accaf3d28d - github.com/smartcontractkit/chainlink-common v0.10.1-0.20260309192008-52eea801855c + github.com/smartcontractkit/chainlink-common v0.10.1-0.20260310204254-f3e84643d9cd github.com/smartcontractkit/chainlink-common/keystore v1.0.2 github.com/smartcontractkit/chainlink-deployments-framework v0.86.0 github.com/smartcontractkit/chainlink-evm v0.3.4-0.20260309171438-f10976da0b9b diff --git a/system-tests/lib/go.sum b/system-tests/lib/go.sum index 85097ac1fab..196cdf962e0 100644 --- a/system-tests/lib/go.sum +++ b/system-tests/lib/go.sum @@ -1583,8 +1583,8 @@ github.com/smartcontractkit/chainlink-ccip/deployment v0.0.0-20260303213437-47af github.com/smartcontractkit/chainlink-ccip/deployment v0.0.0-20260303213437-47af98c8ae82/go.mod h1:r6gOO/602z5FQyRxsBHd93/oNsAgboo2+DMhPoisPuU= github.com/smartcontractkit/chainlink-ccv v0.0.0-20260306124118-a6395a14f619 h1:mM4TnyNkRnNXZ+3WkjL+B1/CvepoQ+Aw+Y1AuRIzJQY= github.com/smartcontractkit/chainlink-ccv v0.0.0-20260306124118-a6395a14f619/go.mod h1:RnuNcn7DZmjmzEkeEWX0uL5y1oslB3c9URPLOjFU+jE= -github.com/smartcontractkit/chainlink-common v0.10.1-0.20260309192008-52eea801855c h1:atc8EEM0vmsYutiq4mU2Zcc0TpxoezTniPtsRs6YX14= -github.com/smartcontractkit/chainlink-common v0.10.1-0.20260309192008-52eea801855c/go.mod h1:0ghbAr7tRO0tT5ZqBXhOyzgUO37tNNe33Yn0hskauVM= +github.com/smartcontractkit/chainlink-common v0.10.1-0.20260310204254-f3e84643d9cd h1:9hEKLyqLGl8juNUKRkNQDGRplchkSobV12BX0tE8RVQ= +github.com/smartcontractkit/chainlink-common v0.10.1-0.20260310204254-f3e84643d9cd/go.mod h1:0ghbAr7tRO0tT5ZqBXhOyzgUO37tNNe33Yn0hskauVM= github.com/smartcontractkit/chainlink-common/keystore v1.0.2 h1:AWisx4JT3QV8tcgh6J5NCrex+wAgTYpWyHsyNPSXzsQ= github.com/smartcontractkit/chainlink-common/keystore v1.0.2/go.mod h1:rSkIHdomyak3YnUtXLenl6poIq8q0V3UZPiiyYqPdGA= github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.10 h1:FJAFgXS9oqASnkS03RE1HQwYQQxrO4l46O5JSzxqLgg= diff --git a/system-tests/tests/go.mod b/system-tests/tests/go.mod index 80beaa20466..a5be76b1e19 100644 --- a/system-tests/tests/go.mod +++ b/system-tests/tests/go.mod @@ -54,7 +54,7 @@ require ( github.com/rs/zerolog v1.34.0 github.com/shopspring/decimal v1.4.0 github.com/smartcontractkit/chain-selectors v1.0.97 - github.com/smartcontractkit/chainlink-common v0.10.1-0.20260309192008-52eea801855c + github.com/smartcontractkit/chainlink-common v0.10.1-0.20260310204254-f3e84643d9cd github.com/smartcontractkit/chainlink-common/keystore v1.0.2 github.com/smartcontractkit/chainlink-data-streams v0.1.12-0.20260227110503-42b236799872 github.com/smartcontractkit/chainlink-deployments-framework v0.86.0 diff --git a/system-tests/tests/go.sum b/system-tests/tests/go.sum index 6ea13b13437..393d88fb8a7 100644 --- a/system-tests/tests/go.sum +++ b/system-tests/tests/go.sum @@ -1790,8 +1790,8 @@ github.com/smartcontractkit/chainlink-ccip/deployment v0.0.0-20260303213437-47af github.com/smartcontractkit/chainlink-ccip/deployment v0.0.0-20260303213437-47af98c8ae82/go.mod h1:r6gOO/602z5FQyRxsBHd93/oNsAgboo2+DMhPoisPuU= github.com/smartcontractkit/chainlink-ccv v0.0.0-20260306124118-a6395a14f619 h1:mM4TnyNkRnNXZ+3WkjL+B1/CvepoQ+Aw+Y1AuRIzJQY= github.com/smartcontractkit/chainlink-ccv v0.0.0-20260306124118-a6395a14f619/go.mod h1:RnuNcn7DZmjmzEkeEWX0uL5y1oslB3c9URPLOjFU+jE= -github.com/smartcontractkit/chainlink-common v0.10.1-0.20260309192008-52eea801855c h1:atc8EEM0vmsYutiq4mU2Zcc0TpxoezTniPtsRs6YX14= -github.com/smartcontractkit/chainlink-common v0.10.1-0.20260309192008-52eea801855c/go.mod h1:0ghbAr7tRO0tT5ZqBXhOyzgUO37tNNe33Yn0hskauVM= +github.com/smartcontractkit/chainlink-common v0.10.1-0.20260310204254-f3e84643d9cd h1:9hEKLyqLGl8juNUKRkNQDGRplchkSobV12BX0tE8RVQ= +github.com/smartcontractkit/chainlink-common v0.10.1-0.20260310204254-f3e84643d9cd/go.mod h1:0ghbAr7tRO0tT5ZqBXhOyzgUO37tNNe33Yn0hskauVM= github.com/smartcontractkit/chainlink-common/keystore v1.0.2 h1:AWisx4JT3QV8tcgh6J5NCrex+wAgTYpWyHsyNPSXzsQ= github.com/smartcontractkit/chainlink-common/keystore v1.0.2/go.mod h1:rSkIHdomyak3YnUtXLenl6poIq8q0V3UZPiiyYqPdGA= github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.11-0.20251211140724-319861e514c4 h1:NOUsjsMzNecbjiPWUQGlRSRAutEvCFrqqyETDJeh5q4= diff --git a/system-tests/tests/smoke/cre/v2_vault_don_test.go b/system-tests/tests/smoke/cre/v2_vault_don_test.go index 254e247eaf7..1b6ce9e1b82 100644 --- a/system-tests/tests/smoke/cre/v2_vault_don_test.go +++ b/system-tests/tests/smoke/cre/v2_vault_don_test.go @@ -62,9 +62,6 @@ func ExecuteVaultTest(t *testing.T, testEnv *ttypes.TestEnvironment) { return false }, time.Second*300, time.Second*5) - // Wait a bit to ensure the Vault plugin is ready. - time.Sleep(60 * time.Second) - testLogger.Info().Msg("Getting gateway configuration...") require.NotEmpty(t, testEnv.Dons.GatewayConnectors.Configurations, "expected at least one gateway configuration") gatewayURL, err := url.Parse(testEnv.Dons.GatewayConnectors.Configurations[0].Incoming.Protocol + "://" + testEnv.Dons.GatewayConnectors.Configurations[0].Incoming.Host + ":" + strconv.Itoa(testEnv.Dons.GatewayConnectors.Configurations[0].Incoming.ExternalPort) + testEnv.Dons.GatewayConnectors.Configurations[0].Incoming.Path) diff --git a/system-tests/tests/smoke/cre/v2_vault_don_test_helpers.go b/system-tests/tests/smoke/cre/v2_vault_don_test_helpers.go index 5de07f36f7a..a9a493e2e8a 100644 --- a/system-tests/tests/smoke/cre/v2_vault_don_test_helpers.go +++ b/system-tests/tests/smoke/cre/v2_vault_don_test_helpers.go @@ -33,11 +33,8 @@ func FetchVaultPublicKey(t *testing.T, gatewayURL string) (publicKey string) { require.Eventually(t, func() bool { statusCode, _ := sendVaultRequestToGateway(t, gatewayURL, requestBody) - if statusCode == http.StatusOK { - return true - } - return false - }, time.Second*30, time.Second*5) + return statusCode == http.StatusOK + }, time.Second*120, time.Second*5) statusCode, httpResponseBody := sendVaultRequestToGateway(t, gatewayURL, requestBody) require.Equal(t, http.StatusOK, statusCode, "Gateway endpoint should respond with 200 OK") From 70212cf44e6be8bfd3c0fdfdaa58504141e6897a Mon Sep 17 00:00:00 2001 From: Prashant Yadav Date: Tue, 10 Mar 2026 15:22:54 -0700 Subject: [PATCH 11/15] fix closing of limits --- core/services/ocr2/plugins/vault/plugin.go | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/core/services/ocr2/plugins/vault/plugin.go b/core/services/ocr2/plugins/vault/plugin.go index 910519a6b80..ef3a3ab8d48 100644 --- a/core/services/ocr2/plugins/vault/plugin.go +++ b/core/services/ocr2/plugins/vault/plugin.go @@ -137,13 +137,17 @@ func (r *ReportingPluginFactory) getKeyMaterial(ctx context.Context, instanceID return publicKey, privateKeyShare, nil } -func resolvePluginLimits(ctx context.Context, factory limits.Factory) (ocr3_1types.ReportingPluginLimits, error) { +func initializePluginLimits(ctx context.Context, factory limits.Factory) (ocr3_1types.ReportingPluginLimits, error) { resolveSize := func(s settings.Setting[pkgconfig.Size]) (int, error) { limiter, err := limits.MakeUpperBoundLimiter(factory, s) if err != nil { return 0, err } v, err := limiter.Limit(ctx) + if err != nil { + return int(v), err + } + err = limiter.Close() return int(v), err } resolveInt := func(s settings.Setting[int]) (int, error) { @@ -151,7 +155,12 @@ func resolvePluginLimits(ctx context.Context, factory limits.Factory) (ocr3_1typ if err != nil { return 0, err } - return limiter.Limit(ctx) + v, err := limiter.Limit(ctx) + if err != nil { + return int(v), err + } + err = limiter.Close() + return int(v), err } maxQueryBytes, err := resolveSize(cresettings.Default.VaultMaxQuerySizeLimit) @@ -320,7 +329,7 @@ func (r *ReportingPluginFactory) NewReportingPlugin(ctx context.Context, config return nil, ocr3_1types.ReportingPluginInfo1{}, fmt.Errorf("could not create plugin metrics: %w", err) } - pluginLimits, err := resolvePluginLimits(ctx, r.limitsFactory) + pluginLimits, err := initializePluginLimits(ctx, r.limitsFactory) if err != nil { return nil, ocr3_1types.ReportingPluginInfo1{}, fmt.Errorf("could not resolve plugin limits: %w", err) } From f27bee3ace4b6a457cb93233394583bcff1759c6 Mon Sep 17 00:00:00 2001 From: Prashant Yadav Date: Tue, 10 Mar 2026 15:40:12 -0700 Subject: [PATCH 12/15] lint --- core/services/ocr2/plugins/vault/plugin.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/services/ocr2/plugins/vault/plugin.go b/core/services/ocr2/plugins/vault/plugin.go index ef3a3ab8d48..7820b496d4c 100644 --- a/core/services/ocr2/plugins/vault/plugin.go +++ b/core/services/ocr2/plugins/vault/plugin.go @@ -157,10 +157,10 @@ func initializePluginLimits(ctx context.Context, factory limits.Factory) (ocr3_1 } v, err := limiter.Limit(ctx) if err != nil { - return int(v), err + return v, err } err = limiter.Close() - return int(v), err + return v, err } maxQueryBytes, err := resolveSize(cresettings.Default.VaultMaxQuerySizeLimit) From e6ce2990fcdeed05b49c7f7d8115eca3ba7071b1 Mon Sep 17 00:00:00 2001 From: Prashant Yadav Date: Tue, 10 Mar 2026 15:52:32 -0700 Subject: [PATCH 13/15] close limiters --- core/services/ocr2/plugins/vault/plugin.go | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/core/services/ocr2/plugins/vault/plugin.go b/core/services/ocr2/plugins/vault/plugin.go index 7820b496d4c..8a3ee866eb5 100644 --- a/core/services/ocr2/plugins/vault/plugin.go +++ b/core/services/ocr2/plugins/vault/plugin.go @@ -2236,5 +2236,14 @@ func (r *ReportingPlugin) ShouldTransmitAcceptedReport(ctx context.Context, seqN } func (r *ReportingPlugin) Close() error { - return nil + return errors.Join( + r.cfg.MaxSecretsPerOwner.Close(), + r.cfg.MaxCiphertextLengthBytes.Close(), + r.cfg.MaxIdentifierKeyLengthBytes.Close(), + r.cfg.MaxIdentifierOwnerLengthBytes.Close(), + r.cfg.MaxIdentifierNamespaceLengthBytes.Close(), + r.cfg.MaxShareLengthBytes.Close(), + r.cfg.MaxRequestBatchSize.Close(), + r.cfg.MaxBatchSize.Close(), + ) } From 29f70889a6c011d7da848ad09a967c3db7da7c71 Mon Sep 17 00:00:00 2001 From: Prashant Yadav Date: Tue, 10 Mar 2026 16:17:52 -0700 Subject: [PATCH 14/15] limiters simplify --- core/services/ocr2/plugins/vault/plugin.go | 64 +++++++--------------- 1 file changed, 19 insertions(+), 45 deletions(-) diff --git a/core/services/ocr2/plugins/vault/plugin.go b/core/services/ocr2/plugins/vault/plugin.go index 8a3ee866eb5..b35089ce58a 100644 --- a/core/services/ocr2/plugins/vault/plugin.go +++ b/core/services/ocr2/plugins/vault/plugin.go @@ -33,7 +33,6 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/capabilities/consensus/requests" pkgconfig "github.com/smartcontractkit/chainlink-common/pkg/config" "github.com/smartcontractkit/chainlink-common/pkg/contexts" - "github.com/smartcontractkit/chainlink-common/pkg/settings" "github.com/smartcontractkit/chainlink-common/pkg/settings/cresettings" "github.com/smartcontractkit/chainlink-common/pkg/settings/limits" vaultcap "github.com/smartcontractkit/chainlink/v2/core/capabilities/vault" @@ -137,83 +136,58 @@ func (r *ReportingPluginFactory) getKeyMaterial(ctx context.Context, instanceID return publicKey, privateKeyShare, nil } -func initializePluginLimits(ctx context.Context, factory limits.Factory) (ocr3_1types.ReportingPluginLimits, error) { - resolveSize := func(s settings.Setting[pkgconfig.Size]) (int, error) { - limiter, err := limits.MakeUpperBoundLimiter(factory, s) - if err != nil { - return 0, err - } - v, err := limiter.Limit(ctx) - if err != nil { - return int(v), err - } - err = limiter.Close() - return int(v), err - } - resolveInt := func(s settings.Setting[int]) (int, error) { - limiter, err := limits.MakeUpperBoundLimiter(factory, s) - if err != nil { - return 0, err - } - v, err := limiter.Limit(ctx) - if err != nil { - return v, err - } - err = limiter.Close() - return v, err - } - - maxQueryBytes, err := resolveSize(cresettings.Default.VaultMaxQuerySizeLimit) +func initializePluginLimits(ctx context.Context) (ocr3_1types.ReportingPluginLimits, error) { + maxQueryBytes, err := cresettings.Default.VaultMaxQuerySizeLimit.GetOrDefault(ctx, cresettings.DefaultGetter) if err != nil { return ocr3_1types.ReportingPluginLimits{}, fmt.Errorf("VaultMaxQuerySizeLimit: %w", err) } - maxObservationBytes, err := resolveSize(cresettings.Default.VaultMaxObservationSizeLimit) + maxObservationBytes, err := cresettings.Default.VaultMaxObservationSizeLimit.GetOrDefault(ctx, cresettings.DefaultGetter) if err != nil { return ocr3_1types.ReportingPluginLimits{}, fmt.Errorf("VaultMaxObservationSizeLimit: %w", err) } - maxReportsPlusPrecursorBytes, err := resolveSize(cresettings.Default.VaultMaxReportsPlusPrecursorSizeLimit) + maxReportsPlusPrecursorBytes, err := cresettings.Default.VaultMaxReportsPlusPrecursorSizeLimit.GetOrDefault(ctx, cresettings.DefaultGetter) if err != nil { return ocr3_1types.ReportingPluginLimits{}, fmt.Errorf("VaultMaxReportsPlusPrecursorSizeLimit: %w", err) } - maxReportBytes, err := resolveSize(cresettings.Default.VaultMaxReportSizeLimit) + maxReportBytes, err := cresettings.Default.VaultMaxReportSizeLimit.GetOrDefault(ctx, cresettings.DefaultGetter) if err != nil { return ocr3_1types.ReportingPluginLimits{}, fmt.Errorf("VaultMaxReportSizeLimit: %w", err) } - maxReportCount, err := resolveInt(cresettings.Default.VaultMaxReportCount) + maxReportCount, err := cresettings.Default.VaultMaxReportCount.GetOrDefault(ctx, cresettings.DefaultGetter) if err != nil { return ocr3_1types.ReportingPluginLimits{}, fmt.Errorf("VaultMaxReportCount: %w", err) } - maxKVModifiedKeysPlusValuesBytes, err := resolveSize(cresettings.Default.VaultMaxKeyValueModifiedKeysPlusValuesSizeLimit) + maxKVModifiedKeysPlusValuesBytes, err := cresettings.Default.VaultMaxKeyValueModifiedKeysPlusValuesSizeLimit.GetOrDefault(ctx, cresettings.DefaultGetter) if err != nil { return ocr3_1types.ReportingPluginLimits{}, fmt.Errorf("VaultMaxKeyValueModifiedKeysPlusValuesSizeLimit: %w", err) } - maxKVModifiedKeys, err := resolveInt(cresettings.Default.VaultMaxKeyValueModifiedKeys) + maxKVModifiedKeys, err := cresettings.Default.VaultMaxKeyValueModifiedKeys.GetOrDefault(ctx, cresettings.DefaultGetter) if err != nil { return ocr3_1types.ReportingPluginLimits{}, fmt.Errorf("VaultMaxKeyValueModifiedKeys: %w", err) } - maxBlobPayloadBytes, err := resolveSize(cresettings.Default.VaultMaxBlobPayloadSizeLimit) + maxBlobPayloadBytes, err := cresettings.Default.VaultMaxBlobPayloadSizeLimit.GetOrDefault(ctx, cresettings.DefaultGetter) if err != nil { return ocr3_1types.ReportingPluginLimits{}, fmt.Errorf("VaultMaxBlobPayloadSizeLimit: %w", err) } - maxPerOracleUnexpiredBlobCumulativePayloadBytes, err := resolveSize(cresettings.Default.VaultMaxPerOracleUnexpiredBlobCumulativePayloadSizeLimit) + maxPerOracleUnexpiredBlobCumulativePayloadBytes, err := cresettings.Default.VaultMaxPerOracleUnexpiredBlobCumulativePayloadSizeLimit.GetOrDefault(ctx, cresettings.DefaultGetter) if err != nil { return ocr3_1types.ReportingPluginLimits{}, fmt.Errorf("VaultMaxPerOracleUnexpiredBlobCumulativePayloadSizeLimit: %w", err) } - maxPerOracleUnexpiredBlobCount, err := resolveInt(cresettings.Default.VaultMaxPerOracleUnexpiredBlobCount) + maxPerOracleUnexpiredBlobCount, err := cresettings.Default.VaultMaxPerOracleUnexpiredBlobCount.GetOrDefault(ctx, cresettings.DefaultGetter) if err != nil { return ocr3_1types.ReportingPluginLimits{}, fmt.Errorf("VaultMaxPerOracleUnexpiredBlobCount: %w", err) } return ocr3_1types.ReportingPluginLimits{ - MaxQueryBytes: maxQueryBytes, - MaxObservationBytes: maxObservationBytes, - MaxReportsPlusPrecursorBytes: maxReportsPlusPrecursorBytes, - MaxReportBytes: maxReportBytes, + MaxQueryBytes: int(maxQueryBytes), + MaxObservationBytes: int(maxObservationBytes), + MaxReportsPlusPrecursorBytes: int(maxReportsPlusPrecursorBytes), + MaxReportBytes: int(maxReportBytes), MaxReportCount: maxReportCount, - MaxKeyValueModifiedKeysPlusValuesBytes: maxKVModifiedKeysPlusValuesBytes, + MaxKeyValueModifiedKeysPlusValuesBytes: int(maxKVModifiedKeysPlusValuesBytes), MaxKeyValueModifiedKeys: maxKVModifiedKeys, - MaxBlobPayloadBytes: maxBlobPayloadBytes, - MaxPerOracleUnexpiredBlobCumulativePayloadBytes: maxPerOracleUnexpiredBlobCumulativePayloadBytes, + MaxBlobPayloadBytes: int(maxBlobPayloadBytes), + MaxPerOracleUnexpiredBlobCumulativePayloadBytes: int(maxPerOracleUnexpiredBlobCumulativePayloadBytes), MaxPerOracleUnexpiredBlobCount: maxPerOracleUnexpiredBlobCount, }, nil } @@ -329,7 +303,7 @@ func (r *ReportingPluginFactory) NewReportingPlugin(ctx context.Context, config return nil, ocr3_1types.ReportingPluginInfo1{}, fmt.Errorf("could not create plugin metrics: %w", err) } - pluginLimits, err := initializePluginLimits(ctx, r.limitsFactory) + pluginLimits, err := initializePluginLimits(ctx) if err != nil { return nil, ocr3_1types.ReportingPluginInfo1{}, fmt.Errorf("could not resolve plugin limits: %w", err) } From d51ced98d1da3c2f14f2b4f624b3e6f7f8ff45d8 Mon Sep 17 00:00:00 2001 From: Prashant Yadav Date: Tue, 10 Mar 2026 19:30:21 -0700 Subject: [PATCH 15/15] limiters simplify --- core/services/ocr2/plugins/vault/plugin.go | 24 +++++++++++----------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/core/services/ocr2/plugins/vault/plugin.go b/core/services/ocr2/plugins/vault/plugin.go index b35089ce58a..0bff2ef57ea 100644 --- a/core/services/ocr2/plugins/vault/plugin.go +++ b/core/services/ocr2/plugins/vault/plugin.go @@ -136,44 +136,44 @@ func (r *ReportingPluginFactory) getKeyMaterial(ctx context.Context, instanceID return publicKey, privateKeyShare, nil } -func initializePluginLimits(ctx context.Context) (ocr3_1types.ReportingPluginLimits, error) { - maxQueryBytes, err := cresettings.Default.VaultMaxQuerySizeLimit.GetOrDefault(ctx, cresettings.DefaultGetter) +func initializePluginLimits(ctx context.Context, limitsFactory limits.Factory) (ocr3_1types.ReportingPluginLimits, error) { + maxQueryBytes, err := cresettings.Default.VaultMaxQuerySizeLimit.GetOrDefault(ctx, limitsFactory.Settings) if err != nil { return ocr3_1types.ReportingPluginLimits{}, fmt.Errorf("VaultMaxQuerySizeLimit: %w", err) } - maxObservationBytes, err := cresettings.Default.VaultMaxObservationSizeLimit.GetOrDefault(ctx, cresettings.DefaultGetter) + maxObservationBytes, err := cresettings.Default.VaultMaxObservationSizeLimit.GetOrDefault(ctx, limitsFactory.Settings) if err != nil { return ocr3_1types.ReportingPluginLimits{}, fmt.Errorf("VaultMaxObservationSizeLimit: %w", err) } - maxReportsPlusPrecursorBytes, err := cresettings.Default.VaultMaxReportsPlusPrecursorSizeLimit.GetOrDefault(ctx, cresettings.DefaultGetter) + maxReportsPlusPrecursorBytes, err := cresettings.Default.VaultMaxReportsPlusPrecursorSizeLimit.GetOrDefault(ctx, limitsFactory.Settings) if err != nil { return ocr3_1types.ReportingPluginLimits{}, fmt.Errorf("VaultMaxReportsPlusPrecursorSizeLimit: %w", err) } - maxReportBytes, err := cresettings.Default.VaultMaxReportSizeLimit.GetOrDefault(ctx, cresettings.DefaultGetter) + maxReportBytes, err := cresettings.Default.VaultMaxReportSizeLimit.GetOrDefault(ctx, limitsFactory.Settings) if err != nil { return ocr3_1types.ReportingPluginLimits{}, fmt.Errorf("VaultMaxReportSizeLimit: %w", err) } - maxReportCount, err := cresettings.Default.VaultMaxReportCount.GetOrDefault(ctx, cresettings.DefaultGetter) + maxReportCount, err := cresettings.Default.VaultMaxReportCount.GetOrDefault(ctx, limitsFactory.Settings) if err != nil { return ocr3_1types.ReportingPluginLimits{}, fmt.Errorf("VaultMaxReportCount: %w", err) } - maxKVModifiedKeysPlusValuesBytes, err := cresettings.Default.VaultMaxKeyValueModifiedKeysPlusValuesSizeLimit.GetOrDefault(ctx, cresettings.DefaultGetter) + maxKVModifiedKeysPlusValuesBytes, err := cresettings.Default.VaultMaxKeyValueModifiedKeysPlusValuesSizeLimit.GetOrDefault(ctx, limitsFactory.Settings) if err != nil { return ocr3_1types.ReportingPluginLimits{}, fmt.Errorf("VaultMaxKeyValueModifiedKeysPlusValuesSizeLimit: %w", err) } - maxKVModifiedKeys, err := cresettings.Default.VaultMaxKeyValueModifiedKeys.GetOrDefault(ctx, cresettings.DefaultGetter) + maxKVModifiedKeys, err := cresettings.Default.VaultMaxKeyValueModifiedKeys.GetOrDefault(ctx, limitsFactory.Settings) if err != nil { return ocr3_1types.ReportingPluginLimits{}, fmt.Errorf("VaultMaxKeyValueModifiedKeys: %w", err) } - maxBlobPayloadBytes, err := cresettings.Default.VaultMaxBlobPayloadSizeLimit.GetOrDefault(ctx, cresettings.DefaultGetter) + maxBlobPayloadBytes, err := cresettings.Default.VaultMaxBlobPayloadSizeLimit.GetOrDefault(ctx, limitsFactory.Settings) if err != nil { return ocr3_1types.ReportingPluginLimits{}, fmt.Errorf("VaultMaxBlobPayloadSizeLimit: %w", err) } - maxPerOracleUnexpiredBlobCumulativePayloadBytes, err := cresettings.Default.VaultMaxPerOracleUnexpiredBlobCumulativePayloadSizeLimit.GetOrDefault(ctx, cresettings.DefaultGetter) + maxPerOracleUnexpiredBlobCumulativePayloadBytes, err := cresettings.Default.VaultMaxPerOracleUnexpiredBlobCumulativePayloadSizeLimit.GetOrDefault(ctx, limitsFactory.Settings) if err != nil { return ocr3_1types.ReportingPluginLimits{}, fmt.Errorf("VaultMaxPerOracleUnexpiredBlobCumulativePayloadSizeLimit: %w", err) } - maxPerOracleUnexpiredBlobCount, err := cresettings.Default.VaultMaxPerOracleUnexpiredBlobCount.GetOrDefault(ctx, cresettings.DefaultGetter) + maxPerOracleUnexpiredBlobCount, err := cresettings.Default.VaultMaxPerOracleUnexpiredBlobCount.GetOrDefault(ctx, limitsFactory.Settings) if err != nil { return ocr3_1types.ReportingPluginLimits{}, fmt.Errorf("VaultMaxPerOracleUnexpiredBlobCount: %w", err) } @@ -303,7 +303,7 @@ func (r *ReportingPluginFactory) NewReportingPlugin(ctx context.Context, config return nil, ocr3_1types.ReportingPluginInfo1{}, fmt.Errorf("could not create plugin metrics: %w", err) } - pluginLimits, err := initializePluginLimits(ctx) + pluginLimits, err := initializePluginLimits(ctx, r.limitsFactory) if err != nil { return nil, ocr3_1types.ReportingPluginInfo1{}, fmt.Errorf("could not resolve plugin limits: %w", err) }