Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
a36335f
feat(coprocessor): add opt-in drift detection to gw-listener
Eikix Mar 11, 2026
bfc8e11
fix(coprocessor): propagate consensus errors and defer unresolved dri…
Eikix Mar 11, 2026
4ab48f2
refactor(coprocessor): trim drift detection to m1
Eikix Mar 11, 2026
afd309a
chore(coprocessor): drop m1 wording
Eikix Mar 11, 2026
c8b718f
feat(coprocessor): track drift variants and lagging coprocessors
Eikix Mar 11, 2026
75b5598
refactor(coprocessor): fetch expected senders from gateway config
Eikix Mar 11, 2026
f1756f6
feat(coprocessor): rebuild drift tracking after restart
Eikix Mar 11, 2026
6cd0a32
fix(coprocessor): silence drift replay on restart
Eikix Mar 11, 2026
af18faa
fix(coprocessor): keep consensus checks until local digests exist
Eikix Mar 11, 2026
562d936
chore(coprocessor): apply rustfmt cleanup
Eikix Mar 11, 2026
7ce03ed
Fix drift detector rebuild and sender refresh
Eikix Mar 11, 2026
ba11e62
Fix catch-up sender seeding and batch finalization
Eikix Mar 11, 2026
f7d804b
Wire drift detection into gw-listener chart
Eikix Mar 11, 2026
56d267f
Bump coprocessor chart version
Eikix Mar 11, 2026
3d776f7
Add ciphertext drift e2e workflow
Eikix Mar 11, 2026
c6f8795
Remove stray plan file
Eikix Mar 11, 2026
d114dac
Keep e2e drift test env intact
Eikix Mar 11, 2026
7b05be2
Tighten drift listener and e2e injector
Eikix Mar 12, 2026
84c4869
Use DB trigger for ciphertext drift e2e
Eikix Mar 12, 2026
92f2b64
Fix drift handle completion and e2e exit path
Eikix Mar 12, 2026
8308d66
test(e2e): assert ciphertext drift via listener logs
Eikix Mar 12, 2026
e1502dc
feat(gw-listener): add local attribution fields to drift logs
Eikix Mar 12, 2026
18473d8
feat(gw-listener): expose drift tuning histograms
Eikix Mar 12, 2026
e8d529c
refactor(gw-listener): simplify drift detector and listener internals
Eikix Mar 12, 2026
27237d6
test(drift-detector): add boundary and edge-case tests
Eikix Mar 12, 2026
aa6f456
refactor(tests): extract make_consensus_state helper, remove dead code
Eikix Mar 12, 2026
962ec57
Fix review findings: metric pollution, DB waste, completion bug, e2e …
Eikix Mar 12, 2026
abeb07a
docs(gw-listener): clarify consensus invariant
Eikix Mar 13, 2026
ffc10a8
refactor(gw-listener): simplify drift detector helpers and listener d…
Eikix Mar 13, 2026
eb328f9
rename submit() to submit_digest_event_and_drift_check() in tests
Eikix Mar 13, 2026
3f8a49b
refactor(gw-listener): simplify DriftDetector internals
Eikix Mar 13, 2026
62a9be6
docs(gw-listener): document rebuild_drift_detector and facade methods
Eikix Mar 13, 2026
898f0f6
fix(gw-listener): clarify drift counter description
Eikix Mar 13, 2026
88449db
address review feedback: metrics docs, default timeouts, clap requires
Eikix Mar 13, 2026
b88641d
refactor(gw-listener): rename alerts_enabled to replaying (inverted)
Eikix Mar 13, 2026
dde3788
address review feedback: type alias, flush_metrics, tx-senders signature
Eikix Mar 13, 2026
529fc88
refactor(gw-listener): rename HandleDisposition to HandleOutcome
Eikix Mar 13, 2026
d3c779a
address self-review: fix double-counted metrics, remove dead code, im…
Eikix Mar 13, 2026
eff20e0
fix(gw-listener): prevent drift detection errors from killing the lis…
Eikix Mar 13, 2026
704897c
refactor(gw-listener): replace block-based drift timeouts with wall-c…
Eikix Mar 16, 2026
5962e82
merge main into coproc-drift-heal
Eikix Mar 16, 2026
996dd28
docs(gw-listener): update metrics docs for wall-clock timeouts, clari…
Eikix Mar 16, 2026
26ddfd4
refactor(gw-listener): address review nits on drift detector
Eikix Mar 16, 2026
e303e77
Merge of #2096
mergify[bot] Mar 16, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/workflows/test-suite-e2e-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,11 @@ jobs:
run: |
./fhevm-cli test hcu-block-cap

- name: Ciphertext drift test
working-directory: test-suite/fhevm
run: |
./fhevm-cli test ciphertext-drift

- name: Host listener poller test
working-directory: test-suite/fhevm
run: |
Expand Down
2 changes: 1 addition & 1 deletion charts/coprocessor/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: coprocessor
description: A helm chart to distribute and deploy Zama fhevm Co-Processor services
version: 0.8.4
version: 0.8.5
apiVersion: v2
keywords:
- fhevm
Expand Down
31 changes: 26 additions & 5 deletions charts/coprocessor/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -417,12 +417,31 @@ gwListener:
replicas: 1

env:
# =========================================================================
# NEW ENVIRONMENT VARIABLES
# =========================================================================
# The address of the KMSGeneration contract
- name: DATABASE_URL
valueFrom:
secretKeyRef:
name: coprocessor-db-url
key: coprocessor-db-url
- name: INPUT_VERIFICATION_ADDRESS
valueFrom:
configMapKeyRef:
name: gateway-sc-addresses
key: input_verification.address
- name: KMS_GENERATION_ADDRESS
value: ""
valueFrom:
configMapKeyRef:
name: gateway-sc-addresses
key: kms_generation.address
- name: CIPHERTEXT_COMMITS_ADDRESS
valueFrom:
configMapKeyRef:
name: gateway-sc-addresses
key: ciphertext_commits.address
- name: GATEWAY_CONFIG_ADDRESS
valueFrom:
configMapKeyRef:
name: gateway-sc-addresses
key: gateway_config.address

# Command line arguments for the gateway listener
args:
Expand All @@ -432,6 +451,8 @@ gwListener:
- --gw-url=ws://gateway-rpc-node:8548
- --input-verification-address=$(INPUT_VERIFICATION_ADDRESS)
- --kms-generation-address=$(KMS_GENERATION_ADDRESS)
- --ciphertext-commits-address=$(CIPHERTEXT_COMMITS_ADDRESS)
- --gateway-config-address=$(GATEWAY_CONFIG_ADDRESS)
- --error-sleep-initial-secs=1
- --error-sleep-max-secs=10
- --health-check-port=8080
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
ALTER TABLE gw_listener_last_block
ADD COLUMN IF NOT EXISTS earliest_open_ct_commits_block BIGINT
CHECK (earliest_open_ct_commits_block >= 0);
29 changes: 29 additions & 0 deletions coprocessor/fhevm-engine/gw-listener/src/bin/gw_listener.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,31 @@ struct Conf {
help = "Skip VerifyProofRequest events during replay"
)]
pub replay_skip_verify_proof: bool,

#[arg(
long,
requires = "gateway_config_address",
help = "CiphertextCommits contract address for drift detection"
)]
ciphertext_commits_address: Option<Address>,

#[arg(
long,
requires = "ciphertext_commits_address",
help = "GatewayConfig contract address used to fetch coprocessor tx-senders"
)]
gateway_config_address: Option<Address>,

/// How long to wait for the gateway to emit a consensus event after the
/// first submission is seen. Wall-clock duration — the default of 5 minutes
/// accommodates coprocessors that may be stuck for a few minutes.
#[arg(long, default_value = "5m", value_parser = parse_duration, requires = "ciphertext_commits_address")]
drift_no_consensus_timeout: Duration,

/// After consensus, how many additional blocks to wait for remaining
/// coprocessors to submit their ciphertext material. Wall-clock duration.
#[arg(long, default_value = "5m", value_parser = parse_duration, requires = "ciphertext_commits_address")]
drift_post_consensus_grace: Duration,
}

fn install_signal_handlers(cancel_token: CancellationToken) -> anyhow::Result<()> {
Expand Down Expand Up @@ -171,6 +196,10 @@ async fn main() -> anyhow::Result<()> {
replay_from_block: conf.replay_from_block,
replay_skip_verify_proof: conf.replay_skip_verify_proof,
log_last_processed_every_number_of_updates: conf.log_last_processed_every_number_of_updates,
ciphertext_commits_address: conf.ciphertext_commits_address,
gateway_config_address: conf.gateway_config_address,
drift_no_consensus_timeout: conf.drift_no_consensus_timeout,
drift_post_consensus_grace: conf.drift_post_consensus_grace,
};

let gw_listener = GatewayListener::new(
Expand Down
Loading
Loading