Skip to content

Commit 5c5be51

Browse files
Add Vault settings to the settings package (#1689)
1 parent fdbfd52 commit 5c5be51

File tree

3 files changed

+40
-1
lines changed

3 files changed

+40
-1
lines changed

pkg/settings/cresettings/defaults.json

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,20 @@
33
"WorkflowExecutionConcurrencyLimit": "200",
44
"WorkflowTriggerRateLimit": "200rps:200",
55
"GatewayIncomingPayloadSizeLimit": "1mb",
6+
"VaultCiphertextSizeLimit": "2kb",
7+
"VaultIdentifierKeySizeLimit": "64b",
8+
"VaultIdentifierOwnerSizeLimit": "64b",
9+
"VaultIdentifierNamespaceSizeLimit": "64b",
10+
"VaultPluginBatchSizeLimit": "20",
11+
"VaultRequestBatchSizeLimit": "10",
612
"PerOrg": {
713
"WorkflowDeploymentRateLimit": "every1m0s:1",
814
"ZeroBalancePruningTimeout": "24h0m0s"
915
},
1016
"PerOwner": {
1117
"WorkflowExecutionConcurrencyLimit": "5",
12-
"WorkflowTriggerRateLimit": "5rps:5"
18+
"WorkflowTriggerRateLimit": "5rps:5",
19+
"VaultSecretsLimit": "100"
1320
},
1421
"PerWorkflow": {
1522
"TriggerRateLimit": "every30s:3",

pkg/settings/cresettings/defaults.toml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@ WorkflowLimit = '200'
22
WorkflowExecutionConcurrencyLimit = '200'
33
WorkflowTriggerRateLimit = '200rps:200'
44
GatewayIncomingPayloadSizeLimit = '1mb'
5+
VaultCiphertextSizeLimit = '2kb'
6+
VaultIdentifierKeySizeLimit = '64b'
7+
VaultIdentifierOwnerSizeLimit = '64b'
8+
VaultIdentifierNamespaceSizeLimit = '64b'
9+
VaultPluginBatchSizeLimit = '20'
10+
VaultRequestBatchSizeLimit = '10'
511

612
[PerOrg]
713
WorkflowDeploymentRateLimit = 'every1m0s:1'
@@ -10,6 +16,7 @@ ZeroBalancePruningTimeout = '24h0m0s'
1016
[PerOwner]
1117
WorkflowExecutionConcurrencyLimit = '5'
1218
WorkflowTriggerRateLimit = '5rps:5'
19+
VaultSecretsLimit = '100'
1320

1421
[PerWorkflow]
1522
TriggerRateLimit = 'every30s:3'

pkg/settings/cresettings/settings.go

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,30 @@ var Default = Schema{
4949
WorkflowTriggerRateLimit: Rate(200, 200),
5050
GatewayIncomingPayloadSizeLimit: Size(1 * config.MByte),
5151

52+
// DANGER(cedric): Be extremely careful changing these vault limits as they act as a default value
53+
// used by the Vault OCR plugin -- changing these values could cause issues with the plugin during an image
54+
// upgrade as nodes apply the old and new values inconsistently. A safe upgrade path
55+
// must ensure that we are overriding the default in the onchain configuration for the contract.
56+
VaultCiphertextSizeLimit: Size(2 * config.KByte),
57+
VaultIdentifierKeySizeLimit: Size(64 * config.Byte),
58+
VaultIdentifierOwnerSizeLimit: Size(64 * config.Byte),
59+
VaultIdentifierNamespaceSizeLimit: Size(64 * config.Byte),
60+
VaultPluginBatchSizeLimit: Int(20),
61+
VaultRequestBatchSizeLimit: Int(10),
62+
5263
PerOrg: Orgs{
5364
WorkflowDeploymentRateLimit: Rate(rate.Every(time.Minute), 1),
5465
ZeroBalancePruningTimeout: Duration(24 * time.Hour),
5566
},
5667
PerOwner: Owners{
5768
WorkflowExecutionConcurrencyLimit: Int(5),
5869
WorkflowTriggerRateLimit: Rate(5, 5),
70+
71+
// DANGER(cedric): Be extremely careful changing this vault limit as it acts as a default value
72+
// used by the Vault OCR plugin -- changing this value could cause issues with the plugin during an image
73+
// upgrade as nodes apply the old and new values inconsistently. A safe upgrade path
74+
// must ensure that we are overriding the default in the onchain configuration for the contract.
75+
VaultSecretsLimit: Int(100),
5976
},
6077
PerWorkflow: Workflows{
6178
TriggerRateLimit: Rate(rate.Every(30*time.Second), 3),
@@ -128,6 +145,13 @@ type Schema struct {
128145
WorkflowTriggerRateLimit Setting[config.Rate]
129146
GatewayIncomingPayloadSizeLimit Setting[config.Size]
130147

148+
VaultCiphertextSizeLimit Setting[config.Size]
149+
VaultIdentifierKeySizeLimit Setting[config.Size]
150+
VaultIdentifierOwnerSizeLimit Setting[config.Size]
151+
VaultIdentifierNamespaceSizeLimit Setting[config.Size]
152+
VaultPluginBatchSizeLimit Setting[int] `unit:"{request}"`
153+
VaultRequestBatchSizeLimit Setting[int] `unit:"{request}"`
154+
131155
PerOrg Orgs `scope:"org"`
132156
PerOwner Owners `scope:"owner"`
133157
PerWorkflow Workflows `scope:"workflow"`
@@ -142,6 +166,7 @@ type Owners struct {
142166
WorkflowExecutionConcurrencyLimit Setting[int] `unit:"{workflow}"`
143167
// Deprecated
144168
WorkflowTriggerRateLimit Setting[config.Rate]
169+
VaultSecretsLimit Setting[int] `unit:"{secret}"`
145170
}
146171

147172
type Workflows struct {

0 commit comments

Comments
 (0)