Leios: add EB announcement diffusion (but don't otherwise leverage them yet) - #2132
Conversation
|
This PR is in draft for two reasons:
edit: PR IntersectMBO/typed-protocols#93 superseded IntersectMBO/typed-protocols#92 edit: these have been fixed, and this PR is no longer in draft |
nfrisby
left a comment
There was a problem hiding this comment.
Self review of everything except the LeiosDemoLogic diff---which is going to get a lot attention from reviewers.
| cardano-diffusion | ||
| network-mux | ||
|
|
||
| -- Points to nfrisby-antipipelining1 tag |
There was a problem hiding this comment.
93ef6c9 to
dcd5e97
Compare
…ges (#2142) - Payload is now Header blk instead of (). - Handler merely traces a message with the header's Point instead of throwing an error. This PR makes a tiny change that will allow use to run the much more significant patch in PR #2132 in the testnet without constant disconnections, which is desirable for validating that PR before merging it.
|
See https://github.com/input-output-hk/ouroboros-leios/pull/1005/changes#r3673377092 for normative text that scopes over this PR (and more) |
Prior to this commit, a peer that never sent MsgLeiosNotificationRequestNext would have caused a space leak: it's "subscription" TChans would have grown without bound. A different fix would have been to use a bounded queue, whose length is the maximum number of requests we'd allow from a peer before we sent any responses. That would be simpler, but this new "AntiPipelining" mechanism provides more precise back-pressure. Instead of constantly draining the TChans, it'd be preferable for them to not even exist as an intermediate buffer; that's a subsequent refinement.
…ation For example: don't validate RbHeader fields that are irrelevant to the EbAnnouncement (eg size of the body). Fixes a bug: the previous classification of header validation errors as tolerable-or-not was buggy, because Praos header validation short-circuits (TPraos does not short-circuit).
…ncement TraceSendRecv object
SlotBeforeImmutableTip already catches announcements that are too old to even validate. But we want even tighter restrictions than that, since stale announcements are unhelpful.
7ac5100 to
827e083
Compare
|
I rebased onto edit: I think https://github.com/IntersectMBO/cardano-node/tree/nfrisby/leios-introduce-announcements should be able to build using the new tip of this PR |
This PR relates to input-output-hk/ouroboros-leios#772 but doesn't close it.
I recommend reviewers start with these three modules---they're new, polymorphic, and entirely pure.
LeiosDemoLogic.AnnouncementsLeiosDemoLogic.Announcements.ElBimapLeiosDemoLogic.Announcements.Validate(not as polymorphic as those two, but stillblk-agnostic)The rest of this PR is for the most part arranging to call this core logic from the correct places---the major exception to that characterization is that some important logic is added in
LeiosDemoLogic---it's at least starting there instead of these three modules because is impure.