-
Notifications
You must be signed in to change notification settings - Fork 51
feat: use unique ProtocolInitializer per epoch in signer
#2739
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
feat: use unique ProtocolInitializer per epoch in signer
#2739
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 modifies the signer to maintain a unique ProtocolInitializer per epoch, preventing the creation of new initializers on each signer restart while ensuring the same one is used throughout the epoch's lifetime.
- Changed from "insert or replace" to "insert or ignore" database operations to prevent overwriting existing protocol initializers
- Added test coverage to verify protocol initializers are only created once per epoch and never updated
- Moved protocol initializer storage to occur before signer registration to ensure retrieval works correctly
Reviewed Changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| mithril-signer/src/runtime/runner.rs | Reorders protocol initializer storage before signer registration and adds retrieval logic |
| mithril-signer/src/database/tests/protocol_initializer.rs | Adds test to verify protocol initializers are created once per epoch and improves test data uniqueness |
| mithril-signer/src/database/repository/protocol_initializer_repository.rs | Changes from InsertOrReplace to InsertOrIgnore query to prevent overwriting |
| mithril-signer/src/database/query/protocol_initializer/insert_protocol_initializer.rs | Renames and updates query from "insert or replace" to "insert or ignore" |
| mithril-signer/Cargo.toml | Bumps version from 0.2.271 to 0.2.272 |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
236426a to
f0bddcc
Compare
This avoids creating multiple versions of the protocol initializer which is registered to the aggragator.
* mithril-signer from `0.2.271` to `0.2.272`
f0bddcc to
7c76a0d
Compare
turmelclem
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 👍
Content
This PR includes the creation of a single
ProtocolInitializerfor a signer for each epoch, when a new one used to be created each time the signer was restarted.Pre-submit checklist
Issue(s)
Closes #2424