Skip to content

chore(kms-connector): simplify config parsing#1698

Merged
mergify[bot] merged 1 commit intomainfrom
eudlelins/chore/simplify-config
Jan 5, 2026
Merged

chore(kms-connector): simplify config parsing#1698
mergify[bot] merged 1 commit intomainfrom
eudlelins/chore/simplify-config

Conversation

@eudelins-zama
Copy link
Copy Markdown
Contributor

@eudelins-zama eudelins-zama commented Dec 31, 2025

Refacto of the config parsing.

Removed the RawConfig deserialization step which was then "parsed" into the final Config struct.
Now, the Config is directly deserialized and validated using serde_with annotation.
It avoids having to update multiple files when we want to add a new field in the config.

Copy link
Copy Markdown

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 refactors the configuration parsing system across the kms-connector components by consolidating the separate raw.rs and parsed.rs modules into single config.rs files, using Serde's derive macros for direct deserialization with custom deserializers for complex types.

Key changes:

  • Unified configuration parsing using Serde's #[derive(Deserialize)] with custom deserializers for ContractConfig and Duration types
  • Simplified KmsWallet by making the enum public (removing the inner wrapper)
  • Standardized duration configurations to use humantime_serde format
  • Changed monitoring endpoint default from String to SocketAddr type

Reviewed changes

Copilot reviewed 36 out of 42 changed files in this pull request and generated 11 comments.

Show a summary per file
File Description
kms-connector/crates/utils/src/config/ Removed raw.rs, added deserialize.rs trait; made contract module public; added PgInterval serialization helpers
kms-connector/crates/utils/src/config/wallet.rs Changed KmsWallet from struct with private enum to public enum
kms-connector/crates/utils/src/config/contract.rs Made RawContractConfig private; added custom deserializers and default functions for each contract type
kms-connector/crates/tx-sender/src/core/config.rs Consolidated raw+parsed into single config with Serde derives; moved wallet building to build_wallet() method
kms-connector/crates/kms-worker/src/core/config.rs Consolidated raw+parsed into single config with Serde derives
kms-connector/crates/gw-listener/src/core/config.rs Consolidated raw+parsed into single config with Serde derives
kms-connector/config/*.toml Updated comments to reflect humantime format; reorganized field order
kms-connector/Cargo.toml Updated config (0.15.15→0.15.19), serde (1.0.226→1.0.228), toml (0.9.5→0.9.8); added humantime-serde; removed tempfile
kms-connector/tests/ Removed entire integration test suite and Cargo.toml

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

@mergify
Copy link
Copy Markdown

mergify bot commented Dec 31, 2025

🧪 CI Insights

Here's what we observed from your CI run for 6e070c0.

🟢 All jobs passed!

But CI Insights is watching 👀

Copy link
Copy Markdown

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

Copilot reviewed 39 out of 45 changed files in this pull request and generated no new comments.


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

@eudelins-zama eudelins-zama marked this pull request as ready for review December 31, 2025 14:19
@eudelins-zama eudelins-zama requested review from a team and dartdart26 as code owners December 31, 2025 14:19
Copy link
Copy Markdown
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.

Nice!

@eudelins-zama
Copy link
Copy Markdown
Contributor Author

@Mergifyio queue

@mergify
Copy link
Copy Markdown

mergify bot commented Jan 5, 2026

queue

✅ The pull request has been merged automatically

Details

The pull request has been merged automatically at debc5ff

@mergify
Copy link
Copy Markdown

mergify bot commented Jan 5, 2026

Merge Queue Status

✅ The pull request has been merged at 6e070c0

This pull request spent 39 minutes 6 seconds in the queue, including 43 minutes 42 seconds running CI.
The checks were run on draft #1714.

Required conditions to merge

@mergify mergify bot added the queued label Jan 5, 2026
mergify bot added a commit that referenced this pull request Jan 5, 2026
mergify bot added a commit that referenced this pull request Jan 5, 2026
mergify bot added a commit that referenced this pull request Jan 5, 2026
@mergify mergify bot merged commit debc5ff into main Jan 5, 2026
75 checks passed
@mergify mergify bot deleted the eudlelins/chore/simplify-config branch January 5, 2026 12:56
@mergify mergify bot removed the queued label Jan 5, 2026
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.

3 participants