feat(coprocessor): drift detection in gw-listener (M1)#2096
Open
feat(coprocessor): drift detection in gw-listener (M1)#2096
Conversation
637dca2 to
a76cffe
Compare
Eikix
commented
Mar 11, 2026
Eikix
commented
Mar 11, 2026
Eikix
commented
Mar 11, 2026
Eikix
commented
Mar 11, 2026
Compare local ciphertext digests against on-chain consensus from the CiphertextCommits contract. Enabled via --ciphertext-commits-address. Adds early-warning logging when peer submissions diverge and structured warn logs when local digest mismatches consensus. Four new Prometheus counters provide observability. Detection-only — no recovery action.
…ft checks - P1: Propagate DB errors from handle_consensus instead of swallowing them, so the block is retried via the outer backoff loop. - P2: Queue unresolved consensus events (local digest not yet computed) in a bounded pending queue (10k cap) and retry each block tick, so late-arriving local digests are still checked. - Refactor comparison logic into try_resolve_consensus shared by both the initial check and the retry path.
515f6a5 to
56d267f
Compare
🧪 CI InsightsHere's what we observed from your CI run for d114dac. 🟢 All jobs passed!But CI Insights is watching 👀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
gw-listenerby pollingCiphertextCommitseventsGatewayConfigwhen drift detection is enabledCiphertextCommitsblock and rebuild open-handle state from chain logs after restartciphertext_digestrow when local digests already existdrift_detected,consensus_timeout,missing_submissionScope Notes
CiphertextCommitsblockTest plan
SQLX_OFFLINE=true cargo build -p gw-listenerSQLX_OFFLINE=true cargo test -p gw-listenergw-listenerwith--ciphertext_commits_addressand--gateway-config-addressgw-listenerwhile a handle is still open and verify tracking resumes from the persisted watermark/metricsexposesdrift_detected,consensus_timeout, andmissing_submissioncloses https://github.com/zama-ai/fhevm-internal/issues/1147