Skip to content

fix(coprocessor): verify input via eth_getLogs#1795

Closed
dartdart26 wants to merge 2 commits intorelease/0.10.xfrom
petar/cherry-pick-get-logs-input-proof-2
Closed

fix(coprocessor): verify input via eth_getLogs#1795
dartdart26 wants to merge 2 commits intorelease/0.10.xfrom
petar/cherry-pick-get-logs-input-proof-2

Conversation

@dartdart26
Copy link
Copy Markdown
Collaborator

@dartdart26 dartdart26 commented Jan 16, 2026

Instead of relying on subscriptions that are not reliable in all cases, use eth_getLogs to fetch verify input requests.

Also, change:

  • poll interval from 1 sec to 500 ms to reduce latency

Since gw-listener catches up automatically via the last processed block number in the DB, call the manual process "replay" instead of "catchup". Replay is requested via the cmd line. Also, keep the old name as an alias for backward compatibility. Furthermore, replay is not KMS-specific anymore, so remove KMS from the name.

Add more logging in health checks and replay.

Instead of relying on subscriptions that are not reliable in all cases,
use eth_getLogs to fetch verify input requests.

Also, change:
 * poll interval from 1 sec to 500 ms to reduce latency
@dartdart26 dartdart26 self-assigned this Jan 16, 2026
@dartdart26 dartdart26 requested review from a team as code owners January 16, 2026 14:52
@cla-bot cla-bot bot added the cla-signed label Jan 16, 2026
antoniupop
antoniupop previously approved these changes Jan 16, 2026
@mergify
Copy link
Copy Markdown

mergify bot commented Jan 16, 2026

🧪 CI Insights

Here's what we observed from your CI run for b68e72a.

🟢 All jobs passed!

But CI Insights is watching 👀

@dartdart26 dartdart26 force-pushed the petar/cherry-pick-get-logs-input-proof-2 branch from e8e24d0 to ef536f1 Compare January 16, 2026 15:40
Since gw-listener catches up automatically via the last processed block
number in the DB, call the manual process "replay" instead of "catchup".
Replay is requested via the cmd line. Also, keep the old name as an
alias for backward compatibility. Furthermore, replay is not
KMS-specific anymore, so remove KMS from the name.

Add more logging in health checks and replay.

Update cargo-audit version to 0.22.0 and run `cargo update -p ruint` due
to a vulnerability reported in CI.
@dartdart26 dartdart26 force-pushed the petar/cherry-pick-get-logs-input-proof-2 branch from ef536f1 to b68e72a Compare January 16, 2026 15:52
@antoniupop antoniupop requested a review from Copilot January 16, 2026 15:54
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request refactors the gateway listener to use eth_getLogs polling instead of event subscriptions for fetching verify input requests, improving reliability. The terminology changes from "catchup" to "replay" to better reflect the manual recovery process, and the poll interval is reduced from 1 second to 500ms to reduce latency.

Changes:

  • Removed subscription-based run_input_verification and merged input verification into the polling-based run_get_logs method
  • Renamed catchup_kms_generation_from_block to replay_from_block with backward-compatible CLI alias
  • Reduced get_logs_poll_interval default from 1s to 500ms and added configurable logging frequency for last processed block updates

Reviewed changes

Copilot reviewed 6 out of 8 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
gw_listener.rs Consolidated event processing into run_get_logs, removed subscription-based verification, and added enhanced logging for health checks
lib.rs Updated configuration field names and defaults for replay functionality and poll interval
bin/gw_listener.rs Renamed CLI argument with backward-compatible alias and added new logging configuration parameter
gw_listener_tests.rs Updated test to use new replay_from_block configuration field name
values.yaml Updated Helm chart with new parameter names and defaults
Chart.yaml Bumped chart version from 0.7.10 to 0.7.12
Cargo.lock Updated dependency versions including ruint, cargo-audit, and various windows-sys references
coprocessor-dependency-analysis.yml Updated cargo-audit version from 0.21.0 to 0.22.0
Comments suppressed due to low confidence (1)

coprocessor/fhevm-engine/gw-listener/src/gw_listener.rs:339

  • The VERIFY_PROOF_SUCCESS_COUNTER is incremented twice for each successful verify proof request. It's incremented here in the verify_proof_request function (line 336), and then again at line 276 in run_get_logs via VERIFY_PROOF_SUCCESS_COUNTER.inc_by(verify_proof_success). Remove the counter increment from this function since the caller already handles metric updates after successful DB commit to avoid double-counting.
        inspect(|_| {
            VERIFY_PROOF_SUCCESS_COUNTER.inc();
        }).inspect_err(|_| {
            VERIFY_PROOF_FAIL_COUNTER.inc();
        })?;

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

};
},
_ => {
error!(log = ?log, "Unknown KMSGeneration event")
Copy link

Copilot AI Jan 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing period at the end of the error message. For consistency with other error messages in the codebase (e.g., lines 206, 210, 255), add a period at the end of this error message.

Suggested change
error!(log = ?log, "Unknown KMSGeneration event")
error!(log = ?log, "Unknown KMSGeneration event.");

Copilot uses AI. Check for mistakes.
@Eikix
Copy link
Copy Markdown
Contributor

Eikix commented Feb 19, 2026

Already on main, we can close this

@Eikix Eikix closed this Feb 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants