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 watchdog stop-switch for bitcoin canister #203

Merged
merged 24 commits into from
May 9, 2023

Conversation

maksymar
Copy link
Contributor

@maksymar maksymar commented May 4, 2023

This change adds reading and writing bitcoin canister API access config flag.

API access target is calculated based on the height health status, actual value is read from the bitcoin canister. If there is a difference between the target and actual values, then watchdog tries to rewrite the bitcoin canister API access config flag.

This change also exposes additional metrics:

  • blocks behind/ahead thresholds
  • minimum and actual number of explorers
  • API access target

@maksymar maksymar requested a review from a team as a code owner May 4, 2023 15:29
@maksymar maksymar changed the title Draft: feat: add watchdog stop-switch for bitcoin canister feat: add watchdog stop-switch for bitcoin canister May 4, 2023
watchdog/src/config.rs Show resolved Hide resolved
watchdog/src/config.rs Show resolved Hide resolved
watchdog/src/metrics.rs Outdated Show resolved Hide resolved
watchdog/src/metrics.rs Show resolved Hide resolved
watchdog/src/api_access.rs Outdated Show resolved Hide resolved
watchdog/src/lib.rs Outdated Show resolved Hide resolved
Copy link
Member

@dsarlis dsarlis left a comment

Choose a reason for hiding this comment

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

Do we have a test to check whether the config can be changed properly? Probably we need an end-to-end test for that?

watchdog/src/lib.rs Outdated Show resolved Hide resolved
watchdog/src/api_access.rs Show resolved Hide resolved
watchdog/src/config.rs Outdated Show resolved Hide resolved
@maksymar maksymar requested review from ielashi and dsarlis May 8, 2023 11:34
@maksymar
Copy link
Contributor Author

maksymar commented May 8, 2023

Do we have a test to check whether the config can be changed properly? Probably we need an end-to-end test for that?

I'd prefer to separate such an end-to-end test from this PR because it might be a bit too complicated, because to make it truly end-to-end it'd need to intercept HTTP requests from the canister and provide mock responses.

@maksymar
Copy link
Contributor Author

maksymar commented May 8, 2023

LGTMs?

@maksymar maksymar merged commit 0c1931e into master May 9, 2023
@maksymar maksymar deleted the maksym-stop-switch branch May 9, 2023 08:47
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.

3 participants