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

feat: add base node responsiveness monitoring #6715

Merged
merged 4 commits into from
Dec 10, 2024

Conversation

hansieodendaal
Copy link
Contributor

@hansieodendaal hansieodendaal commented Dec 6, 2024

Description

Added a base node responsiveness monitoring command, which can be executed from within the base node console or directly from the command line. A peer's specific public addresses can be tested if combined with a script that removes the peer_db and command-line options to isolate the base node. If instructed to exit after the test, the base node will either exit with a process exit status code of 0 indicating success or 1 indicating failure. Test results can also be written to a file.

>> test-peer-liveness --help
Command `test-peer-liveness --help` failed: test-peer-liveness
Adds a peer

USAGE:
    test-peer-liveness <PUBLIC_KEY> <ADDRESS> [ARGS]

ARGS:
    <PUBLIC_KEY>          The public key of the peer to be tested
    <ADDRESS>             The address of the peer to be tested
    <EXIT>                Auto exit the base node after test
    <OUTPUT_TO_FILE>      Write the responsiveness result to file - results will be written to
                          'peer_liveness_test.log'
    <REFRESH_FILE>        Start with a new log file
    <OUTPUT_DIRECTORY>    Optional output directory (otherwise current directory will be used)

OPTIONS:
    -h, --help    Print help information

Motivation and Context

Sometimes it is not enough to be able to dial a peer to know if it is responsive, it should also respond with pongs when pings are sent. This knowledge is especially useful when evaluating status of seed peers.

How Has This Been Tested?

System-level testing

echo off

echo.
echo # Seed peer 1, address 1

del "..\..\.tari\esmeralda\peer_db" /f/ q

.\minotari_node.exe --non-interactive-mode -p esmeralda.p2p.seeds.dns_seeds="" -p esmeralda.p2p.seeds.peer_seeds="" --network esmeralda --watch "test-peer-liveness f6186e6f15af070d01d5aec8c5a53d81088c34b777cd0b25292d1cd522532462 /onion3/5uqpxi6ando6jrtcpj3aok4z7ab2nm36knfv2pzdf2hefdpkdcjnazid:18141 true true false"

echo.
echo Process status: %ERRORLEVEL%

echo.
echo # Seed peer 2, address 1

del "..\..\.tari\esmeralda\peer_db" /f/ q

.\minotari_node.exe --non-interactive-mode -p esmeralda.p2p.seeds.dns_seeds="" -p esmeralda.p2p.seeds.peer_seeds="" --network esmeralda --watch "test-peer-liveness 8a24a7fb8ff2f1183c02ac52d488a13cc1104f970cc9a6fb3dd5f17ea1d85212 /ip4/3.248.103.200/tcp/18189 true true false"

echo.
echo Process status: %ERRORLEVEL%
Date Time Public Key Address Result Test Duration
2024/12/09 09:26 f6186e6f15af070d01d5aec8c5a53d81088c34b777cd0b25292d1cd522532462 /onion3/5uqpxi6ando6jrtcpj3aok4z7ab2nm36knfv2pzdf2hefdpkdcjnazid:18141 PASS 13.88s
2024/12/09 09:26 8a24a7fb8ff2f1183c02ac52d488a13cc1104f970cc9a6fb3dd5f17ea1d85212 /ip4/3.248.103.200/tcp/18189 PASS 2.33s
2024/12/09 09:26 8a24a7fb8ff2f1183c02ac52d488a13cc1104f970cc9a6fb3dd5f17ea1d85212 /onion3/4a5vimdolvhhn6v55vjvoxgvfehqh7zwpdhi6touut3cvxtkg6a5jqqd:18141 PASS 2.61s
2024/12/09 09:26 84f96417df602c11fbe34871b89b542925cafeca1aa7d97e263c425502c27165 /onion3/vzzzo4e5vjhoz3u35cz5wkijfxahwxwt723af2b4lcd6wuxvlpg5awid:18141 PASS 6.10s
2024/12/09 09:26 84f96417df602c11fbe34871b89b542925cafeca1aa7d97e263c425502c27165 /ip4/52.30.9.0/tcp/18189 PASS 6.15s
2024/12/09 09:27 0c189bd7266b441aca632ff578c322ebd3d616c4579bd0cbb2f7304181782c7c /onion3/3hzh3qjc2yvetn73kgolnlmsgeekqsmj2vkeyc4gjl2zi7mwhjhuhyid:18141 FAIL 30.08s
2024/12/09 09:27 6677c4d401b98f403de671712a98ad8bf2976db27a1d411b08bedfd86751e048 /onion3/gbps7j5ir4qsayy2zyw5ec43rrvn2ziuidspitbndozmfnsi65tratyd:18141 FAIL 29.99s

What process can a PR reviewer use to test or verify this change?

System-level testing
Code review

Breaking Changes

  • None
  • Requires data directory on base node to be deleted
  • Requires hard fork
  • Other - Please specify

@hansieodendaal hansieodendaal requested a review from a team as a code owner December 6, 2024 12:00
Copy link

github-actions bot commented Dec 6, 2024

Test Results (CI)

    3 files    129 suites   36m 34s ⏱️
1 344 tests 1 344 ✅ 0 💤 0 ❌
4 030 runs  4 030 ✅ 0 💤 0 ❌

Results for commit bd6001c.

♻️ This comment has been updated with latest results.

Copy link

github-actions bot commented Dec 6, 2024

Test Results (Integration tests)

36 tests  +36   36 ✅ +36   15m 11s ⏱️ + 15m 11s
11 suites +11    0 💤 ± 0 
 2 files   + 2    0 ❌ ± 0 

Results for commit bd6001c. ± Comparison against base commit 317c745.

♻️ This comment has been updated with latest results.

@hansieodendaal hansieodendaal changed the title feat: base node monitoring tool feat: add base node responsiveness monitoring Dec 9, 2024
Copy link
Collaborator

@SWvheerden SWvheerden left a comment

Choose a reason for hiding this comment

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

this looks good, just a nit about the function length

@SWvheerden SWvheerden merged commit b127883 into tari-project:development Dec 10, 2024
17 checks passed
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.

2 participants