From 6560dce563e041db5cc810f69339b3a04ae50b96 Mon Sep 17 00:00:00 2001 From: bgravenorst Date: Wed, 27 Jul 2022 11:51:51 +1000 Subject: [PATCH 1/6] Add slashing protection health check. Signed-off-by: bgravenorst --- docs/HowTo/Configure-Slashing-Protection.md | 11 ++++ docs/Reference/CLI/CLI-Subcommands.md | 61 +++++++++++++++++++++ 2 files changed, 72 insertions(+) diff --git a/docs/HowTo/Configure-Slashing-Protection.md b/docs/HowTo/Configure-Slashing-Protection.md index 6c5a832..0965f90 100644 --- a/docs/HowTo/Configure-Slashing-Protection.md +++ b/docs/HowTo/Configure-Slashing-Protection.md @@ -144,6 +144,17 @@ You can include additional optional pruning configuration options. For example, Do not use slashing protection database pruning while [importing or exporting the database](#import-or-export-a-slashing-protection-database). +## Health checks + +By default Web3Signer performs a health check on the slashing protection database every 30000 milliseconds. +To change the default value, configure the [--slashing-protection-db-health-check-interval-milliseconds](../Reference/CLI/CLI-Subcommands.md#slashing-protection-db-health-check-interval-milliseconds) +command line option. + +The service responds with a `200` message if healthy, and `503` if unhealthy. + +You can also configure the health check timeout with the [--slashing-protection-db-health-check-timeout-milliseconds](../Reference/CLI/CLI-Subcommands.md#slashing-protection-db-health-check-timeout-milliseconds) +command line option. The timeout defaults to 3000 milliseconds. + [slashing protection]: ../Concepts/Slashing-Protection.md [slashing protection database pruning]: #prune-the-slashing-protection-database diff --git a/docs/Reference/CLI/CLI-Subcommands.md b/docs/Reference/CLI/CLI-Subcommands.md index e123a41..97bcd4c 100644 --- a/docs/Reference/CLI/CLI-Subcommands.md +++ b/docs/Reference/CLI/CLI-Subcommands.md @@ -691,6 +691,67 @@ Possible values are: | `ropsten` | Consensus layer | Test | Multi-client testnet. | | `gnosis` | Consensus layer | Test | Multi-client testnet. | +#### `slashing-protection-db-health-check-interval-milliseconds` + +=== "Syntax" + + ```bash + --slashing-protection-db-health-check-interval-milliseconds= + ``` + +=== "Example" + + ```bash + ----slashing-protection-db-health-check-interval-milliseconds=20000 + ``` + +=== "Environment variable" + + ```bash + WEB3SIGNER_ETH2_SLASHING_PROTECTION_DB_HEALTH_CHECK_INTERVAL_MILLISECONDS=20000 + ``` + +=== "Configuration file" + + ```bash + eth2.slashing-protection-db-health-check-interval-milliseconds: 20000 + ``` + +Milliseconds between slashing database health checks. The default is 30000. + +The service responds with a `200` message if healthy, and `503` if unhealthy. + +#### `slashing-protection-db-health-check-timeout-milliseconds` + +=== "Syntax" + + ```bash + --slashing-protection-db-health-check-timeout-milliseconds= + ``` + +=== "Example" + + ```bash + ----slashing-protection-db-health-check-timeout-milliseconds=2000 + ``` + +=== "Environment variable" + + ```bash + WEB3SIGNER_ETH2_SLASHING_PROTECTION_DB_HEALTH_CHECK_TIMEOUT_MILLISECONDS=2000 + ``` + +=== "Configuration file" + + ```bash + eth2.slashing-protection-db-health-check-timeout-milliseconds: 2000 + ``` + +Milliseconds after which to fail the database health check. For example, if the health check +connects to the slashing protection database, but does not report back in a timely manner. + +The default is 3000. + #### `slashing-protection-db-password` === "Syntax" From 202f0ed7f68f11f2e2f97f16c51fa5dd5c31615c Mon Sep 17 00:00:00 2001 From: bgravenorst Date: Wed, 27 Jul 2022 11:56:12 +1000 Subject: [PATCH 2/6] Fix typo. Signed-off-by: bgravenorst --- docs/Reference/CLI/CLI-Subcommands.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/Reference/CLI/CLI-Subcommands.md b/docs/Reference/CLI/CLI-Subcommands.md index 97bcd4c..6cf3d7e 100644 --- a/docs/Reference/CLI/CLI-Subcommands.md +++ b/docs/Reference/CLI/CLI-Subcommands.md @@ -717,7 +717,7 @@ Possible values are: eth2.slashing-protection-db-health-check-interval-milliseconds: 20000 ``` -Milliseconds between slashing database health checks. The default is 30000. +Milliseconds between the slashing protection database health checks. The default is 30000. The service responds with a `200` message if healthy, and `503` if unhealthy. From 87deac632c70ae1724e5ae82323eb90c89ecdd9c Mon Sep 17 00:00:00 2001 From: bgravenorst Date: Wed, 27 Jul 2022 11:57:54 +1000 Subject: [PATCH 3/6] Fix typo. Signed-off-by: bgravenorst --- docs/HowTo/Configure-Slashing-Protection.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/HowTo/Configure-Slashing-Protection.md b/docs/HowTo/Configure-Slashing-Protection.md index 0965f90..76a6cf8 100644 --- a/docs/HowTo/Configure-Slashing-Protection.md +++ b/docs/HowTo/Configure-Slashing-Protection.md @@ -147,12 +147,12 @@ You can include additional optional pruning configuration options. For example, ## Health checks By default Web3Signer performs a health check on the slashing protection database every 30000 milliseconds. -To change the default value, configure the [--slashing-protection-db-health-check-interval-milliseconds](../Reference/CLI/CLI-Subcommands.md#slashing-protection-db-health-check-interval-milliseconds) +To change the default value, configure the [`--slashing-protection-db-health-check-interval-milliseconds`](../Reference/CLI/CLI-Subcommands.md#slashing-protection-db-health-check-interval-milliseconds) command line option. The service responds with a `200` message if healthy, and `503` if unhealthy. -You can also configure the health check timeout with the [--slashing-protection-db-health-check-timeout-milliseconds](../Reference/CLI/CLI-Subcommands.md#slashing-protection-db-health-check-timeout-milliseconds) +You can also configure the health check timeout with the [`--slashing-protection-db-health-check-timeout-milliseconds`](../Reference/CLI/CLI-Subcommands.md#slashing-protection-db-health-check-timeout-milliseconds) command line option. The timeout defaults to 3000 milliseconds. From b8add3a32b3aac68701c3d857d379dc1163e59b3 Mon Sep 17 00:00:00 2001 From: bgravenorst Date: Wed, 27 Jul 2022 12:00:45 +1000 Subject: [PATCH 4/6] Fix syntax error. Signed-off-by: bgravenorst --- docs/Reference/CLI/CLI-Subcommands.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/Reference/CLI/CLI-Subcommands.md b/docs/Reference/CLI/CLI-Subcommands.md index 6cf3d7e..fe98dd7 100644 --- a/docs/Reference/CLI/CLI-Subcommands.md +++ b/docs/Reference/CLI/CLI-Subcommands.md @@ -702,7 +702,7 @@ Possible values are: === "Example" ```bash - ----slashing-protection-db-health-check-interval-milliseconds=20000 + --slashing-protection-db-health-check-interval-milliseconds=20000 ``` === "Environment variable" @@ -732,7 +732,7 @@ The service responds with a `200` message if healthy, and `503` if unhealthy. === "Example" ```bash - ----slashing-protection-db-health-check-timeout-milliseconds=2000 + --slashing-protection-db-health-check-timeout-milliseconds=2000 ``` === "Environment variable" From 55b746b74d33b3a79683ac57c4366b270781d7cf Mon Sep 17 00:00:00 2001 From: bgravenorst Date: Thu, 28 Jul 2022 11:53:53 +1000 Subject: [PATCH 5/6] Address feedback. Signed-off-by: bgravenorst --- docs/HowTo/Configure-Slashing-Protection.md | 2 +- docs/HowTo/Get-Started/Start-Web3Signer.md | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/docs/HowTo/Configure-Slashing-Protection.md b/docs/HowTo/Configure-Slashing-Protection.md index 76a6cf8..1f65d28 100644 --- a/docs/HowTo/Configure-Slashing-Protection.md +++ b/docs/HowTo/Configure-Slashing-Protection.md @@ -144,7 +144,7 @@ You can include additional optional pruning configuration options. For example, Do not use slashing protection database pruning while [importing or exporting the database](#import-or-export-a-slashing-protection-database). -## Health checks +## Database health check By default Web3Signer performs a health check on the slashing protection database every 30000 milliseconds. To change the default value, configure the [`--slashing-protection-db-health-check-interval-milliseconds`](../Reference/CLI/CLI-Subcommands.md#slashing-protection-db-health-check-interval-milliseconds) diff --git a/docs/HowTo/Get-Started/Start-Web3Signer.md b/docs/HowTo/Get-Started/Start-Web3Signer.md index 0f6b4fe..43ea711 100644 --- a/docs/HowTo/Get-Started/Start-Web3Signer.md +++ b/docs/HowTo/Get-Started/Start-Web3Signer.md @@ -62,7 +62,8 @@ Start the client, for example [Teku] by specifying the Web3Signer details. ## Confirm Web3Signer is running -Use the [`upcheck`](https://consensys.github.io/web3signer/web3signer-eth2.html#tag/Server-Status) endpoint to confirm Web3Signer is connected and running. +Use the [`upcheck`](https://consensys.github.io/web3signer/web3signer-eth2.html#tag/Server-Status) endpoint +to confirm Web3Signer is connected and running. !!! example @@ -78,6 +79,9 @@ Use the [`upcheck`](https://consensys.github.io/web3signer/web3signer-eth2.html# 200 OK ``` +Web3Signer by default also performs a health check on the +[slashing protection database](../../HowTo/Configure-Slashing-Protection.md). + [Signing key configuration files]: ../Use-Signing-Keys.md [Teku]: https://docs.teku.consensys.net/en/latest/HowTo/External-Signer/Use-External-Signer/ From e5fb9bc8beae58ae1d36d6c64c2a33a6f9b3f617 Mon Sep 17 00:00:00 2001 From: bgravenorst Date: Thu, 28 Jul 2022 12:01:23 +1000 Subject: [PATCH 6/6] Address feedback. Signed-off-by: bgravenorst --- docs/HowTo/Configure-Slashing-Protection.md | 4 ++-- docs/HowTo/Get-Started/Start-Web3Signer.md | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/HowTo/Configure-Slashing-Protection.md b/docs/HowTo/Configure-Slashing-Protection.md index 1f65d28..a475784 100644 --- a/docs/HowTo/Configure-Slashing-Protection.md +++ b/docs/HowTo/Configure-Slashing-Protection.md @@ -144,9 +144,9 @@ You can include additional optional pruning configuration options. For example, Do not use slashing protection database pruning while [importing or exporting the database](#import-or-export-a-slashing-protection-database). -## Database health check +## Slashing protection health check -By default Web3Signer performs a health check on the slashing protection database every 30000 milliseconds. +By default, Web3Signer performs a health check on the slashing protection database every 30000 milliseconds. To change the default value, configure the [`--slashing-protection-db-health-check-interval-milliseconds`](../Reference/CLI/CLI-Subcommands.md#slashing-protection-db-health-check-interval-milliseconds) command line option. diff --git a/docs/HowTo/Get-Started/Start-Web3Signer.md b/docs/HowTo/Get-Started/Start-Web3Signer.md index 43ea711..80e25f8 100644 --- a/docs/HowTo/Get-Started/Start-Web3Signer.md +++ b/docs/HowTo/Get-Started/Start-Web3Signer.md @@ -80,7 +80,7 @@ to confirm Web3Signer is connected and running. ``` Web3Signer by default also performs a health check on the -[slashing protection database](../../HowTo/Configure-Slashing-Protection.md). +[slashing protection database](../../HowTo/Configure-Slashing-Protection.md#slashing-protection-health-check). [Signing key configuration files]: ../Use-Signing-Keys.md