-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Kubernetes configuration for Keep Maintainer bot (#3689)
In this PR we update the configuration of keep-client maintainer deployment running in keep-test and keep-prd. ### Template We define a template for running the keep-client in maintainer mode with all the available modules: - spv - walletCoordination - bitcoinDifficulty ### keep-prd In keep-prd cluster we replaced the previously running Bitcoin difficulty maintainer with a new instance of all-in-one maintainer bot. ### keep-test In keep-test we have to adjust the setup to work correctly with the `LightRelay` contract. Bitcoin Relay used by the tTBTC system on testnet environment is an optimized version of the Light Relay implemented by [GoerliLightRelay](https://github.com/keep-network/tbtc-v2/blob/main/solidity/contracts/test/GoerliLightRelay.sol) contract. The reason the Light Relay had to be modified for testnet is that on Bitcoin testnet difficulty often drops to `1`, which makes the blocks validation on such change impossible to the regular Light Relay contract. The `GoerliLightRelay` version doesn't require a maintainer bot to submit block headers on difficulty change. It accepts ad-hoc difficulty alignment according to the tests needs. For these reasons, we are running two instances of keep-maintainer. The first instance `keep-maintainer` is connected to Bitcoin testnet and runs `spv` and `walletCoordination` modules. The second instance `keep-maintainer-staging` is connected to Bitcoin mainnet and runs only `bitcoinDifficulty` module. The test environment setup for the relay contract is subject to change in the coming weeks, so the configuration defined in this PR for the keep-test is expected to be modified then.
- Loading branch information
Showing
10 changed files
with
237 additions
and
197 deletions.
There are no files selected for viewing
27 changes: 0 additions & 27 deletions
27
infrastructure/kube/keep-prd/btc-difficulty/kustomization.yaml
This file was deleted.
Oops, something went wrong.
70 changes: 0 additions & 70 deletions
70
infrastructure/kube/keep-prd/btc-difficulty/maintainer-statefulset.yaml
This file was deleted.
Oops, something went wrong.
33 changes: 33 additions & 0 deletions
33
infrastructure/kube/keep-prd/keep-maintainer/kustomization.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
resources: | ||
- ../../templates/keep-maintainer | ||
|
||
namespace: default | ||
|
||
commonLabels: | ||
app: keep-maintainer | ||
type: all | ||
network: mainnet | ||
|
||
images: | ||
- name: keep-maintainer | ||
newName: gcr.io/keep-prd-210b/keep-client | ||
newTag: v2.0.0-m4-rc | ||
|
||
configMapGenerator: | ||
- name: keep-maintainer-config | ||
behavior: merge | ||
literals: | ||
- network=mainnet | ||
- electrum-api-url=ws://electrumx.bitcoin:8080 | ||
files: | ||
- .secret/keep-maintainer-keyfile | ||
|
||
secretGenerator: | ||
- name: keep-maintainer-eth-account-password | ||
files: | ||
- .secret/keep-maintainer-password | ||
|
||
generatorOptions: | ||
disableNameSuffixHash: true | ||
annotations: | ||
note: generated |
27 changes: 0 additions & 27 deletions
27
infrastructure/kube/keep-test/btc-difficulty/kustomization.yaml
This file was deleted.
Oops, something went wrong.
73 changes: 0 additions & 73 deletions
73
infrastructure/kube/keep-test/btc-difficulty/maintainer-statefulset.yaml
This file was deleted.
Oops, something went wrong.
14 changes: 14 additions & 0 deletions
14
infrastructure/kube/keep-test/keep-maintainer-staging/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# Keep Maintainer Staging Mainnet | ||
|
||
Bitcoin Relay used by the tTBTC system on testnet environment is an optimized version | ||
of the Light Relay implemented by [GoerliLightRelay](https://github.com/keep-network/tbtc-v2/blob/main/solidity/contracts/test/GoerliLightRelay.sol) | ||
contract. The reason the Light Relay had to be modified for testnet is that on | ||
Bitcoin testnet difficulty often drops to `1`, which makes the blocks validation | ||
on such change impossible to the regular Light Relay contract. | ||
|
||
The `GoerliLightRelay` version doesn't require a maintainer bot to submit block | ||
headers on difficulty change. It accepts ad-hoc difficulty alignment according to | ||
the tests needs. | ||
|
||
The setup defined in this directory is meant for testing the bitcoin difficulty module | ||
of the maintainer bot with the Bitcoin mainnet blockchain state. |
50 changes: 50 additions & 0 deletions
50
infrastructure/kube/keep-test/keep-maintainer-staging/kustomization.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
resources: | ||
- ../../templates/keep-maintainer | ||
|
||
namespace: default | ||
|
||
# Regular testnet maintainer doesn't run bitcoinDifficulty module due to specifics | ||
# of LightRelay running on testnet (GoerliLightRelay). This setup is running | ||
# the `bitcoinDifficulty` module of maintainer connected to Bitcoin mainnet. | ||
nameSuffix: -staging | ||
|
||
commonLabels: | ||
app: keep-maintainer-staging | ||
type: bitcoinDifficulty | ||
network: goerli | ||
|
||
images: | ||
- name: keep-maintainer | ||
newName: gcr.io/keep-test-f3e0/keep-client | ||
newTag: latest | ||
|
||
configMapGenerator: | ||
- name: keep-maintainer-config | ||
behavior: merge | ||
literals: | ||
- network=testnet | ||
- electrum-api-url=wss://electrumx-server.tbtc.network:8443 | ||
files: | ||
- .secret/keep-maintainer-keyfile | ||
|
||
secretGenerator: | ||
- name: keep-maintainer-eth-account-password | ||
files: | ||
- .secret/keep-maintainer-password | ||
|
||
patches: | ||
- target: | ||
kind: StatefulSet | ||
name: keep-maintainer | ||
patch: |- | ||
- op: add | ||
path: /spec/template/spec/containers/0/args/- | ||
value: --bitcoinDifficulty | ||
- op: replace | ||
path: /spec/template/spec/containers/0/env/0/valueFrom/secretKeyRef/name | ||
value: eth-network-goerli | ||
generatorOptions: | ||
disableNameSuffixHash: true | ||
annotations: | ||
note: generated |
54 changes: 54 additions & 0 deletions
54
infrastructure/kube/keep-test/keep-maintainer/kustomization.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
resources: | ||
- ../../templates/keep-maintainer | ||
|
||
namespace: default | ||
|
||
commonLabels: | ||
app: keep-maintainer | ||
# The current setup runs spv and walletCoordination modules as a workaround | ||
# for reasons mentioned in `patches` property below. | ||
type: all | ||
network: goerli | ||
|
||
images: | ||
- name: keep-maintainer | ||
newName: gcr.io/keep-test-f3e0/keep-client | ||
newTag: latest | ||
|
||
configMapGenerator: | ||
- name: keep-maintainer-config | ||
behavior: merge | ||
literals: | ||
- network=testnet | ||
- electrum-api-url=ws://electrumx.bitcoin-testnet:8080 | ||
files: | ||
- .secret/keep-maintainer-keyfile | ||
|
||
secretGenerator: | ||
- name: keep-maintainer-eth-account-password | ||
files: | ||
- .secret/keep-maintainer-password | ||
|
||
patches: | ||
# Testnet's maintainer shouldn't run `--bitcoinDifficulty` module, as the testnet | ||
# uses modified version of LightRelay contract (GoerliLightRelay) that doesn't | ||
# require the bitcoin difficulty to be submitted. This patch defines manually | ||
# which modules should be started. | ||
- target: | ||
kind: StatefulSet | ||
name: keep-maintainer | ||
patch: |- | ||
- op: add | ||
path: /spec/template/spec/containers/0/args/- | ||
value: --spv | ||
- op: add | ||
path: /spec/template/spec/containers/0/args/- | ||
value: --walletCoordination | ||
- op: replace | ||
path: /spec/template/spec/containers/0/env/0/valueFrom/secretKeyRef/name | ||
value: eth-network-goerli | ||
generatorOptions: | ||
disableNameSuffixHash: true | ||
annotations: | ||
note: generated |
17 changes: 17 additions & 0 deletions
17
infrastructure/kube/templates/keep-maintainer/kustomization.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
resources: | ||
- maintainer-statefulset.yaml | ||
|
||
commonLabels: | ||
app: keep-maintainer | ||
type: all | ||
|
||
configMapGenerator: | ||
- name: keep-maintainer-config | ||
literals: | ||
- log-level=info | ||
- log-format=json | ||
|
||
generatorOptions: | ||
disableNameSuffixHash: true | ||
annotations: | ||
note: generated |
Oops, something went wrong.