Skip to content

Conversation

@tbagrel1
Copy link
Contributor

@tbagrel1 tbagrel1 commented Sep 12, 2025

This pull request introduces support for the ObjectDiffusion mini-protocol, required for Peras (for certificates and votes diffusion). It also plugs the PerasCertDiffusion (instance of ObjectDiffusion) mini-protocol in the networking layer.

This PR depends on an updated version of ouroboros-network, see IntersectMBO/ouroboros-network#5202 and https://github.com/IntersectMBO/ouroboros-network/tree/peras-staging/pr-5202-v2


Peras ObjectDiffusion Mini-protocol:

  • Added modules Ouroboros.Consensus.MiniProtocol.ObjectDiffusion{.Inbound,.Outbound} with implementations of the ObjectDiffusion protocol (quite similar/inspired from TX-submission, except that client = inbound, server = outbound)
  • Added module Ouroboros.Consensus.MiniProtocol.ObjectDiffusion.ObjectPool.API defining ObjectPool{Reader,Writer} interfaces, through which ObjectDiffusion accesses/stores the objects to send/that have been received.
  • Added modules Ouroboros.Consensus.MiniProtocol.ObjectDiffusion.PerasCert and Ouroboros.Consensus.MiniProtocol.ObjectDiffusion.ObjectPool.PerasCert containing definitions specific to PerasCert diffusion through the ObjectDiffusion mini-protocol
  • Modifies Ouroboros.Consensus.Node.Serialisation to add CBOR serialisation (SerialiseNodeToNode) for Point blk, Tip blk, and PerasCert blk
  • Modifies Ouroboros.Consensus{.Node,.Node.Tracer,.Network.NodeToNode} to wire-in PerasCertDiffusion similarly to other mini-protocols (e.g. TX-submission)
  • Propagate feature flags down to NodeKernelArgs (see Propagate feature flags down to NodeKernelArgs #1706)

Tests and benchmarks

  • Added module Test.Consensus.MiniProtocol.ObjectDiffusion.Smoke with smoke test for the general ObjectDiffusion mini-protocol (using mock objects)

  • Added module Test.Consensus.MiniProtocol.ObjectDiffusion.PerasCert.Smoke with smoke test specific to PerasCert diffusion through ObjectDiffusion

  • Updates Test.ThreadNet.Network in unstable-diffusion-testlib accordingly to the changes made in Ouroboros.Consensus.Network.NodeToNode


Network Protocol Version Updates:

@tbagrel1 tbagrel1 changed the base branch from main to main-pr/weighted-chain-selec September 12, 2025 13:09
@tbagrel1 tbagrel1 changed the title Add ObjectDiffusion and PerasCert diffusion (instace of ObjectDiffusion) Add ObjectDiffusion and PerasCert diffusion (instance of ObjectDiffusion) Sep 12, 2025
@tbagrel1 tbagrel1 added the Peras label Sep 12, 2025
@tbagrel1 tbagrel1 changed the title Add ObjectDiffusion and PerasCert diffusion (instance of ObjectDiffusion) [Peras #4] Add ObjectDiffusion and PerasCert diffusion (instance of ObjectDiffusion) Sep 12, 2025
@tbagrel1 tbagrel1 force-pushed the main-pr/object-diffusion branch from 80d3c69 to f88b3ae Compare September 12, 2025 14:32
@tbagrel1 tbagrel1 force-pushed the main-pr/weighted-chain-selec branch 6 times, most recently from dca0315 to d7c3c64 Compare September 18, 2025 08:47
@tbagrel1 tbagrel1 force-pushed the main-pr/object-diffusion branch 3 times, most recently from 37a9f85 to 222f4be Compare September 18, 2025 09:25
@tbagrel1 tbagrel1 force-pushed the main-pr/weighted-chain-selec branch from d7c3c64 to f1158c0 Compare September 19, 2025 07:58
@tbagrel1 tbagrel1 force-pushed the main-pr/object-diffusion branch from 222f4be to d47c331 Compare September 19, 2025 08:04
@tbagrel1 tbagrel1 changed the title [Peras #4] Add ObjectDiffusion and PerasCert diffusion (instance of ObjectDiffusion) [Peras 4] Add ObjectDiffusion and PerasCert diffusion (instance of ObjectDiffusion) Sep 25, 2025
@tbagrel1 tbagrel1 force-pushed the main-pr/object-diffusion branch from d47c331 to 918307c Compare September 26, 2025 13:47
@amesgen amesgen force-pushed the main-pr/weighted-chain-selec branch from f1158c0 to 90131b2 Compare October 2, 2025 19:01
@amesgen amesgen force-pushed the main-pr/weighted-chain-selec branch 4 times, most recently from 8aba6fc to 8b987f6 Compare October 10, 2025 16:57
@amesgen amesgen force-pushed the main-pr/weighted-chain-selec branch from 328b50a to 1018f6e Compare October 20, 2025 15:25
@tbagrel1 tbagrel1 force-pushed the main-pr/object-diffusion branch 2 times, most recently from f8083cc to 8a88eb7 Compare October 20, 2025 17:24
Copy link
Contributor

@agustinmista agustinmista left a comment

Choose a reason for hiding this comment

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

LGTM, minor comments only.

Base automatically changed from main-pr/weighted-chain-selec to main October 21, 2025 10:03
@tbagrel1
Copy link
Contributor Author

@amesgen TX-submission V1 had initially hidden a "ensure no thunk" logic in the continueWithState__ helpers. I tried to keep it in this new version (thinking it was important) with checkState st & go___ lines, but:

  1. I'm not sure exactly why we need that here
  2. I'm not sure my attempt at replicating it is working as intended
    Could you please confirm whether or not we should keep/modify that?

Also use defaultMiniProtocolParameters instead of hardcoded value in unstable-diffusion-testlib
to account for newly defined parameters in the new `ouroboros-network`
version.
Also integrate `NodeToNodeV_16`.

Co-authored-by: Agustin Mista <[email protected]>
Co-authored-by: Alexander Esgen <[email protected]>
Co-authored-by: Georgy Lukyanov <[email protected]>
Co-authored-by: Thomas BAGREL <[email protected]>
Co-authored-by: Nicolas BACQUEY <[email protected]>
Co-authored-by: Nicolas "Niols" Jeannerod <[email protected]>
@tbagrel1 tbagrel1 force-pushed the main-pr/object-diffusion branch from 8a88eb7 to d9c165b Compare October 22, 2025 08:23
@tbagrel1
Copy link
Contributor Author

I think I have adressed all comments from @agustinmista and @amesgen,I guess we are ready for a client review now?

tbagrel1 and others added 7 commits October 22, 2025 13:18
…eader,Writer}` API

Co-authored-by: Agustin Mista <[email protected]>
Co-authored-by: Alexander Esgen <[email protected]>
Co-authored-by: Georgy Lukyanov <[email protected]>
Co-authored-by: Thomas BAGREL <[email protected]>
Co-authored-by: Nicolas BACQUEY <[email protected]>
Co-authored-by: Nicolas "Niols" Jeannerod <[email protected]>
Co-authored-by: Agustin Mista <[email protected]>
Co-authored-by: Alexander Esgen <[email protected]>
Co-authored-by: Georgy Lukyanov <[email protected]>
Co-authored-by: Thomas BAGREL <[email protected]>
Co-authored-by: Nicolas BACQUEY <[email protected]>
Co-authored-by: Nicolas "Niols" Jeannerod <[email protected]>
…fusion

Co-authored-by: Agustin Mista <[email protected]>
Co-authored-by: Alexander Esgen <[email protected]>
Co-authored-by: Georgy Lukyanov <[email protected]>
Co-authored-by: Thomas BAGREL <[email protected]>
Co-authored-by: Nicolas BACQUEY <[email protected]>
Co-authored-by: Nicolas "Niols" Jeannerod <[email protected]>
Co-authored-by: Agustin Mista <[email protected]>
Co-authored-by: Alexander Esgen <[email protected]>
Co-authored-by: Georgy Lukyanov <[email protected]>
Co-authored-by: Thomas BAGREL <[email protected]>
Co-authored-by: Nicolas BACQUEY <[email protected]>
Co-authored-by: Nicolas "Niols" Jeannerod <[email protected]>
Co-authored-by: Agustin Mista <[email protected]>
Co-authored-by: Alexander Esgen <[email protected]>
Co-authored-by: Georgy Lukyanov <[email protected]>
Co-authored-by: Thomas BAGREL <[email protected]>
Co-authored-by: Nicolas BACQUEY <[email protected]>
Co-authored-by: Nicolas "Niols" Jeannerod <[email protected]>
Brings in cardano-base and propagates a set of `CardanoFeatureFlag`s
from the top-level `RunNodeArgs` down to the `NodeKernelArgs`.

This is currently needed by an upcoming PR to the GSM to distinguish
whether having an established PerasCertDiffusion connection with a given
peer is necessary or not when trying to decide if such peer is idling.
Co-authored-by: Agustin Mista <[email protected]>
Co-authored-by: Alexander Esgen <[email protected]>
Co-authored-by: Georgy Lukyanov <[email protected]>
Co-authored-by: Thomas BAGREL <[email protected]>
Co-authored-by: Nicolas BACQUEY <[email protected]>
Co-authored-by: Nicolas "Niols" Jeannerod <[email protected]>
@tbagrel1 tbagrel1 force-pushed the main-pr/object-diffusion branch from d9c165b to bef68f5 Compare October 22, 2025 11:20
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.

3 participants