Skip to content

Commit a22bbbf

Browse files
Add Vault settings to the settings package
1 parent 6cbcde2 commit a22bbbf

File tree

3 files changed

+36
-1
lines changed

3 files changed

+36
-1
lines changed

pkg/settings/cresettings/defaults.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,19 @@
33
"WorkflowExecutionConcurrencyLimit": "200",
44
"WorkflowTriggerRateLimit": "200rps:200",
55
"GatewayIncomingPayloadSizeLimit": "1mb",
6+
"VaultCiphertextSizeLimit": "2kb",
7+
"VaultIdentifierKeySizeLimit": "64b",
8+
"VaultIdentifierOwnerSizeLimit": "64b",
9+
"VaultIdentifierNamespaceSizeLimit": "64b",
10+
"VaultBatchSizeLimit": "20",
611
"PerOrg": {
712
"WorkflowDeploymentRateLimit": "every1m0s:1",
813
"ZeroBalancePruningTimeout": "24h0m0s"
914
},
1015
"PerOwner": {
1116
"WorkflowExecutionConcurrencyLimit": "5",
12-
"WorkflowTriggerRateLimit": "5rps:5"
17+
"WorkflowTriggerRateLimit": "5rps:5",
18+
"VaultSecretsLimit": "100"
1319
},
1420
"PerWorkflow": {
1521
"TriggerRateLimit": "every30s:3",

pkg/settings/cresettings/defaults.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@ 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+
VaultBatchSizeLimit = '20'
510

611
[PerOrg]
712
WorkflowDeploymentRateLimit = 'every1m0s:1'
@@ -10,6 +15,7 @@ ZeroBalancePruningTimeout = '24h0m0s'
1015
[PerOwner]
1116
WorkflowExecutionConcurrencyLimit = '5'
1217
WorkflowTriggerRateLimit = '5rps:5'
18+
VaultSecretsLimit = '100'
1319

1420
[PerWorkflow]
1521
TriggerRateLimit = 'every30s:3'

pkg/settings/cresettings/settings.go

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,29 @@ 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+
VaultBatchSizeLimit: Int(20),
61+
5262
PerOrg: Orgs{
5363
WorkflowDeploymentRateLimit: Rate(rate.Every(time.Minute), 1),
5464
ZeroBalancePruningTimeout: Duration(24 * time.Hour),
5565
},
5666
PerOwner: Owners{
5767
WorkflowExecutionConcurrencyLimit: Int(5),
5868
WorkflowTriggerRateLimit: Rate(5, 5),
69+
70+
// DANGER(cedric): Be extremely careful changing this vault limit as it acts as a default value
71+
// used by the Vault OCR plugin -- changing this value could cause issues with the plugin during an image
72+
// upgrade as nodes apply the old and new values inconsistently. A safe upgrade path
73+
// must ensure that we are overriding the default in the onchain configuration for the contract.
74+
VaultSecretsLimit: Int(100),
5975
},
6076
PerWorkflow: Workflows{
6177
TriggerRateLimit: Rate(rate.Every(30*time.Second), 3),
@@ -128,6 +144,12 @@ type Schema struct {
128144
WorkflowTriggerRateLimit Setting[config.Rate]
129145
GatewayIncomingPayloadSizeLimit Setting[config.Size]
130146

147+
VaultCiphertextSizeLimit Setting[config.Size]
148+
VaultIdentifierKeySizeLimit Setting[config.Size] `unit:"{byte}"`
149+
VaultIdentifierOwnerSizeLimit Setting[config.Size] `unit:"{byte}"`
150+
VaultIdentifierNamespaceSizeLimit Setting[config.Size] `unit:"{byte}"`
151+
VaultBatchSizeLimit Setting[int] `unit:"{request}"`
152+
131153
PerOrg Orgs `scope:"org"`
132154
PerOwner Owners `scope:"owner"`
133155
PerWorkflow Workflows `scope:"workflow"`
@@ -142,6 +164,7 @@ type Owners struct {
142164
WorkflowExecutionConcurrencyLimit Setting[int] `unit:"{workflow}"`
143165
// Deprecated
144166
WorkflowTriggerRateLimit Setting[config.Rate]
167+
VaultSecretsLimit Setting[int] `unit:"{secret}"`
145168
}
146169

147170
type Workflows struct {

0 commit comments

Comments
 (0)