Skip to content

CIP-0164 | Leios Mini-Protocols - #1227

Draft
coot wants to merge 3 commits into
cardano-foundation:masterfrom
coot:coot/leios-clean-exit
Draft

CIP-0164 | Leios Mini-Protocols#1227
coot wants to merge 3 commits into
cardano-foundation:masterfrom
coot:coot/leios-clean-exit

Conversation

@coot

@coot coot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor
  • Edited the paragraph on protocol pipelining
  • Added three messages:
    • MsgLeiosNoBlockAnnouncement (LeiosAnnounce mini-protocol)
    • MsgLeiosNoVotes (LeiosVotes mini-protocol)
    • MsgLeiosBlockNoOffers (LeiosBlockNotify mini-protocol)
  • Split the mini-protocols IER table into four parts, one per mini-protocol.

coot added 2 commits July 10, 2026 13:51
Describe what protocol pipelining is rather than provide
a implementation design.  Protocol pipelining can be implemented in
number of ways, e.g. it can be single threaded, concurrent or a parallel
design is possible.
@coot
coot marked this pull request as draft July 10, 2026 12:50
@github-project-automation github-project-automation Bot moved this to In Progress in Ouroboros Network Jul 10, 2026
@rphair rphair changed the title Leios Mini-Protocols CIP-0164 | Leios Mini-Protocols Jul 10, 2026
@rphair rphair added Update Adds content or significantly reworks an existing proposal Category: Consensus Proposals belonging to the `Consensus` category. labels Jul 10, 2026
Comment thread CIP-0164/README.md
enough. To avoid unclean mini-protocol shutdown, `MsgLeiosNoBlockAnnouncement`
can be used, which gives back the agency to the client, which can decide
whether to continue the mini-protocol (e.g. further await for data
availability) or terminate the mini-protocol with `MsgDone`. The

@nfrisby nfrisby Jul 27, 2026

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.

The cardano-node implementation deactivation timeout is set to 300s.

Based on where that sentence occurs and the fact that I'm not familiar with the phrase "The cardano-node implementation deactivation timeout", my first interpretation was that you were suggesting 300s for the idle timer to cause the server to send MsgLeiosNoBlockAnnouncement.

I just CTRL-Fed and confirmed that "deactivation" only occurs in this paragraph.

Would you elaborate what the meaning of "The cardano-node implementation deactivation timeout" is, in order for the reader to understand that side of tradeoff this paragraph is highlighting? Maybe just bring the second-to-last sentence up to before this reference to it?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

If the outbound governor decides to demote the peer, then it signals each mini-protocol and if any of them is not finished within deactivation timeout (e.g. 300s), then the connection will be closed abruptly (non-clean shutdown). This gives a different outcome for Hot -> Warm demotion, since in the non-clean demotion the peer will end up as Cold rather than Warm.

Comment thread CIP-0164/README.md Outdated
`cardano-node` implementation deactivation timeout is set to `300s`. Note that
this timeout must still be preserved if the mini-protocol is pipelined, e.g. if
we pipeline five `MsgLeiosAnnounceRequestNext` messages, and we send
`MsgLeiosNoBlockAnnouncement` after `10s`, it will take the client exactly `50s`

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.

it will take the client exactly 50s to await for all the pipelined MsgLeiosAnnounceRequestNext replies to arrive before it will be able to send MsgDone

The typed-protocol EDSL forces the pipelined peer to have collected a response to all of its requests before it can terminate with the Done action.

But... what's stopping it from sending a pipelined MsgDone?

  • It sends N pipelined requests.
  • It receives signal to terminate.
  • It can't send MsgDone because the pipeline is full (max depth already reached).
  • As soon as one MsgLeiosNoBlockAnnouncement arrives, it can send MsgDone.
  • If the server has a LookAhead (see Add Lookahead, the dual to Pipelined IntersectMBO/typed-protocols#93), then the server can immediately react to that MsgDone by sending N-1 MsgLeiosNoBlockAnnouncements. (IE, basically cancelling the pipelined requests.)
  • Then both server and client can gracefully terminate---after exactly one server-side timeout (+ ~1 RTT).

What do you think?

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.

What do you think?

In particular, does this disarm the tradeoff the paragraph mentions?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Even if you pipeline MsgDone, you still need to collect all the results, including the result of sending MsgDone before you'll be able to use the Done constructor - so it's not allowed by construction.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I don't think we can pipeline MsgDone and terminate the protocol, while the other side is still sending requested responses. We still need to receive all the data from the sending peer, so that the mini-protocol can be restarted if the peer is re-promoted: demotions / promotions can happen multiple time within lifetime of a connection.

Since we have now 4 mini-protocols, it is clearer to have 4 IER tables:
one for each mini-protocol.
@coot
coot force-pushed the coot/leios-clean-exit branch from 50f5315 to 01c915e Compare August 25, 2026 14:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Category: Consensus Proposals belonging to the `Consensus` category. Update Adds content or significantly reworks an existing proposal

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants