Skip to content

Conversation

@goshawk-3
Copy link
Contributor

@goshawk-3 goshawk-3 commented Oct 16, 2025

fixes https://github.com/zama-ai/fhevm-internal/issues/453

Introduces a simple wrapper around database_url string that

  • ensures DATABASE_URL env is used when --database_url is not present
  • appends default application_name to the url for better observability
  • ensures application_name is the binary name, if not present.
  • Mask password on each display/debug print

@cla-bot cla-bot bot added the cla-signed label Oct 16, 2025
@goshawk-3 goshawk-3 marked this pull request as ready for review November 6, 2025 15:23
@goshawk-3 goshawk-3 requested a review from a team as a code owner November 6, 2025 15:23
@goshawk-3 goshawk-3 requested a review from Copilot November 6, 2025 15:25
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 introduces a DatabaseURL wrapper type to improve security and consistency of database URL handling across the codebase. The main purpose is to mask database credentials in logs and provide a centralized type for database URL operations.

  • Adds a new DatabaseURL type in fhevm-engine-common/src/utils.rs with password masking capabilities
  • Replaces String type with DatabaseURL for all database URL fields across multiple modules
  • Updates logging to use % (Display) instead of ? (Debug) for sensitive config structs

Reviewed Changes

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

Show a summary per file
File Description
coprocessor/fhevm-engine/fhevm-engine-common/src/utils.rs Introduces DatabaseURL wrapper with Display/Debug impls that mask passwords
coprocessor/fhevm-engine/zkproof-worker/src/lib.rs Updates Config.database_url to DatabaseURL type and adds Display impl
coprocessor/fhevm-engine/zkproof-worker/src/verifier.rs Changes logging format specifier from ? to % for config
coprocessor/fhevm-engine/sns-worker/src/lib.rs Updates DBConfig.url to DatabaseURL and removes custom Debug impl, changes logging
coprocessor/fhevm-engine/transaction-sender/src/config.rs Updates ConfigSettings.database_url to Option<DatabaseURL>
coprocessor/fhevm-engine/tfhe-worker/src/daemon_cli.rs Updates args to accept Option<DatabaseURL>
coprocessor/fhevm-engine/tfhe-worker/src/utils.rs Removes db_url() helper function (now handled by DatabaseURL::default())
coprocessor/fhevm-engine/test-harness/src/instance.rs Updates DBInstance.db_url field to be public DatabaseURL type
coprocessor/fhevm-engine/stress-test-generator/src/utils.rs Updates ACL contract address default value
Multiple test files Updates test code to use new DatabaseURL type with .into() conversions

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

Copy link
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 - 2 possibly mistaken inclusions in the PR

Copy link
Collaborator

@dartdart26 dartdart26 left a comment

Choose a reason for hiding this comment

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

Looks good!

@goshawk-3 goshawk-3 merged commit 696285b into main Nov 7, 2025
135 checks passed
@goshawk-3 goshawk-3 deleted the georgi/use-db-url branch November 7, 2025 09:46
goshawk-3 added a commit that referenced this pull request Nov 7, 2025
* chore(coprocessor): implement a DatabaseURL wrapper

* chore(coprocessor): use DatabaseURL in sns-worker

* chore(coprocessor): use DatabaseURL in zkproof-worker

* chore(coprocessor): use DatabaseURL in txn-sender

* chore(coprocessor): append default application-name to the db_url

* chore(coprocessor): use DatabaseURL across all services

* chore(coprocessor): add mask_database_url unit test

* chore(coprocessor): append always the default app_name
goshawk-3 added a commit that referenced this pull request Nov 7, 2025
* chore(coprocessor): implement a DatabaseURL wrapper

* chore(coprocessor): use DatabaseURL in sns-worker

* chore(coprocessor): use DatabaseURL in zkproof-worker

* chore(coprocessor): use DatabaseURL in txn-sender

* chore(coprocessor): append default application-name to the db_url

* chore(coprocessor): use DatabaseURL across all services

* chore(coprocessor): add mask_database_url unit test

* chore(coprocessor): append always the default app_name
goshawk-3 added a commit that referenced this pull request Nov 10, 2025
* chore(coprocessor): implement a DatabaseURL wrapper

* chore(coprocessor): use DatabaseURL in sns-worker

* chore(coprocessor): use DatabaseURL in zkproof-worker

* chore(coprocessor): use DatabaseURL in txn-sender

* chore(coprocessor): append default application-name to the db_url

* chore(coprocessor): use DatabaseURL across all services

* chore(coprocessor): add mask_database_url unit test

* chore(coprocessor): append always the default app_name
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