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

Use handshake for connection checking when starting cardano-testnet #5536

Merged

Conversation

carbolymer
Copy link
Contributor

@carbolymer carbolymer commented Nov 7, 2023

Description

This PR changes how cardano-testnet executable checks for node start:

  • Remove blind wait for 5s
  • Add wait for socket with 20s timeout
  • After ping socket appears, ping the and node fail on any ping error - use NodeToClientVersion configuration from cardano-ping.

This PR depends on:

To be merged after new cardano-ping release and without SRP.

Checklist

  • Commit sequence broadly makes sense and commits have useful messages
  • New tests are added if needed and existing tests are updated. These may include:
    • golden tests
    • property tests
    • roundtrip tests
    • integration tests
      See Runnings tests for more details
  • Any changes are noted in the CHANGELOG.md for affected package
  • The version bounds in .cabal files are updated
  • CI passes. See note on CI. The following CI checks are required:
    • Code is linted with hlint. See .github/workflows/check-hlint.yml to get the hlint version
    • Code is formatted with stylish-haskell. See .github/workflows/stylish-haskell.yml to get the stylish-haskell version
    • Code builds on Linux, MacOS and Windows for ghc-8.10.7 and ghc-9.2.7
  • Self-reviewed the diff

Note on CI

If your PR is from a fork, the necessary CI jobs won't trigger automatically for security reasons.
You will need to get someone with write privileges. Please contact IOG node developers to do this
for you.

@carbolymer carbolymer force-pushed the mgalazyn/feature/use-handshake-when-starting-testnet branch 2 times, most recently from 64c2da2 to 77ad7f8 Compare November 23, 2023 18:40
@carbolymer carbolymer force-pushed the mgalazyn/feature/use-handshake-when-starting-testnet branch from 77ad7f8 to 5709c8e Compare November 29, 2023 14:10
@smelc
Copy link
Contributor

smelc commented Nov 30, 2023

@carbolymer> please ping me for review when it's ready, I know the ping code a bit already.

@carbolymer carbolymer force-pushed the mgalazyn/feature/use-handshake-when-starting-testnet branch 6 times, most recently from da6a4c6 to 642858d Compare December 7, 2023 10:48
cabal.project Outdated
@@ -60,3 +60,10 @@ package plutus-scripts-bench
-- temporary! Please read the section in CONTRIBUTING about updating dependencies.

-- `smtp-mail` should depend on `crypton-connection` rather than `connection`!

source-repository-package
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This PR requires new cardano-ping release with: https://github.com/input-output-hk/ouroboros-network/pull/4743/files

@carbolymer carbolymer force-pushed the mgalazyn/feature/use-handshake-when-starting-testnet branch 5 times, most recently from 9958beb to 0f58174 Compare December 7, 2023 11:14
doHandshakeQuery = True

-- | Ping the node once
pingNode :: TestnetMagic -- ^ testnet magic
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is a gutted-out pingClient from cardano-ping. One alternative to this would be to refactor cardano-ping to not print directly to stdout and use it here.

@carbolymer carbolymer marked this pull request as ready for review December 7, 2023 11:19
@carbolymer carbolymer force-pushed the mgalazyn/feature/use-handshake-when-starting-testnet branch from 0f58174 to 3be7df4 Compare December 7, 2023 11:27
Copy link
Contributor

@Jimbo4350 Jimbo4350 left a comment

Choose a reason for hiding this comment

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

Looking good but a couple minor changes.

cardano-testnet/src/Testnet/Ping.hs Show resolved Hide resolved
cardano-testnet/src/Testnet/Ping.hs Show resolved Hide resolved
cardano-testnet/src/Testnet/Ping.hs Show resolved Hide resolved
@coot coot self-requested a review December 7, 2023 14:52
@carbolymer carbolymer force-pushed the mgalazyn/feature/use-handshake-when-starting-testnet branch from bce7d17 to eae1d08 Compare December 8, 2023 11:11
@newhoggy newhoggy force-pushed the mgalazyn/feature/use-handshake-when-starting-testnet branch from dc2de5e to 0d2d6d7 Compare December 9, 2023 23:03
@carbolymer carbolymer force-pushed the mgalazyn/feature/use-handshake-when-starting-testnet branch 4 times, most recently from 38db71f to f5ff4ab Compare December 12, 2023 10:06
cardano-testnet/src/Testnet/Ping.hs Outdated Show resolved Hide resolved
cardano-testnet/src/Testnet/Ping.hs Outdated Show resolved Hide resolved
cardano-testnet/src/Testnet/Ping.hs Outdated Show resolved Hide resolved
Copy link
Contributor

@Jimbo4350 Jimbo4350 left a comment

Choose a reason for hiding this comment

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

Nice work 👍

cardano-testnet/src/Testnet/Ping.hs Show resolved Hide resolved
@carbolymer carbolymer force-pushed the mgalazyn/feature/use-handshake-when-starting-testnet branch 2 times, most recently from c4768e9 to 2c9e515 Compare December 12, 2023 15:58
@carbolymer carbolymer force-pushed the mgalazyn/feature/use-handshake-when-starting-testnet branch 11 times, most recently from e432901 to b060b38 Compare December 15, 2023 15:26
@carbolymer carbolymer force-pushed the mgalazyn/feature/use-handshake-when-starting-testnet branch from b060b38 to f714852 Compare December 18, 2023 11:41
@carbolymer carbolymer force-pushed the mgalazyn/feature/use-handshake-when-starting-testnet branch from f714852 to 15d9992 Compare December 18, 2023 11:44
@carbolymer carbolymer added this pull request to the merge queue Dec 18, 2023
Merged via the queue into master with commit 5cadaa5 Dec 18, 2023
22 of 24 checks passed
@carbolymer carbolymer deleted the mgalazyn/feature/use-handshake-when-starting-testnet branch December 18, 2023 19:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FR] - cardano-testnet - improve connection checking when starting testnet
4 participants