-
Notifications
You must be signed in to change notification settings - Fork 44
Feat: implement a signature processor for DMQ #2477
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
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 implements a new signature processor for the DMQ in the aggregator, introducing new traits and implementations to continuously consume signatures and register them with the certifier service.
- Added the SignatureProcessor and SequentialSignatureProcessor to process signatures sequentially.
- Added a no-op SignatureConsumer implementation and integrated both components into dependency injection, launching the processor in a separate thread during serve.
Reviewed Changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
mithril-signer/src/services/signature_publisher/mod.rs | Renamed and re-exported signature publisher modules for clarity. |
mithril-aggregator/src/services/signature_processor.rs | Added a new trait and implementation for processing signatures sequentially, including tests. |
mithril-aggregator/src/services/signature_consumer/noop.rs | Introduced a no-op signature consumer that blocks indefinitely. |
mithril-aggregator/src/services/signature_consumer/interface.rs | Defined the signature consumer interface. |
mithril-aggregator/src/services/mod.rs | Updated module exports to include new signature consumer and processor. |
mithril-aggregator/src/dependency_injection/builder/enablers/misc.rs | Added dependency builder functions for signature consumer and processor. |
mithril-aggregator/src/commands/serve_command.rs | Integrated the signature processor into the serve command, running it in a separate thread and stopping it during shutdown. |
Comments suppressed due to low confidence (1)
mithril-aggregator/src/services/signature_processor.rs:18
- The run method continuously loops by calling process_signatures even after the stop flag is set. Consider modifying the loop to exit (e.g., using a break statement) when the stop condition is true.
async fn run(&self) -> StdResult<()> { loop { self.process_signatures().await?; } }
62bcf4f
to
1097177
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.
LGTM 👍
mithril-aggregator/src/services/signature_consumer/interface.rs
Outdated
Show resolved
Hide resolved
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
1097177
to
a1fadc3
Compare
a1fadc3
to
1f5055c
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 implements a signature processor for the DMQ in the aggregator, introducing new traits and implementations to continuously consume and process signatures.
- Introduces the SignatureProcessor trait and its sequential implementation in the aggregator.
- Adds the SignatureConsumer trait with a noop implementation until a DMQ consumer is available.
- Updates dependency injection and server shutdown signal handling to run the signature processor in a separate thread.
Reviewed Changes
Copilot reviewed 22 out of 22 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
mithril-signer/src/services/signature_publisher/mod.rs | Refactored module names and re-exports for signature publishing. |
mithril-signer/src/main.rs | Replaced oneshot channels with watch channels for shutdown signaling. |
mithril-signer/Cargo.toml | Bumped version to reflect minor changes. |
mithril-aggregator/src/services/signature_processor.rs | Added new signature processor trait and its sequential implementation. |
mithril-aggregator/src/services/signature_consumer/noop.rs | Added a no-op consumer that never returns signatures. |
mithril-aggregator/src/services/signature_consumer/fake.rs | Added a fake consumer implementation, along with tests for expected behavior. |
Dependency Injection Modules | Integrated stop signal channel and wired up the new signature processor in the DI builder. |
mithril-aggregator/src/commands/serve_command.rs | Updated server startup/shutdown to include signature processing and stop signals. |
internal/mithril-metric/src/server.rs | Updated shutdown signal handling for metrics server using watch channels. |
Cargo.toml and CHANGELOG.md | Updated versions and changelog to support the feature changes. |
…natureProcessor' trait
…gnatureConsumer' trait
And use a watch channel to be notified in the 'SequentialSignatureProcessor' implementation instead.
…reProcessor' In the 'serve' command of the aggregator.
* mithril-metric from `0.1.13` to `0.1.14` * mithril-aggregator from `0.7.50` to `0.7.51` * mithril-signer from `0.2.247` to `0.2.248`
1f5055c
to
d138a2b
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.
LGTM
Content
This PR includes the implementation of a signature processor for the DMQ in the aggregator:
SignatureProcessor
trait for continuously consuming signatures and registering them with the certifier serviceSequentialSignatureProcessor
implementation of theSignatureProcessor
traitSignatureConsumer
trait for receiving the signaturesSignatureConsumerNoop
implementation of theSignatureConsumer
trait (until the DMQ consumer is available)SignatureProcessor
in the dependency injectionSignatureProcessor
in a separate thread of the serve commandPre-submit checklist
Issue(s)
Closes #2470