Skip to content

Conversation

@coot
Copy link
Collaborator

@coot coot commented Oct 1, 2025

Description

Rationale

This PR re-implements the ping command using cardano-diffusion and moves it
to cardano-diffusion package as ping sublibrary. The library will not
require changes when new node-to-{node,client} protocol versions are added, and
as a part of cardano-diffusion it will be always released in lock with
cardano-diffusion and ouroboros-network. This should make it easier to
maintain it.

Requires: #5200

  • cardano-diffusion:ping - using ouroboros-network and cardano-diffusion
  • cardano-diffusion:ping - query tip over node-to-client protocol
  • cardano-diffusion:ping - stylish-haskell

Checklist

Quality

  • Commit sequence makes sense and have useful messages, see ref.
  • New tests are added and existing tests are updated.
  • Self-reviewed the PR.

Maintenance

  • Linked an issue or added the PR to the current sprint of ouroboros-network project.
  • Added labels.
  • Updated changelog files.
  • The documentation has been properly updated, see ref.

@coot coot requested review from a team as code owners October 1, 2025 10:36
@github-project-automation github-project-automation bot moved this to In Progress in Ouroboros Network Oct 1, 2025
@coot coot added technical debt cardano-ping Iessues / PRs related to cardano-ping labels Oct 1, 2025
@coot coot self-assigned this Oct 1, 2025
@coot coot changed the base branch from main to coot/packages October 1, 2025 10:44
@coot coot force-pushed the coot/cardano-ping branch 2 times, most recently from 531dbf6 to 9c8c962 Compare October 1, 2025 19:57
@coot coot force-pushed the coot/cardano-ping branch from 9c8c962 to 150e48d Compare October 7, 2025 13:25
@coot coot force-pushed the coot/cardano-ping branch from 150e48d to 76feda7 Compare October 8, 2025 09:06
@coot coot force-pushed the coot/cardano-ping branch 2 times, most recently from 8ab0ea9 to 3d9de76 Compare October 14, 2025 16:19
@coot coot force-pushed the coot/packages branch 2 times, most recently from 487ab4a to f7850ac Compare October 15, 2025 10:09
@coot coot force-pushed the coot/cardano-ping branch from 3d9de76 to 1425b60 Compare October 16, 2025 07:14
}]
race_ (Mx.run mx bearer)
(Mx.runMiniProtocol mx
NodeToNode.chainSyncMiniProtocolNum
Copy link
Contributor

Choose a reason for hiding this comment

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

It looks like you're using the wrong miniprotocol number here when running over NodeToClient.

@coot coot changed the base branch from coot/packages to main October 16, 2025 10:57
-> TDigest 5
-> KeepAlive.Cookie
-> KeepAliveClient IO ()
keepAliveClient stdout peerName logFormat td0 cookie0 =
Copy link
Contributor

Choose a reason for hiding this comment

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

There is a -c option for specifying how many keepAlive messages should be sent.
After that cardano-ping sends keepAliveDone and shuts down the connection cleanly.

You should implement that logic here.

coot added 5 commits October 16, 2025 13:31
Even though it's not implemented using `cardano-diffusion`, we often
need to release it together with `cardano-diffusion`.
The instantiation of `ChainSync` is polymorphic enough to support both
protocols.
coot added 6 commits October 16, 2025 13:31
We used to need to call `cborTermVersionDataCodec` to get
`VersionDataCodec` from `CodecCBORTerm`.

The `VersionDataCodec` and `cborTermVersionDataCodec` is moved to
`ouroboros-network:api` library (`Ouroboros.network.CodecCBORTerm`
module).

`cardano-diffusion` provides both `nodeToNodeVersionDataCodec` and
`nodeToClientVersionDataCodec`.

This required a refactorisation in tests to get rid of some newtype
wrappers, however the semantics of all the tests is preserved.
The tests started to fail due to usage of version data codec which
doesn't satisfy round robin property on invalid version data in the
previous commit.
Exposed `nodeTo{Node,Client}VersionDataCodec` instead.
@coot coot force-pushed the coot/cardano-ping branch from 1425b60 to 06bc667 Compare October 16, 2025 11:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cardano-ping Iessues / PRs related to cardano-ping technical debt

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

2 participants