Skip to content

Commit e303e77

Browse files
authored
Merge of #2096
2 parents e561ebd + 26ddfd4 commit e303e77

File tree

15 files changed

+2476
-113
lines changed

15 files changed

+2476
-113
lines changed

.github/workflows/test-suite-e2e-tests.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,11 @@ jobs:
238238
run: |
239239
./fhevm-cli test hcu-block-cap
240240
241+
- name: Ciphertext drift test
242+
working-directory: test-suite/fhevm
243+
run: |
244+
./fhevm-cli test ciphertext-drift
245+
241246
- name: Host listener poller test
242247
working-directory: test-suite/fhevm
243248
run: |

charts/coprocessor/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: coprocessor
22
description: A helm chart to distribute and deploy Zama fhevm Co-Processor services
3-
version: 0.8.4
3+
version: 0.8.5
44
apiVersion: v2
55
keywords:
66
- fhevm

charts/coprocessor/values.yaml

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -417,12 +417,31 @@ gwListener:
417417
replicas: 1
418418

419419
env:
420-
# =========================================================================
421-
# NEW ENVIRONMENT VARIABLES
422-
# =========================================================================
423-
# The address of the KMSGeneration contract
420+
- name: DATABASE_URL
421+
valueFrom:
422+
secretKeyRef:
423+
name: coprocessor-db-url
424+
key: coprocessor-db-url
425+
- name: INPUT_VERIFICATION_ADDRESS
426+
valueFrom:
427+
configMapKeyRef:
428+
name: gateway-sc-addresses
429+
key: input_verification.address
424430
- name: KMS_GENERATION_ADDRESS
425-
value: ""
431+
valueFrom:
432+
configMapKeyRef:
433+
name: gateway-sc-addresses
434+
key: kms_generation.address
435+
- name: CIPHERTEXT_COMMITS_ADDRESS
436+
valueFrom:
437+
configMapKeyRef:
438+
name: gateway-sc-addresses
439+
key: ciphertext_commits.address
440+
- name: GATEWAY_CONFIG_ADDRESS
441+
valueFrom:
442+
configMapKeyRef:
443+
name: gateway-sc-addresses
444+
key: gateway_config.address
426445

427446
# Command line arguments for the gateway listener
428447
args:
@@ -432,6 +451,8 @@ gwListener:
432451
- --gw-url=ws://gateway-rpc-node:8548
433452
- --input-verification-address=$(INPUT_VERIFICATION_ADDRESS)
434453
- --kms-generation-address=$(KMS_GENERATION_ADDRESS)
454+
- --ciphertext-commits-address=$(CIPHERTEXT_COMMITS_ADDRESS)
455+
- --gateway-config-address=$(GATEWAY_CONFIG_ADDRESS)
435456
- --error-sleep-initial-secs=1
436457
- --error-sleep-max-secs=10
437458
- --health-check-port=8080
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
ALTER TABLE gw_listener_last_block
2+
ADD COLUMN IF NOT EXISTS earliest_open_ct_commits_block BIGINT
3+
CHECK (earliest_open_ct_commits_block >= 0);

coprocessor/fhevm-engine/gw-listener/src/bin/gw_listener.rs

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,31 @@ struct Conf {
8989
help = "Skip VerifyProofRequest events during replay"
9090
)]
9191
pub replay_skip_verify_proof: bool,
92+
93+
#[arg(
94+
long,
95+
requires = "gateway_config_address",
96+
help = "CiphertextCommits contract address for drift detection"
97+
)]
98+
ciphertext_commits_address: Option<Address>,
99+
100+
#[arg(
101+
long,
102+
requires = "ciphertext_commits_address",
103+
help = "GatewayConfig contract address used to fetch coprocessor tx-senders"
104+
)]
105+
gateway_config_address: Option<Address>,
106+
107+
/// How long to wait for the gateway to emit a consensus event after the
108+
/// first submission is seen. Wall-clock duration — the default of 5 minutes
109+
/// accommodates coprocessors that may be stuck for a few minutes.
110+
#[arg(long, default_value = "5m", value_parser = parse_duration, requires = "ciphertext_commits_address")]
111+
drift_no_consensus_timeout: Duration,
112+
113+
/// After consensus, how many additional blocks to wait for remaining
114+
/// coprocessors to submit their ciphertext material. Wall-clock duration.
115+
#[arg(long, default_value = "5m", value_parser = parse_duration, requires = "ciphertext_commits_address")]
116+
drift_post_consensus_grace: Duration,
92117
}
93118

94119
fn install_signal_handlers(cancel_token: CancellationToken) -> anyhow::Result<()> {
@@ -171,6 +196,10 @@ async fn main() -> anyhow::Result<()> {
171196
replay_from_block: conf.replay_from_block,
172197
replay_skip_verify_proof: conf.replay_skip_verify_proof,
173198
log_last_processed_every_number_of_updates: conf.log_last_processed_every_number_of_updates,
199+
ciphertext_commits_address: conf.ciphertext_commits_address,
200+
gateway_config_address: conf.gateway_config_address,
201+
drift_no_consensus_timeout: conf.drift_no_consensus_timeout,
202+
drift_post_consensus_grace: conf.drift_post_consensus_grace,
174203
};
175204

176205
let gw_listener = GatewayListener::new(

0 commit comments

Comments
 (0)