Skip to content
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

coot/cardano ping #3204

Merged
merged 2 commits into from
Jun 10, 2021
Merged

coot/cardano ping #3204

merged 2 commits into from
Jun 10, 2021

Conversation

coot
Copy link
Contributor

@coot coot commented Jun 10, 2021

  • Add support for V7 keepalive
  • cardano-ping: adhare to keep alive protocol

@coot coot requested a review from karknu as a code owner June 10, 2021 10:53
@coot coot added networking cardano-ping Iessues / PRs related to cardano-ping labels Jun 10, 2021
Comment on lines 225 to 229
keepAliveDone :: ByteString
keepAliveDone =
CBOR.toLazyByteString $
CBOR.encodeListLen 1
<> CBOR.encodeWord 2
Copy link
Contributor

Choose a reason for hiding this comment

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

You should cover the pre v7 version of the protocol too.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Note the shortcoming of the approach of integration of version and version data: we need to pattern match on the version number: when we will add v8 for node-to-node the cardano-ping will break if one forgets to update the encoder.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I pushed one more commit to fix this.

* send terminating message (`MsgDone`),
* add 5 sec protocol idle timeout, this allows for a clean connection
  termination.
Instead of pattern matching on a version use the `Ord` instance, though
it is a bit artificial to use `NodeToNodeVersionV7 minBound minBound`.
Copy link
Contributor

@karknu karknu left a comment

Choose a reason for hiding this comment

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

LGTM

@coot
Copy link
Contributor Author

coot commented Jun 10, 2021

bors merge

@iohk-bors
Copy link
Contributor

iohk-bors bot commented Jun 10, 2021

@iohk-bors iohk-bors bot merged commit 801b88a into master Jun 10, 2021
@iohk-bors iohk-bors bot deleted the coot/cardano-ping branch June 10, 2021 15:45
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants