Skip to content

Conversation

@jpraynaud
Copy link
Member

@jpraynaud jpraynaud commented Oct 13, 2025

Content

This PR includes the creation of a single ProtocolInitializer for a signer for each epoch, when a new one used to be created each time the signer was restarted.

Pre-submit checklist

  • Branch
    • Tests are provided (if possible)
    • Crates versions are updated (if relevant)
    • Commit sequence broadly makes sense
    • Key commits have useful messages
  • PR
    • All check jobs of the CI have succeeded
    • Self-reviewed the diff
    • Useful pull request description
    • Reviewer requested

Issue(s)

Closes #2424

@jpraynaud jpraynaud self-assigned this Oct 13, 2025
@jpraynaud jpraynaud requested a review from Copilot October 13, 2025 16:29
Copy link

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 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.

@jpraynaud jpraynaud force-pushed the jpraynaud/2424-unique-protocol-initializer-per-epoch branch 2 times, most recently from 236426a to f0bddcc Compare October 13, 2025 16:33
@github-actions
Copy link

github-actions bot commented Oct 13, 2025

Test Results

    4 files  ±0    168 suites  ±0   23m 5s ⏱️ -24s
2 228 tests +1  2 228 ✅ +1  0 💤 ±0  0 ❌ ±0 
6 881 runs  +2  6 881 ✅ +2  0 💤 ±0  0 ❌ ±0 

Results for commit 7c76a0d. ± Comparison against base commit 046a4f8.

♻️ This comment has been updated with latest results.

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`
@jpraynaud jpraynaud force-pushed the jpraynaud/2424-unique-protocol-initializer-per-epoch branch from f0bddcc to 7c76a0d Compare October 13, 2025 16:46
@jpraynaud jpraynaud marked this pull request as ready for review October 13, 2025 16:46
Copy link
Collaborator

@turmelclem turmelclem left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@jpraynaud jpraynaud merged commit effe078 into main Oct 14, 2025
41 of 45 checks passed
@jpraynaud jpraynaud deleted the jpraynaud/2424-unique-protocol-initializer-per-epoch branch October 14, 2025 13:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Mithril signer should have a unique protocol initializer for an epoch

4 participants