Skip to content

Conversation

@ecol-master
Copy link
Member

@semanticdiff-com
Copy link

semanticdiff-com bot commented Dec 12, 2025

Review changes with  SemanticDiff

Changed Files
File Status
  ethexe/compute/src/compute.rs  48% smaller
  ethexe/compute/src/codes.rs  20% smaller
  ethexe/prometheus/src/lib.rs  18% smaller
  ethexe/rpc/src/apis/injected.rs  15% smaller
  ethexe/compute/src/prepare.rs  14% smaller
  ethexe/observer/src/lib.rs  10% smaller
  Cargo.lock Unsupported file format
  Cargo.toml Unsupported file format
  ethexe/common/Cargo.toml Unsupported file format
  ethexe/common/src/futures.rs  0% smaller
  ethexe/common/src/lib.rs  0% smaller
  ethexe/compute/Cargo.toml Unsupported file format
  ethexe/compute/src/service.rs  0% smaller
  ethexe/observer/Cargo.toml Unsupported file format
  ethexe/prometheus/Cargo.toml Unsupported file format
  ethexe/rpc/Cargo.toml Unsupported file format
  ethexe/rpc/src/lib.rs  0% smaller
  ethexe/rpc/src/metrics.rs  0% smaller
  ethexe/service/src/lib.rs Unsupported file format
  ethexe/service/src/tests/utils/events.rs  0% smaller

@gemini-code-assist
Copy link

Summary of Changes

Hello @ecol-master, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly upgrades the ethexe project's observability by integrating a new, unified metrics system. It moves away from a custom Prometheus integration towards a more modular approach using the metrics and metrics-derive crates. Key components like the compute and RPC services are now instrumented with new gauges and counters, providing deeper insights into their operational state and performance. The existing Prometheus component has been adapted to serve as an exporter for this new framework, ensuring continued compatibility while improving the overall metrics architecture.

Highlights

  • New Metrics System Integration: Introduced the metrics and metrics-derive crates to establish a standardized and flexible metrics collection framework across the ethexe project.
  • Compute Service Instrumentation: Implemented new gauges within the CodesSubService and PrepareSubService to track the number of currently processing codes, codes waiting for processing, and the length of the block queue, enhancing observability into the compute pipeline.
  • RPC Service Instrumentation: Added metrics to the InjectedApi within the RPC service to count the number of injected transactions sent, providing insight into RPC activity.
  • Prometheus Exporter Refactor: Refactored the ethexe-prometheus crate to function as a dedicated exporter for the new metrics system, simplifying its internal logic and removing direct Prometheus metric management.
  • Dependency Updates: Updated Cargo.toml and Cargo.lock files across the project to include the new metrics related crates and update existing prometheus dependencies to their latest versions.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a comprehensive metrics system using the metrics and metrics-exporter-prometheus crates, replacing a custom Prometheus integration. Key changes include adding new metric dependencies across Cargo.lock and Cargo.toml files, defining specific metric structs (Metrics, RpcApiMetrics, InjectedApiMetrics, BlockApiMetrics) with Counter and Gauge types for various services (compute, RPC), and integrating these metrics into the CodesSubService, PrepareSubService, and RPC InjectedApi. The previous PrometheusService logic for collecting and exposing metrics has been refactored to leverage the new metrics-exporter-prometheus for HTTP exposition, removing the PrometheusEvent and associated manual metric updates. A new test case for send_tx was added. Review comments highlight a critical regression in injected_sendTransaction where the original transaction processing logic was commented out, leaving only a metric increment and an Accept return, which needs to be restored. Additionally, a TODO comment regarding casting validated_codes.len() to u32 for a Gauge metric was noted, with a suggestion to cast to f64 to prevent potential data loss from truncation.

@grishasobol grishasobol added the D8-ethexe ethexe-related PR label Dec 16, 2025
Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a comprehensive metrics system to ethexe using the metrics crate, which is a significant improvement for observability. The implementation is well-structured, with metrics definitions co-located with their respective services. The prometheus service has been refactored to use metrics-exporter-prometheus, which is a great move towards using standard libraries and simplifying the codebase. The identified minor issue regarding a potential panic in a utility function has been retained as it does not contradict any existing rules. Overall, this is a high-quality contribution.

Comment on lines +309 to +312
std::time::SystemTime::now()
.duration_since(std::time::UNIX_EPOCH)
.expect("Correct timestamp")
.as_secs()

Choose a reason for hiding this comment

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

medium

The use of .expect() here could cause the service to panic if the system clock is set to a time before the UNIX epoch. While this is a rare condition, it's better to handle it gracefully in a long-running service. Consider using unwrap_or_default() to default to a duration of zero in this edge case. This would prevent a panic and simply result in a zero-latency metric for that event.

Suggested change
std::time::SystemTime::now()
.duration_since(std::time::UNIX_EPOCH)
.expect("Correct timestamp")
.as_secs()
std::time::SystemTime::now()
.duration_since(std::time::UNIX_EPOCH)
.unwrap_or_default()
.as_secs()

@ecol-master ecol-master force-pushed the kuzmindev/feat/rpc-metrics branch from dcab501 to b4e1cc1 Compare December 17, 2025 07:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

D8-ethexe ethexe-related PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants