Skip to content

Commit 8a7aa86

Browse files
feat(kms-connector): decryption acl check (#1845)
* feat(kms-connector): acl check for decryption (#1829) * feat(kms-connector): acl check for decryption * chore(kms-connector): update tests for acl check * chore(charts): support kms-connector acl check * chore(test-suite): add connector host chains config * chore(kms-connector): parametrized unit tests * feat(kms-connector): fetch use decryption calldata * fix(kms-connector): user decrypt acl check * fix(kms-connector): review fix * chore(test-suite): use acl kms-connector (#1844) * chore(kms-connector): add more acl tests (#1841)
1 parent d4a53e6 commit 8a7aa86

File tree

55 files changed

+1646
-640
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+1646
-640
lines changed

charts/kms-connector/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: kms-connector
22
description: A helm chart to distribute and deploy the Zama KMS Connector services
3-
version: 1.3.1
3+
version: 1.4.0
44
apiVersion: v2
55
keywords:
66
- fhevm

charts/kms-connector/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ The following table lists the configurable parameters of the `kms-connector` cha
3030
| Parameter | Description | Default |
3131
| --------------------------------------------- |-----------------------------------------------------------| ----------------------------------------------------------------------------------------------------------------------------------------------------------------- |
3232
| `commonConfig.databaseUrl` | The database URL. | `postgresql://$(DATABASE_USERNAME):$(DATABASE_PASSWORD)@$(DATABASE_ENDPOINT)/connector` |
33-
| `commonConfig.gatewayUrl` | The gateway URL. | `ws://gateway-anvil-node:8546` |
34-
| `commonConfig.chainId` | The chain ID. | `54321` |
33+
| `commonConfig.gatewayUrl` | The gateway URL. | `http://gateway-node:8546` |
34+
| `commonConfig.gatewayChainId` | The gateway chain ID. | `54321` |
3535
| `commonConfig.gatewayContractAddresses` | The contract addresses for the gateway. | `{}` |
3636
| `commonConfig.tracing.enabled` | If `true`, enable tracing for all components. | `false` |
3737
| `commonConfig.tracing.endpoint` | The OpenTelemetry collector endpoint. | `http://otel-deployment-opentelemetry-collector.observability.svc.cluster.local:4317` |

charts/kms-connector/templates/kms-connector-gw-listener-deployment.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,9 @@ spec:
5959
- name: KMS_CONNECTOR_DATABASE_URL
6060
value: {{ .Values.commonConfig.databaseUrl | quote }}
6161
- name: KMS_CONNECTOR_GATEWAY_URL
62-
value: {{ default .Values.commonConfig.gatewayUrl .Values.kmsConnectorGwListener.config.gatewayUrl | quote }}
63-
- name: KMS_CONNECTOR_CHAIN_ID
64-
value: {{ .Values.commonConfig.chainId | quote }}
62+
value: {{ default .Values.commonConfig.gatewayUrl (.Values.kmsConnectorGwListener.config).gatewayUrl | quote }}
63+
- name: KMS_CONNECTOR_GATEWAY_CHAIN_ID
64+
value: {{ .Values.commonConfig.gatewayChainId | quote }}
6565
- name: KMS_CONNECTOR_DECRYPTION_CONTRACT__ADDRESS
6666
value: {{ .Values.commonConfig.gatewayContractAddresses.decryption | quote }}
6767
- name: KMS_CONNECTOR_GATEWAY_CONFIG_CONTRACT__ADDRESS

charts/kms-connector/templates/kms-connector-kms-worker-deployment.yaml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,9 @@ spec:
5959
- name: KMS_CONNECTOR_DATABASE_URL
6060
value: {{ .Values.commonConfig.databaseUrl | quote }}
6161
- name: KMS_CONNECTOR_GATEWAY_URL
62-
value: {{ default .Values.commonConfig.gatewayUrl .Values.kmsConnectorKmsWorker.config.gatewayUrl | quote }}
63-
- name: KMS_CONNECTOR_CHAIN_ID
64-
value: {{ .Values.commonConfig.chainId | quote }}
62+
value: {{ default .Values.commonConfig.gatewayUrl (.Values.kmsConnectorKmsWorker.config).gatewayUrl | quote }}
63+
- name: KMS_CONNECTOR_GATEWAY_CHAIN_ID
64+
value: {{ .Values.commonConfig.gatewayChainId | quote }}
6565
- name: KMS_CONNECTOR_DECRYPTION_CONTRACT__ADDRESS
6666
value: {{ .Values.commonConfig.gatewayContractAddresses.decryption | quote }}
6767
- name: KMS_CONNECTOR_GATEWAY_CONFIG_CONTRACT__ADDRESS
@@ -78,6 +78,8 @@ spec:
7878
{{- end }}
7979
- name: KMS_CONNECTOR_KMS_CORE_ENDPOINTS
8080
value: {{ .Values.kmsConnectorKmsWorker.config.kmsCoreEndpoints | quote }}
81+
- name: KMS_CONNECTOR_HOST_CHAINS
82+
value: {{ toJson (.Values.kmsConnectorKmsWorker.config.hostChains) | quote }}
8183
ports:
8284
{{- range $portName, $portValue := .Values.kmsConnectorKmsWorker.ports }}
8385
- name: {{ $portName }}

charts/kms-connector/templates/kms-connector-tx-sender-deployment.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,9 @@ spec:
5959
- name: KMS_CONNECTOR_DATABASE_URL
6060
value: {{ .Values.commonConfig.databaseUrl | quote }}
6161
- name: KMS_CONNECTOR_GATEWAY_URL
62-
value: {{ default .Values.commonConfig.gatewayUrl .Values.kmsConnectorTxSender.config.gatewayUrl | quote }}
63-
- name: KMS_CONNECTOR_CHAIN_ID
64-
value: {{ .Values.commonConfig.chainId | quote }}
62+
value: {{ default .Values.commonConfig.gatewayUrl (.Values.kmsConnectorTxSender.config).gatewayUrl | quote }}
63+
- name: KMS_CONNECTOR_GATEWAY_CHAIN_ID
64+
value: {{ .Values.commonConfig.gatewayChainId | quote }}
6565
- name: KMS_CONNECTOR_DECRYPTION_CONTRACT__ADDRESS
6666
value: {{ .Values.commonConfig.gatewayContractAddresses.decryption | quote }}
6767
- name: KMS_CONNECTOR_GATEWAY_CONFIG_CONTRACT__ADDRESS

charts/kms-connector/values.yaml

Lines changed: 16 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -15,21 +15,18 @@
1515
# Shared configuration across all KMS connector components
1616
commonConfig:
1717
# Database connection string
18-
databaseUrl: "postgresql://$(DATABASE_USERNAME):$(DATABASE_PASSWORD)@$(DATABASE_ENDPOINT)/connector"
18+
databaseUrl: "postgresql://$(DATABASE_ENDPOINT)/connector"
1919

20-
# Gateway WebSocket endpoint
21-
gatewayUrl: "ws://gateway-anvil-node:8546"
20+
# Gateway chain RPC node endpoint (HTTP)
21+
gatewayUrl: "http://gateway-node:8546"
2222

2323
# Gateway chain identifier
24-
chainId: "54321"
24+
gatewayChainId: "54321"
2525

2626
# Gateway smart contract addresses
2727
gatewayContractAddresses:
2828
decryption: "0xc9bAE822fE6793e3B456144AdB776D5A318CB71e"
2929
gatewayConfig: "0xeAC2EfFA07844aB326D92d1De29E136a6793DFFA"
30-
# =========================================================================
31-
# NEW VARIABLES
32-
# =========================================================================
3330
kmsGeneration: "0xF0bFB159C7381F7CB332586004d8247252C5b816"
3431

3532
# Distributed tracing configuration
@@ -45,12 +42,12 @@ commonConfig:
4542
# secretKeyRef:
4643
# name: connector-database
4744
# key: endpoint
48-
# - name: DATABASE_USERNAME
45+
# - name: PGUSER
4946
# valueFrom:
5047
# secretKeyRef:
5148
# name: connector-database
5249
# key: username
53-
# - name: DATABASE_PASSWORD
50+
# - name: PGPASSWORD
5451
# valueFrom:
5552
# secretKeyRef:
5653
# name: connector-database
@@ -78,19 +75,8 @@ kmsConnectorDbMigration:
7875

7976
# Environment variables for database migration
8077
env:
81-
# =========================================================================
82-
# DEPRECATED ENVIRONMENT VARIABLES
83-
# =========================================================================
84-
# TODO: Apply new environment variable pattern to all services
8578
- name: DATABASE_ENDPOINT
86-
- name: DATABASE_USERNAME
87-
- name: DATABASE_PASSWORD
88-
89-
# =========================================================================
90-
# NEW ENVIRONMENT VARIABLES
91-
# =========================================================================
92-
- name: DATABASE_URL
93-
value: "postgresql://$(PGUSER):$(PGPASSWORD)@db:5432/kms-connector"
79+
value: "postgresql://db:5432/kms-connector"
9480
- name: PGUSER
9581
value: "postgres"
9682
- name: PGPASSWORD
@@ -131,7 +117,7 @@ kmsConnectorGwListener:
131117
# Component-specific configuration
132118
config:
133119
# Override commonConfig.gatewayUrl if needed
134-
gatewayUrl:
120+
# gatewayUrl:
135121

136122
# Additional environment variables
137123
env:
@@ -204,8 +190,14 @@ kmsConnectorKmsWorker:
204190
# KMS core endpoints for communication
205191
kmsCoreEndpoints: "http://kms-core:50051"
206192

193+
# List of host chain RPC node endpoints, chain ids, and ACL contract addresses
194+
hostChains:
195+
- url: "http://host-node:8545"
196+
chainId: 12345
197+
aclAddress: "0x05fD9B5EFE0a996095f42Ed7e77c390810CF660c"
198+
207199
# Override commonConfig.gatewayUrl if needed
208-
gatewayUrl:
200+
# gatewayUrl:
209201

210202
# Additional environment variables
211203
env:
@@ -276,7 +268,7 @@ kmsConnectorTxSender:
276268
# Component-specific configuration
277269
config:
278270
# Override commonConfig.gatewayUrl if needed
279-
gatewayUrl:
271+
# gatewayUrl:
280272

281273
# Additional environment variables
282274
env:

kms-connector/.sqlx/query-1a43a1973631354ba7c92764223b8acaaba30982fbf37619f9982ee5adac8b04.json renamed to kms-connector/.sqlx/query-1888cb93938ce9a18f9377d2fddfc401c88fd6faa03a32f5bbdefe98a43d0313.json

Lines changed: 3 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

kms-connector/.sqlx/query-41d4b316abb26befda0e34bc2268dffd8cd4355ac8b9cf65aa7fafd49ff006fb.json renamed to kms-connector/.sqlx/query-3032013ef9478ad521091099d5457480f1af52604102ab58dabf9736cb01e2fd.json

Lines changed: 3 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

kms-connector/.sqlx/query-2006d0c6aa7ad4945af0ae9d6fa99d64f62543158c13f34b0096e56357539ba1.json renamed to kms-connector/.sqlx/query-6dd2df664bed60a78af26ff5ec8c778d23386620c4d2d6071f8c80964ea023be.json

Lines changed: 3 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

kms-connector/.sqlx/query-7bf9a7bfc6bacf7ee2b05b32557d7c20d0ac7ee27839e605f2823e5e9d243545.json renamed to kms-connector/.sqlx/query-744cd44ac5affeea646b39ebc5bf218d30d7ad616f727ed99fd8a3a71ba63fbf.json

Lines changed: 3 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)