-
Notifications
You must be signed in to change notification settings - Fork 2.1k
chore(coprocessor): Improve usability of DatabaseURL #1082
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
fec7784 to
3a03ea4
Compare
There was a problem hiding this 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
DatabaseURLtype infhevm-engine-common/src/utils.rswith password masking capabilities - Replaces
Stringtype withDatabaseURLfor 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.
1eaae99 to
394aac1
Compare
antoniupop
left a comment
There was a problem hiding this 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
coprocessor/fhevm-engine/stress-test-generator/data/json/minitest_002_erc20.json
Outdated
Show resolved
Hide resolved
394aac1 to
8ea42e4
Compare
3238e30 to
2b984c7
Compare
dartdart26
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
* 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
* 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
* 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
fixes https://github.com/zama-ai/fhevm-internal/issues/453
Introduces a simple wrapper around database_url string that
--database_urlis not present