Skip to content

Conversation

@eudelins-zama
Copy link
Contributor

@eudelins-zama eudelins-zama commented Oct 6, 2025

Closes https://github.com/zama-ai/kms-internal/issues/2751

Also adjust the tooling to the 0.9.0 fhevm release.

The CLI now offers 4 commands:

  • gw: stress testing by sending decryption requests to the Gateway chain
  • bench-gw: benchmarking decryption by sending decryption requests to the Gateway chain
  • db: stress testing by inserting decryption requests directly to the Connectors' DBs
  • bench-gw: benchmarking decryption by inserting decryption requests directly to the Connectors' DBs

Run example:

$ cargo run -- -c config/config.toml -p 100 -d "10s" -i "1s"  db -t public
   Compiling gateway-stress v0.9.0 (/home/simon/Work/fhevm-bench/test-suite/gateway-stress)
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 6.23s
     Running `target/debug/gateway-stress -c config/config.toml -p 100 -d 10s -i 1s db -t public`
2025-10-06T14:04:39.754724Z  INFO gateway_stress::db::manager: Connecting to 1 connectors' database...
2025-10-06T14:04:39.782417Z  INFO gateway_stress::db::manager: All databases health check were successful!
2025-10-06T14:04:39.782449Z  INFO gateway_stress::db::manager: Clearing database tables...
2025-10-06T14:04:39.813641Z  INFO gateway_stress::db::manager: All databases tables were cleared successfully!
2025-10-06T14:04:39.815339Z  INFO handle_burst{burst_index=1}: gateway_stress::db::manager: Starting requests burst (PublicDecryptionRequest)...
2025-10-06T14:04:40.546629Z  INFO handle_burst{burst_index=1}: gateway_stress::db::manager: Burst successfully processed by all connectors! latency=0.415899 throughput=240.44299216877172
2025-10-06T14:04:40.818604Z  INFO handle_burst{burst_index=2}: gateway_stress::db::manager: Starting requests burst (PublicDecryptionRequest)...
2025-10-06T14:04:41.357659Z  INFO handle_burst{burst_index=2}: gateway_stress::db::manager: Burst successfully processed by all connectors! latency=0.224891 throughput=444.6598574420497
2025-10-06T14:04:41.816531Z  INFO handle_burst{burst_index=3}: gateway_stress::db::manager: Starting requests burst (PublicDecryptionRequest)...
2025-10-06T14:04:42.618569Z  INFO handle_burst{burst_index=3}: gateway_stress::db::manager: Burst successfully processed by all connectors! latency=0.510243 throughput=195.98505026036614
2025-10-06T14:04:42.815946Z  INFO handle_burst{burst_index=4}: gateway_stress::db::manager: Starting requests burst (PublicDecryptionRequest)...
2025-10-06T14:04:43.816609Z  INFO handle_burst{burst_index=5}: gateway_stress::db::manager: Starting requests burst (PublicDecryptionRequest)...
2025-10-06T14:04:43.916060Z  INFO handle_burst{burst_index=4}: gateway_stress::db::manager: Burst successfully processed by all connectors! latency=0.733397 throughput=136.35179854839876
2025-10-06T14:04:44.421701Z  INFO handle_burst{burst_index=5}: gateway_stress::db::manager: Burst successfully processed by all connectors! latency=0.214919 throughput=465.2915749654521
2025-10-06T14:04:44.816387Z  INFO handle_burst{burst_index=6}: gateway_stress::db::manager: Starting requests burst (PublicDecryptionRequest)...
2025-10-06T14:04:45.372266Z  INFO handle_burst{burst_index=6}: gateway_stress::db::manager: Burst successfully processed by all connectors! latency=0.184209 throughput=542.8616408535956
2025-10-06T14:04:45.816207Z  INFO handle_burst{burst_index=7}: gateway_stress::db::manager: Starting requests burst (PublicDecryptionRequest)...
2025-10-06T14:04:46.368331Z  INFO handle_burst{burst_index=7}: gateway_stress::db::manager: Burst successfully processed by all connectors! latency=0.218585 throughput=457.4879337557472
2025-10-06T14:04:46.815634Z  INFO handle_burst{burst_index=8}: gateway_stress::db::manager: Starting requests burst (PublicDecryptionRequest)...
2025-10-06T14:04:47.390249Z  INFO handle_burst{burst_index=8}: gateway_stress::db::manager: Burst successfully processed by all connectors! latency=0.316167 throughput=316.2885437126582
2025-10-06T14:04:47.816827Z  INFO handle_burst{burst_index=9}: gateway_stress::db::manager: Starting requests burst (PublicDecryptionRequest)...
2025-10-06T14:04:48.545086Z  INFO handle_burst{burst_index=9}: gateway_stress::db::manager: Burst successfully processed by all connectors! latency=0.422424 throughput=236.72897373255307
2025-10-06T14:04:48.816420Z  INFO handle_burst{burst_index=10}: gateway_stress::db::manager: Starting requests burst (PublicDecryptionRequest)...
2025-10-06T14:04:49.409138Z  INFO handle_burst{burst_index=10}: gateway_stress::db::manager: Burst successfully processed by all connectors! latency=0.243756 throughput=410.24631188565616
2025-10-06T14:04:49.815235Z  INFO gateway_stress::db::manager: Handled all burst in 10.00s. Throughput: 99.99 tps
2025-10-06T14:04:49.815334Z  INFO gateway_stress::db::manager: Clearing database tables...
2025-10-06T14:04:49.823526Z  INFO gateway_stress::db::manager: All databases tables were cleared successfully!

@eudelins-zama eudelins-zama requested a review from Copilot October 6, 2025 12:56
@cla-bot cla-bot bot added the cla-signed label Oct 6, 2025
Copy link

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 PR expands the gateway stress testing tool to support stress testing via database connections in addition to the existing Gateway chain approach. It updates the tooling to work with fhevm v0.9.0 and restructures the CLI to offer four distinct commands for both stress testing and benchmarking through either Gateway chain or direct database operations.

Key changes include:

  • Added database stress testing functionality by inserting decryption requests directly into Connectors' databases
  • Updated from fhevm v0.8.0 to v0.9.0 with corresponding API changes
  • Restructured CLI with four commands: gw, bench-gw, db, and bench-db

Reviewed Changes

Copilot reviewed 24 out of 33 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
test-suite/gateway-stress/src/main.rs Updated main entry point to support new CLI structure and database testing modes
test-suite/gateway-stress/src/cli.rs Completely restructured CLI with new subcommands and argument parsing
test-suite/gateway-stress/src/config.rs Reorganized config structure to support both blockchain and database configurations
test-suite/gateway-stress/src/db/ New module implementing database stress testing functionality
test-suite/gateway-stress/src/decryption/ Updated to support fhevm v0.9.0 API changes and added shared types
test-suite/gateway-stress/src/blockchain/ Refactored existing blockchain functionality into dedicated manager
test-suite/gateway-stress/Cargo.toml Updated dependencies to fhevm v0.9.0 and added database dependencies
Files not reviewed (7)
  • test-suite/gateway-stress/.sqlx/query-2f49a66126dda8f3e5f043ad8fa119691568ca3216e1a04715aa02322bf3723d.json: Language not supported
  • test-suite/gateway-stress/.sqlx/query-6007239279928f6691a5284666e99fb6f020f20264c157500dbad47d7ec3dfa9.json: Language not supported
  • test-suite/gateway-stress/.sqlx/query-6471556ae0071cc8896a01ad0f2f350416bf00d6d617422422f2368f5ec7c826.json: Language not supported
  • test-suite/gateway-stress/.sqlx/query-7eb5ee37fa8e57c641712b895a5f59e0c484429e78626ccd5ad8b6d55a12267b.json: Language not supported
  • test-suite/gateway-stress/.sqlx/query-a9ac11a0896006a03fd4260810c31bf236ebe89054f4c7e981490c596799585b.json: Language not supported
  • test-suite/gateway-stress/.sqlx/query-affa510bdee616839e36215c598d07a20ca7af56c37fca94c0c1759dc2eba8ea.json: Language not supported
  • test-suite/gateway-stress/.sqlx/query-d6597f8cda1d06ba8a5adedc650047a8646bfa1f3c666f2cf0f29257268b3542.json: Language not supported

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@eudelins-zama eudelins-zama marked this pull request as ready for review October 6, 2025 13:49
@eudelins-zama eudelins-zama force-pushed the simon/feat/db-connector-stress-test branch from ed0c8c1 to 8df0b68 Compare October 10, 2025 16:09
@eudelins-zama eudelins-zama force-pushed the simon/feat/db-connector-stress-test branch from ce1b29e to 9e255be Compare October 21, 2025 07:34
@eudelins-zama eudelins-zama merged commit 4a0c8ca into main Oct 21, 2025
99 checks passed
@eudelins-zama eudelins-zama deleted the simon/feat/db-connector-stress-test branch October 21, 2025 08:58
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.

2 participants