Skip to content

feat(coprocessor): add healthcheck to tx-sender#256

Merged
tawadaa merged 1 commit intomainfrom
aw/chore/healthcheck/tx-sender
Jun 13, 2025
Merged

feat(coprocessor): add healthcheck to tx-sender#256
tawadaa merged 1 commit intomainfrom
aw/chore/healthcheck/tx-sender

Conversation

@tawadaa
Copy link
Copy Markdown
Contributor

@tawadaa tawadaa commented Jun 13, 2025

No description provided.

@tawadaa tawadaa requested a review from Copilot June 13, 2025 08:24
Copy link
Copy Markdown
Contributor

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

Adds a health-check endpoint and underlying logic to the transaction-sender service, moves configuration into its own module, and updates dependencies to support HTTP routing.

  • Introduces HealthStatus and a health_check method on TransactionSender
  • Adds an Axum-based HTTP server with /healthz and /liveness routes
  • Extracts ConfigSettings into config.rs and bumps the crate version, adding new dependencies

Reviewed Changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
transaction_sender.rs Implemented health_check and imported HealthStatus
ops/mod.rs Extended Op trait with check_provider_connection
lib.rs & config.rs Extracted ConfigSettings; added HealthStatus
http_server.rs New HTTP server exposing health and liveness endpoints
Cargo.toml Bumped version; added Axum, Tower, Serde deps
Comments suppressed due to low confidence (3)

coprocessor/fhevm-engine/transaction-sender/src/http_server.rs:21

  • [nitpick] The status_code field is a String; consider using an integer type (e.g., u16) to better align with HTTP status codes and reduce parsing overhead.
status_code: String,

coprocessor/fhevm-engine/transaction-sender/src/transaction_sender.rs:174

  • Add more detailed doc comments describing what downstream errors or partial failures are captured by health_check, and how callers should interpret HealthStatus.details.
/// Checks the health of the transaction sender's connections

coprocessor/fhevm-engine/transaction-sender/src/transaction_sender.rs:175

  • There are no unit tests covering the new health_check logic; consider adding tests that simulate healthy/unhealthy database and blockchain scenarios.
pub async fn health_check(&self) -> HealthStatus {

Comment thread coprocessor/fhevm-engine/transaction-sender/src/transaction_sender.rs Outdated
Comment thread coprocessor/fhevm-engine/transaction-sender/src/ops/mod.rs Outdated
@tawadaa tawadaa marked this pull request as ready for review June 13, 2025 14:12
@tawadaa tawadaa force-pushed the aw/chore/healthcheck/tx-sender branch from 26b3617 to d886fe8 Compare June 13, 2025 16:41
Copy link
Copy Markdown
Collaborator

@antoniupop antoniupop left a comment

Choose a reason for hiding this comment

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

LGTM!

@tawadaa tawadaa merged commit 2cdeca5 into main Jun 13, 2025
54 checks passed
@tawadaa tawadaa deleted the aw/chore/healthcheck/tx-sender branch June 13, 2025 20:56
paulo-zama pushed a commit that referenced this pull request Mar 26, 2026
* chore: remove hardhat/contracts

This test suite has been migrated to fhecm-test-suite

* chore: deploy mocked contracts using only docker image

This feature is very useful and practical, using mocked contract
is now just a matter of choosing the correct version in the docker compose
file

* chore: clean Makefile with only relevant test

Hardhat test are obsolete now
A new script to test api has been added

* chore: update config file with mocked addresses

Also add a mock_mode option to disable readyness check for
user decrypt and public decrypt.

In mock mode, contracts are simplified so this check is not needed
and blocking (because allows and add ciphertext are missing)

* chore: use config options

Before private key was read by env, but now all the options
in config file could be defined (and have the priority over config file)
as env variable starting with APP_...

Example:
APP_TRANSACTION__PRIVATE_KEY_FHEVM_ENV=0x...
APP_TRANSACTION__PRIVATE_KEY_GATEWAY_ENV=0x...

* chore: use hard coded key

using same key as relayer triggered errors

TODO: use the key from a config file

* feat: add mock mode to disable readyness check

Bonus: use signature for input proof instead of manual hash

* feat: allow to have private key with or without 0x

* chore: add ability to pull private image

delete obsolete workflow, test image is now in fhevm-test-suite

* chore: update after rebase

* chore: update test workflow to also run api test

* chore: set privatekey for test against fhevm chain

* chore: build and run in background
 clean process + lint

* chore: update Makefile

* chore: add unit test for verifyProofRequest
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants