Skip to content

Renumber the Leios mini-protocol messages from zero, without gaps - #2363

Merged
ch1bo merged 1 commit into
nfrisby/LeiosNotify-graceful-shutdownfrom
ch1bo/leios-protocol-message-indices
Oct 9, 2026
Merged

ch1bo merged 1 commit into
nfrisby/LeiosNotify-graceful-shutdownfrom
ch1bo/leios-protocol-message-indices

Conversation

@ch1bo

@ch1bo ch1bo commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Both protocols had holes. LeiosNotify ran 0-7 only because MsgQuit and MsgCanceled were appended after MsgDone; LeiosFetch used 0-3 and then 9, with 6-8 held for batch messages that were never built.
Each now numbers from zero contiguously, ordered so the numbering says something. Termination comes first in both. Then, in LeiosNotify, the request and the responses it can draw, with votes last so that moving them to a votes mini-protocol later costs no renumbering. In LeiosFetch, each request sits beside the reply it draws.
The commented-out batch and vote placeholders go with them: never implemented, and no longer planned.
This is a wire-format change on both mini-protocols, so every node has to adopt it together.

This is purely cosmetic and just fits as we are changing the
mini-protocols for a good reason anyways.

@ch1bo
ch1bo added this pull request to stack #2364 October 5, 2026 12:28
@ch1bo
ch1bo requested a review from nfrisby October 5, 2026 12:28

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

I'm Approving because my concerns aren't about the logic, just the comments.

But please do address the flagged comments, the PR description, and the git commit message too before merging.

ordered so the numbering says something

In my experience, this ordering can't really have meaning, over the long-term. When we add messages to mini protocols, we simply allocate the next tag number. That's the simplest way to avoid unnecessarily spoiling backwards-compatibility/excessive version-based conditionals/messy codec impls/etc.

So I hesitate to emphasize the order. Even this PR on seems like unnecessary tidying to me: ultimately, no one should actually care about the tag numbers other than them being unique and we can't promise those numbers will be "nice and meaningful" forever (without obligating the devs/codecs to unnecessary versioning dances).

But: I don't object to this PR, it's harmless on the testnet and it is pleasant/beneficial for the first iteration to avoid surprises (eg nonsense tags). My only objection is the PR description and a few small comments claiming that some order is particularly useful/appropriate.

Comment thread ouroboros-consensus/src/ouroboros-consensus/LeiosDemoOnlyTestFetch.hs Outdated
Comment thread ouroboros-consensus/src/ouroboros-consensus/LeiosDemoOnlyTestNotify.hs Outdated
Comment thread ouroboros-consensus/src/ouroboros-consensus/LeiosDemoOnlyTestNotify.hs Outdated
@ch1bo
ch1bo force-pushed the ch1bo/leios-protocol-message-indices branch from ea318bf to 9f4b563 Compare October 5, 2026 19:12
@ch1bo ch1bo added the Leios label Oct 5, 2026
@ch1bo
ch1bo force-pushed the ch1bo/leios-protocol-message-indices branch from 9f4b563 to 3cea3a5 Compare October 5, 2026 20:08
@ch1bo
ch1bo force-pushed the ch1bo/leios-protocol-message-indices branch 2 times, most recently from 9d9d05a to 27e0cb3 Compare October 9, 2026 21:09
@ch1bo
ch1bo removed this pull request from stack #2364 October 9, 2026 21:10
@ch1bo
ch1bo added this pull request to stack #2398 October 9, 2026 21:10
This is purely cosmetic and just fits as we are changing the
mini-protocols for a good reason anyways.
@ch1bo
ch1bo force-pushed the ch1bo/leios-protocol-message-indices branch from 27e0cb3 to c54515e Compare October 9, 2026 21:52
@ch1bo
ch1bo merged commit ef4aa80 into leios-prototype Oct 9, 2026
2 of 13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants