Skip to content

feat: enforce DMQ message id#3256

Merged
jpraynaud merged 3 commits into
mainfrom
jpraynaud/3251-enforce-dmq-message-id
May 6, 2026
Merged

feat: enforce DMQ message id#3256
jpraynaud merged 3 commits into
mainfrom
jpraynaud/3251-enforce-dmq-message-id

Conversation

@jpraynaud

@jpraynaud jpraynaud commented May 5, 2026

Copy link
Copy Markdown
Member

Content

This PR includes a new computation of the DMQ message id, enforcing the strict format specified in CIP-0137.

The message id is now computed as Blake2b_256(msg_body || expires_at.to_be_bytes()), replacing the previous Blake2b_512 digest that also incorporated kes_period.

Pre-submit checklist

  • Branch
    • Tests are provided (if possible)
    • Crates versions are updated (if relevant)
    • CHANGELOG file is 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)

Relates to #3251

jpraynaud added 3 commits May 5, 2026 18:20
Which follows the specification of CIP-0137.
* mithril-dmq from `0.1.23` to `0.1.24`
@jpraynaud jpraynaud self-assigned this May 5, 2026
Copilot AI review requested due to automatic review settings May 5, 2026 16:25

Copilot AI left a comment

Copy link
Copy Markdown

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 updates the DMQ message ID computation to enforce the strict CIP-0137 format by switching to a deterministic Blake2b_256(msg_body || expires_at.to_be_bytes()) digest (removing the previous inclusion of kes_period and changing the hash output size accordingly).

Changes:

  • Switched DMQ message ID hashing from Blake2b_512 (including kes_period) to Blake2b_256 over msg_body + big-endian expires_at.
  • Added a golden test vector to lock the message ID computation.
  • Bumped mithril-dmq crate version and documented the change in CHANGELOG.md.

Reviewed changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated 2 comments.

File Description
internal/mithril-dmq/src/model/builder.rs Updates message ID computation to CIP-0137 and adds a golden vector test.
internal/mithril-dmq/Cargo.toml Bumps mithril-dmq version to 0.1.24.
CHANGELOG.md Records the DMQ message ID format enforcement change.
Cargo.lock Updates lockfile for the mithril-dmq version bump.

Comment thread internal/mithril-dmq/src/model/builder.rs
Comment thread CHANGELOG.md
@github-actions

github-actions Bot commented May 5, 2026

Copy link
Copy Markdown

Test Results

     5 files     203 suites   50m 54s ⏱️
 2 951 tests  2 951 ✅ 0 💤 0 ❌
10 326 runs  10 326 ✅ 0 💤 0 ❌

Results for commit 600492c.

@jpraynaud
jpraynaud requested review from Alenar and turmelclem May 5, 2026 16:45
@jpraynaud
jpraynaud temporarily deployed to testing-preview May 5, 2026 17:12 — with GitHub Actions Inactive

@turmelclem turmelclem left a comment

Copy link
Copy Markdown
Contributor

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 0cc5648 into main May 6, 2026
93 of 95 checks passed
@jpraynaud
jpraynaud deleted the jpraynaud/3251-enforce-dmq-message-id branch May 6, 2026 12:42
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.

4 participants