-
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
base: main
Are you sure you want to change the base?
Conversation
…natureProcessor' trait
Test Results 3 files ±0 57 suites ±0 11m 50s ⏱️ +18s Results for commit 1097177. ± Comparison against base commit 9df5a56. This pull request removes 9 and adds 12 tests. Note that renamed tests count towards both.
♻️ This comment has been updated with latest results. |
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?; } }
impl SignatureProcessor for SequentialSignatureProcessor { | ||
async fn process_signatures(&self) -> StdResult<()> { | ||
if *self.stop.lock().await { | ||
warn!(self.logger, "Stoped signature processor"); |
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.
There is a spelling mistake in the log message: "Stoped" should be corrected to "Stopped".
warn!(self.logger, "Stoped signature processor"); | |
warn!(self.logger, "Stopped signature processor"); |
Copilot uses AI. Check for mistakes.
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 👍
StdResult, | ||
}; | ||
|
||
/// A signature consumer which blocks until a messages are available. |
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.
/// A signature consumer which blocks until a messages are available. | |
/// A signature consumer which blocks until a message is available. |
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