Conversation
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Unresolved public API removals and the backup operator visibility issue must be addressed.
Get a fresh assessment by requesting another Copilot review.
Review effort: Lite
Findings: 1
Open (4)
What changed in this PR
This PR replaces single-implementor service traits with concrete KMS components and updates their wiring.
Changes:
- Replaces trait dispatch with inherent methods.
- Simplifies centralized and threshold KMS generics.
- Updates endpoints, tests, server setup, and architecture documentation.
| File | Summary |
|---|---|
core/service/src/engine/traits.rs |
Removes service traits, including public BaseKms and Kms APIs. |
core/service/src/engine/threshold/traits.rs |
Removes threshold service traits. |
core/service/src/engine/threshold/threshold_kms.rs |
Uses concrete threshold components. |
core/service/src/engine/threshold/service/user_decryptor.rs |
Converts decryptor methods to inherent methods. |
core/service/src/engine/threshold/service/public_decryptor.rs |
Converts decryptor methods to inherent methods. |
core/service/src/engine/threshold/service/preprocessor.rs |
Converts preprocessing methods to inherent methods. |
core/service/src/engine/threshold/service/mod.rs |
Adjusts service module visibility. |
core/service/src/engine/threshold/service/kms_impl.rs |
Removes the public RealThresholdKms alias. |
core/service/src/engine/threshold/service/key_generator.rs |
Converts key generation methods to inherent methods. |
core/service/src/engine/threshold/service/epoch_manager.rs |
Converts epoch methods to inherent methods. |
core/service/src/engine/threshold/service/crs_generator.rs |
Converts CRS methods to inherent methods. |
core/service/src/engine/threshold/mod.rs |
Removes the threshold traits module. |
core/service/src/engine/threshold/endpoint.rs |
Dispatches directly to concrete services. |
core/service/src/engine/centralized/service/preprocessing.rs |
Simplifies centralized service generics. |
core/service/src/engine/centralized/service/mod.rs |
Updates centralized test types. |
core/service/src/engine/centralized/service/key_gen.rs |
Simplifies key-generation service generics. |
core/service/src/engine/centralized/service/initiator.rs |
Simplifies initiator service generics. |
core/service/src/engine/centralized/service/decryption.rs |
Simplifies decryption service generics. |
core/service/src/engine/centralized/service/crs_gen.rs |
Simplifies CRS service generics. |
core/service/src/engine/centralized/endpoint.rs |
Simplifies the centralized endpoint implementation. |
core/service/src/engine/centralized/central_kms.rs |
Uses concrete components and removes the public RealCentralizedKms alias. |
core/service/src/engine/base.rs |
Removes obsolete base trait delegation. |
core/service/src/engine/backup_operator.rs |
Converts backup operations to inherent methods; public construction remains while operations are crate-private. |
core/service/src/client/tests/threshold/misc_tests.rs |
Updates threshold service type references. |
core/service/src/client/tests/centralized/misc_tests.rs |
Updates centralized service type references. |
core/service/src/client/test_tools.rs |
Updates test infrastructure types. |
core/service/src/bin/kms-server.rs |
Uses the concrete centralized KMS type. |
ai-docs/ARCHITECTURE.md |
Updates the centralized KMS reference. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Noticed that we have a series of traits that have a single implementor.
This PR removes 11 such traits:
EpochManager
UserDecryptor
PublicDecryptor
KeyGenerator
InsecureKeyGenerator
KeyGenPreprocessor
CrsGenerator
InsecureCrsGenerator
BackupOperator
BaseKms
Kms
This is a mechanical change, nothing exciting.
Git history says the traits were added to enable mocking in tests but the last such test was removed a year ago. This should be safe to do.