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 gnohealth cli tool #3158

Merged
merged 2 commits into from
Nov 20, 2024
Merged

Conversation

aeddi
Copy link
Contributor

@aeddi aeddi commented Nov 19, 2024

This PR adds a tool to the contribs dedicated to adding subcommands for health checks. The first available subcommand simply detects timestamp drift on a given chain.

This test was useful in the context of this issue: #1950.

However, it could later run on a dedicated server or on a GitHub Actions cron job to alert us in case significant drift occurs again.

Results on test5 :

> gnohealth timestamp -ws -remote 'wss://rpc.test5.gno.land:443/websocket' -verbose
block 411344 drifted of 3.094940942s (max 10s): OK
block 411345 drifted of 2.368750176s (max 10s): OK
block 411346 drifted of 2.310184977s (max 10s): OK
block 411347 drifted of 2.158713327s (max 10s): OK
block 411348 drifted of 2.203484957s (max 10s): OK
block 411349 drifted of 2.156479203s (max 10s): OK
block 411350 drifted of 2.155613458s (max 10s): OK
block 411351 drifted of 2.296832155s (max 10s): OK
block 411352 drifted of 2.132230389s (max 10s): OK
block 411353 drifted of 2.181071735s (max 10s): OK
block 411354 drifted of 2.575055701s (max 10s): OK
block 411355 drifted of 2.034728695s (max 10s): OK
block 411356 drifted of 2.285932658s (max 10s): OK
block 411357 drifted of 2.330991247s (max 10s): OK
block 411358 drifted of 2.365136593s (max 10s): OK
block 411359 drifted of 2.035198868s (max 10s): OK
block 411360 drifted of 2.128274141s (max 10s): OK
block 411361 drifted of 2.48608003s (max 10s): OK
block 411362 drifted of 2.072144703s (max 10s): OK
block 411363 drifted of 2.297280076s (max 10s): OK
block 411364 drifted of 2.224310386s (max 10s): OK
no timestamp drifted beyond the maximum delta (average 2.280639734s)

Results on test4 :

> gnohealth timestamp -ws -remote 'wss://rpc.test4.gno.land:443/websocket' -verbose
block 3618022 drifted of 3.765561468s (max 10s): OK
block 3618023 drifted of 3.697091353s (max 10s): OK
block 3618024 drifted of 3.576602477s (max 10s): OK
block 3618025 drifted of 3.542585771s (max 10s): OK
block 3618026 drifted of 3.72231133s (max 10s): OK
block 3618027 drifted of 3.751154575s (max 10s): OK
block 3618028 drifted of 8.312827308s (max 10s): OK
block 3618029 drifted of 3.712806121s (max 10s): OK
block 3618030 drifted of 3.65324572s (max 10s): OK
no timestamp drifted beyond the maximum delta (average 4.192687347s)
Contributors' checklist...
  • Added new tests, or not needed, or not feasible
  • Provided an example (e.g. screenshot) to aid review or the PR is self-explanatory
  • Updated the official documentation or not needed
  • No breaking changes were made, or a BREAKING CHANGE: xxx message was included in the description
  • Added references to related issues and PRs
  • Provided any useful hints for running manual tests

Copy link

codecov bot commented Nov 19, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

📢 Thoughts on this report? Let us know!

contribs/gnohealth/go.mod Outdated Show resolved Hide resolved
@aeddi aeddi force-pushed the dev/aeddi/gnohealth branch from 816a322 to 9eff680 Compare November 20, 2024 00:46
@aeddi aeddi merged commit 7188b1c into gnolang:master Nov 20, 2024
140 checks passed
@aeddi aeddi deleted the dev/aeddi/gnohealth branch November 20, 2024 01:14
@Kouteki Kouteki added the in focus Core team is prioritizing this work label Nov 27, 2024
@Kouteki Kouteki added this to the 🚀 Mainnet launch milestone Nov 27, 2024
@Kouteki Kouteki removed the in focus Core team is prioritizing this work label Nov 29, 2024
@gnolang gnolang deleted a comment from Gno2D2 Dec 2, 2024
r3v4s pushed a commit to gnoswap-labs/gno that referenced this pull request Dec 10, 2024
This PR adds a tool to the contribs dedicated to adding subcommands for
health checks. The first available subcommand simply detects timestamp
drift on a given chain.

This test was useful in the context of this issue:
gnolang#1950.

However, it could later run on a dedicated server or on a GitHub Actions
cron job to alert us in case significant drift occurs again.

Results on test5 :
```
> gnohealth timestamp -ws -remote 'wss://rpc.test5.gno.land:443/websocket' -verbose
block 411344 drifted of 3.094940942s (max 10s): OK
block 411345 drifted of 2.368750176s (max 10s): OK
block 411346 drifted of 2.310184977s (max 10s): OK
block 411347 drifted of 2.158713327s (max 10s): OK
block 411348 drifted of 2.203484957s (max 10s): OK
block 411349 drifted of 2.156479203s (max 10s): OK
block 411350 drifted of 2.155613458s (max 10s): OK
block 411351 drifted of 2.296832155s (max 10s): OK
block 411352 drifted of 2.132230389s (max 10s): OK
block 411353 drifted of 2.181071735s (max 10s): OK
block 411354 drifted of 2.575055701s (max 10s): OK
block 411355 drifted of 2.034728695s (max 10s): OK
block 411356 drifted of 2.285932658s (max 10s): OK
block 411357 drifted of 2.330991247s (max 10s): OK
block 411358 drifted of 2.365136593s (max 10s): OK
block 411359 drifted of 2.035198868s (max 10s): OK
block 411360 drifted of 2.128274141s (max 10s): OK
block 411361 drifted of 2.48608003s (max 10s): OK
block 411362 drifted of 2.072144703s (max 10s): OK
block 411363 drifted of 2.297280076s (max 10s): OK
block 411364 drifted of 2.224310386s (max 10s): OK
no timestamp drifted beyond the maximum delta (average 2.280639734s)
```

Results on test4 :
```
> gnohealth timestamp -ws -remote 'wss://rpc.test4.gno.land:443/websocket' -verbose
block 3618022 drifted of 3.765561468s (max 10s): OK
block 3618023 drifted of 3.697091353s (max 10s): OK
block 3618024 drifted of 3.576602477s (max 10s): OK
block 3618025 drifted of 3.542585771s (max 10s): OK
block 3618026 drifted of 3.72231133s (max 10s): OK
block 3618027 drifted of 3.751154575s (max 10s): OK
block 3618028 drifted of 8.312827308s (max 10s): OK
block 3618029 drifted of 3.712806121s (max 10s): OK
block 3618030 drifted of 3.65324572s (max 10s): OK
no timestamp drifted beyond the maximum delta (average 4.192687347s)
```

<details><summary>Contributors' checklist...</summary>

- [x] Added new tests, or not needed, or not feasible
- [x] Provided an example (e.g. screenshot) to aid review or the PR is
self-explanatory
- [x] Updated the official documentation or not needed
- [x] No breaking changes were made, or a `BREAKING CHANGE: xxx` message
was included in the description
- [x] Added references to related issues and PRs
- [ ] Provided any useful hints for running manual tests
</details>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

3 participants