-
Notifications
You must be signed in to change notification settings - Fork 90
cardano ping implemented with ouroboros-network #5205
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
531dbf6 to
9c8c962
Compare
9c8c962 to
150e48d
Compare
150e48d to
76feda7
Compare
8ab0ea9 to
3d9de76
Compare
487ab4a to
f7850ac
Compare
3d9de76 to
1425b60
Compare
| }] | ||
| race_ (Mx.run mx bearer) | ||
| (Mx.runMiniProtocol mx | ||
| NodeToNode.chainSyncMiniProtocolNum |
There was a problem hiding this comment.
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.
| -> TDigest 5 | ||
| -> KeepAlive.Cookie | ||
| -> KeepAliveClient IO () | ||
| keepAliveClient stdout peerName logFormat td0 cookie0 = |
There was a problem hiding this comment.
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.
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.
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.
1425b60 to
06bc667
Compare
Description
Rationale
This PR re-implements the ping command using
cardano-diffusionand moves itto
cardano-diffusionpackage aspingsublibrary. The library will notrequire changes when new node-to-{node,client} protocol versions are added, and
as a part of
cardano-diffusionit will be always released in lock withcardano-diffusionandouroboros-network. This should make it easier tomaintain it.
Requires: #5200
Checklist
Quality
Maintenance
ouroboros-networkproject.