From 83dbf23b2ed33e402ab312696e62eb95cb177065 Mon Sep 17 00:00:00 2001 From: Haneen Khalifa Date: Fri, 17 May 2024 16:08:02 +0300 Subject: [PATCH 01/11] feat: add Grandine image update --- configs/client_images.yaml | 3 +++ scripts/check-image-updates.sh | 7 ++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/configs/client_images.yaml b/configs/client_images.yaml index bc14d17db..46475f716 100644 --- a/configs/client_images.yaml +++ b/configs/client_images.yaml @@ -24,6 +24,9 @@ consensus: prysm: name: gcr.io/prysmaticlabs/prysm/beacon-chain version: v5.0.0 + grandine: + name: sifrai/grandine + version: 0.4.1 validator: lighthouse: name: sigp/lighthouse diff --git a/scripts/check-image-updates.sh b/scripts/check-image-updates.sh index 19fcc7d45..7d1027779 100755 --- a/scripts/check-image-updates.sh +++ b/scripts/check-image-updates.sh @@ -55,7 +55,12 @@ TEKU_LATEST_VERSION=$(curl -H "Authorization: Bearer $PAT" -sL https://api.githu update-client "Teku" "consensus" ".consensus.teku" "$TEKU_LATEST_VERSION" update-client "Teku" "validator" ".validator.teku" "$TEKU_LATEST_VERSION" -## Prysm +# Prysm PRYSM_LATEST_VERSION=$(curl -H "Authorization: Bearer $PAT" -sL https://api.github.com/repos/prysmaticlabs/prysm/releases/latest | jq -r ".tag_name") update-client "Prysm" "consensus" ".consensus.prysm" "$PRYSM_LATEST_VERSION" update-client "Prysm" "validator" ".validator.prysm" "$PRYSM_LATEST_VERSION" + +# Grandine +GRANDINE_LATEST_VERSION=$(curl -H "Authorization: Bearer $PAT" -sL https://api.github.com/repos/grandinetech/grandine/releases | jq -r ".tag_name") +update-client "Grandine" "consensus" ".consensus.grandine" "$GRANDINE_LATEST_VERSION" +update-client "Grandine" "validator" ".validator.grandine" "$GRANDINE_LATEST_VERSION" \ No newline at end of file From 747af0ff96faf599b17f47b11f801bc5ab5b92fb Mon Sep 17 00:00:00 2001 From: Haneen Khalifa Date: Mon, 20 May 2024 02:35:45 +0300 Subject: [PATCH 02/11] feat: add docker compose in grandine.tmpl --- .../services/merge/consensus/grandine.tmpl | 45 +++++++++++++++++++ .../services/merge/validator/grandine.tmpl | 38 ++++++++++++++++ 2 files changed, 83 insertions(+) create mode 100644 templates/services/merge/consensus/grandine.tmpl create mode 100644 templates/services/merge/validator/grandine.tmpl diff --git a/templates/services/merge/consensus/grandine.tmpl b/templates/services/merge/consensus/grandine.tmpl new file mode 100644 index 000000000..b1451c242 --- /dev/null +++ b/templates/services/merge/consensus/grandine.tmpl @@ -0,0 +1,45 @@ +{{/* grandine.tmpl */}} +{{ define "consensus" }} + consensus: + stop_grace_period: 30s + container_name: sedge-consensus-client{{if .ContainerTag}}-{{.ContainerTag}}{{end}} + restart: unless-stopped + image: ${CC_IMAGE_VERSION}{{if .Mev}} + depends_on:{{if .Mev}} + mev-boost: + condition: service_started{{end}}{{end}} + networks: + - sedge + volumes: + - ${CC_DATA_DIR}:/root/.grandine + - ${CC_JWT_SECRET_PATH}:/root/.grandine/jwtsecret{{if .CustomConsensusConfigs}}{{if .CustomNetworkConfigPath}} + - {{.CustomNetworkConfigPath}}:/network/config.yaml{{end}}{{if .CustomGenesisPath}} + - {{.CustomGenesisPath}}:/network/genesis.ssz{{end}}{{if .CustomDeployBlockPath}} + - {{.CustomDeployBlockPath}}:/network/deploy_block.txt{{end}}{{end}} + ports: + - "{{.ClDiscoveryPort}}:{{.ClDiscoveryPort}}/tcp" + - "{{.ClDiscoveryPort}}:{{.ClDiscoveryPort}}/udp" + - "{{.ClMetricsPort}}:{{.ClMetricsPort}}/tcp"{{if .MapAllPorts}} + - "{{.ClApiPort}}:{{.ClApiPort}}"{{end}} + expose: + - {{.ClApiPort}} + command: + - grandine{{if .CustomConsensusConfigs}} + - --config-file=/network/config.yaml{{end}} + - --datadir=/root/.grandine + - --eth1-rpc-urls=${EC_API_URL} + - --jwt-secret=/root/.grandine/jwtsecret + - --http-address=0.0.0.0 + - --http-port={{.ClApiPort}}{{if not .CustomConsensusConfigs}} + - --network={{if .SplittedNetwork}}${CL_NETWORK}{{else}}${NETWORK}{{end}}{{end}} + - --timeout=10000{{range $flag := .ClExtraFlags}} + - --{{$flag}}{{end}}{{if .MevBoostEndpoint}} + - --checkpoint-sync-url={{if .CheckpointSyncUrl}}{{ .CheckpointSyncUrl }}{{else}}${CHECKPOINT_SYNC_URL}{{end}}{{end}}{{range $flag := .ClExtraFlags}} + - --{{$flag}}{{end}}{{if .MevBoostEndpoint}} + - --builder={{.MevBoostEndpoint}}{{end}}{{if .LoggingDriver}} + logging: + driver: "{{.LoggingDriver}}"{{if eq .LoggingDriver "json-file"}} + options: + max-size: "10m" + max-file: "10"{{end}}{{end}} +{{ end }} \ No newline at end of file diff --git a/templates/services/merge/validator/grandine.tmpl b/templates/services/merge/validator/grandine.tmpl new file mode 100644 index 000000000..624c51809 --- /dev/null +++ b/templates/services/merge/validator/grandine.tmpl @@ -0,0 +1,38 @@ +{{/* grandine.tmpl */}} +{{ define "validator" }} + validator: + container_name: sedge-validator-client{{if .ContainerTag}}-{{.ContainerTag}}{{end}} + image: ${VL_IMAGE_VERSION} + depends_on: + validator-blocker: + condition: service_completed_successfully + networks: + - sedge + ports: + - "{{.VlMetricsPort}}:{{.VlMetricsPort}}" + volumes: + - ${VL_DATA_DIR}:/data{{if .CustomConsensusConfigs}}{{if .CustomNetworkConfigPath}} + - {{.CustomNetworkConfigPath}}:/network_config/config.yaml{{end}}{{if .CustomGenesisPath}} + - {{.CustomGenesisPath}}:/network_config/genesis.ssz{{end}}{{if .CustomDeployBlockPath}} + - {{.CustomDeployBlockPath}}:/network_config/deploy_block.txt{{end}}{{end}} + command: + - grandine{{if .CustomConsensusConfigs}} + - --testnet-dir=/network_config{{end}} + - vc{{if not .CustomConsensusConfigs}} + - --network={{if .SplittedNetwork}}${CL_NETWORK}{{else}}${NETWORK}{{end}}{{end}} + - --beacon-nodes=${CC_API_URL} + - --graffiti=${GRAFFITI} + - --debug-level=${VL_LOG_LEVEL} + - --validators-dir=/data/validators{{with .FeeRecipient}} + - --suggested-fee-recipient=${FEE_RECIPIENT}{{end}} + - --metrics + - --metrics-port={{.VlMetricsPort}} + - --metrics-address=0.0.0.0{{range $flag := .VlExtraFlags}} + - --{{$flag}}{{end}}{{if .MevBoostOnValidator}} + - --builder-proposals{{end}}{{if .LoggingDriver}} + logging: + driver: "{{.LoggingDriver}}"{{if eq .LoggingDriver "json-file"}} + options: + max-size: "10m" + max-file: "10"{{end}}{{end}} +{{ end }} \ No newline at end of file From 0602dfd0506271ab220381009522d05afd5c6815 Mon Sep 17 00:00:00 2001 From: Haneen Khalifa Date: Mon, 20 May 2024 02:36:17 +0300 Subject: [PATCH 03/11] feat: add Gradine to Mainnet envs --- templates/envs/mainnet/consensus/grandine.tmpl | 13 +++++++++++++ templates/envs/mainnet/validator/grandine.tmpl | 12 ++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 templates/envs/mainnet/consensus/grandine.tmpl create mode 100644 templates/envs/mainnet/validator/grandine.tmpl diff --git a/templates/envs/mainnet/consensus/grandine.tmpl b/templates/envs/mainnet/consensus/grandine.tmpl new file mode 100644 index 000000000..a1960ae43 --- /dev/null +++ b/templates/envs/mainnet/consensus/grandine.tmpl @@ -0,0 +1,13 @@ +{{/* grandine.tmpl */}} +{{ define "consensus" }} +# --- Consensus Layer - Beacon Node - configuration --- +CC_PEER_COUNT=50 +CC_LOG_LEVEL=info +EC_API_URL={{.ExecutionApiURL}} +EC_AUTH_URL={{.ExecutionAuthURL}} +CC_INSTANCE_NAME=Grandine +CC_IMAGE_VERSION={{.CcImage}} +CC_DATA_DIR={{.CcDataDir}} +CC_JWT_SECRET_PATH={{.JWTSecretPath}} +{{if .CheckpointSyncUrl}}CHECKPOINT_SYNC_URL={{.CheckpointSyncUrl}}{{end}} +{{ end }} \ No newline at end of file diff --git a/templates/envs/mainnet/validator/grandine.tmpl b/templates/envs/mainnet/validator/grandine.tmpl new file mode 100644 index 000000000..0cf58b4b1 --- /dev/null +++ b/templates/envs/mainnet/validator/grandine.tmpl @@ -0,0 +1,12 @@ +{{/* grandine.tmpl */}} +{{ define "validator" }} +# --- Consensus Layer - Validator Node - configuration --- +CC_API_URL={{.ConsensusApiURL}} +GRAFFITI={{.Graffiti}} +VL_LOG_LEVEL=info +VL_INSTANCE_NAME=GrandineValidator +VL_IMAGE_VERSION={{.VlImage}} +KEYSTORE_DIR={{.KeystoreDir}} +VL_DATA_DIR={{.VlDataDir}} +MEV=true +{{ end }} \ No newline at end of file From aac2d2428b16a161b8b6e5033c69ef6df55d9ae6 Mon Sep 17 00:00:00 2001 From: Haneen Khalifa Date: Mon, 20 May 2024 02:37:54 +0300 Subject: [PATCH 04/11] docs: update docs, CHANGELOG.md, README.md --- CHANGELOG.md | 4 ++++ README.md | 1 + docs/docs/commands/clients.mdx | 1 + 3 files changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ed4afa0c7..c094d9ef0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Added + +- Add Grandine Consensus client support. + ### Changed - Update client images to Dencun-ready versions. diff --git a/README.md b/README.md index b4146c0e1..470255b0c 100644 --- a/README.md +++ b/README.md @@ -137,6 +137,7 @@ Users acknowledge that no warranty is being made of a successful installation. S | Nethermind | Lodestar | Lodestar | | Erigon | Prysm | Prysm | | Besu | Teku | Teku | +| | Grandine | Grandine | ### Sepolia diff --git a/docs/docs/commands/clients.mdx b/docs/docs/commands/clients.mdx index 210be660a..a7ff2a541 100644 --- a/docs/docs/commands/clients.mdx +++ b/docs/docs/commands/clients.mdx @@ -74,6 +74,7 @@ $ sedge clients 2 geth prysm prysm 3 erigon teku teku 4 besu lodestar lodestar + 5 grandine grandine 2023-10-13 14:13:45 -- [INFO] Listing supported clients for network sepolia From 375c1baf7f1fa740bd461b226ba88c4ee81a9a57 Mon Sep 17 00:00:00 2001 From: Haneen Khalifa Date: Tue, 28 May 2024 17:59:57 +0300 Subject: [PATCH 05/11] feat: add grandine as consensus client --- configs/images.go | 1 + internal/pkg/clients/init.go | 1 + internal/pkg/clients/types.go | 2 + .../envs/mainnet/validator/grandine.tmpl | 12 ------ .../services/merge/validator/grandine.tmpl | 38 ------------------- 5 files changed, 4 insertions(+), 50 deletions(-) delete mode 100644 templates/envs/mainnet/validator/grandine.tmpl delete mode 100644 templates/services/merge/validator/grandine.tmpl diff --git a/configs/images.go b/configs/images.go index bafc4b7a5..451837b3d 100644 --- a/configs/images.go +++ b/configs/images.go @@ -29,6 +29,7 @@ var ClientImages struct { Lodestar Image `yaml:"lodestar"` Teku Image `yaml:"teku"` Prysm Image `yaml:"prysm"` + Grandine Image `yaml:"grandine"` } Validator struct { Lighthouse Image `yaml:"lighthouse"` diff --git a/internal/pkg/clients/init.go b/internal/pkg/clients/init.go index e5e06ea77..b9af108c5 100644 --- a/internal/pkg/clients/init.go +++ b/internal/pkg/clients/init.go @@ -27,6 +27,7 @@ var AllClients map[string][]string = map[string][]string{ "prysm", "teku", "lodestar", + "grandine", }, "validator": { "lighthouse", diff --git a/internal/pkg/clients/types.go b/internal/pkg/clients/types.go index edbc58830..61ccc8834 100644 --- a/internal/pkg/clients/types.go +++ b/internal/pkg/clients/types.go @@ -60,6 +60,8 @@ func (c *Client) setConsensusImage(image string) { c.Image = valueOrDefault(image, configs.ClientImages.Consensus.Teku.String()) case "lodestar": c.Image = valueOrDefault(image, configs.ClientImages.Consensus.Lodestar.String()) + case "grandine": + c.Image = valueOrDefault(image, configs.ClientImages.Consensus.Grandine.String()) } } diff --git a/templates/envs/mainnet/validator/grandine.tmpl b/templates/envs/mainnet/validator/grandine.tmpl deleted file mode 100644 index 0cf58b4b1..000000000 --- a/templates/envs/mainnet/validator/grandine.tmpl +++ /dev/null @@ -1,12 +0,0 @@ -{{/* grandine.tmpl */}} -{{ define "validator" }} -# --- Consensus Layer - Validator Node - configuration --- -CC_API_URL={{.ConsensusApiURL}} -GRAFFITI={{.Graffiti}} -VL_LOG_LEVEL=info -VL_INSTANCE_NAME=GrandineValidator -VL_IMAGE_VERSION={{.VlImage}} -KEYSTORE_DIR={{.KeystoreDir}} -VL_DATA_DIR={{.VlDataDir}} -MEV=true -{{ end }} \ No newline at end of file diff --git a/templates/services/merge/validator/grandine.tmpl b/templates/services/merge/validator/grandine.tmpl deleted file mode 100644 index 624c51809..000000000 --- a/templates/services/merge/validator/grandine.tmpl +++ /dev/null @@ -1,38 +0,0 @@ -{{/* grandine.tmpl */}} -{{ define "validator" }} - validator: - container_name: sedge-validator-client{{if .ContainerTag}}-{{.ContainerTag}}{{end}} - image: ${VL_IMAGE_VERSION} - depends_on: - validator-blocker: - condition: service_completed_successfully - networks: - - sedge - ports: - - "{{.VlMetricsPort}}:{{.VlMetricsPort}}" - volumes: - - ${VL_DATA_DIR}:/data{{if .CustomConsensusConfigs}}{{if .CustomNetworkConfigPath}} - - {{.CustomNetworkConfigPath}}:/network_config/config.yaml{{end}}{{if .CustomGenesisPath}} - - {{.CustomGenesisPath}}:/network_config/genesis.ssz{{end}}{{if .CustomDeployBlockPath}} - - {{.CustomDeployBlockPath}}:/network_config/deploy_block.txt{{end}}{{end}} - command: - - grandine{{if .CustomConsensusConfigs}} - - --testnet-dir=/network_config{{end}} - - vc{{if not .CustomConsensusConfigs}} - - --network={{if .SplittedNetwork}}${CL_NETWORK}{{else}}${NETWORK}{{end}}{{end}} - - --beacon-nodes=${CC_API_URL} - - --graffiti=${GRAFFITI} - - --debug-level=${VL_LOG_LEVEL} - - --validators-dir=/data/validators{{with .FeeRecipient}} - - --suggested-fee-recipient=${FEE_RECIPIENT}{{end}} - - --metrics - - --metrics-port={{.VlMetricsPort}} - - --metrics-address=0.0.0.0{{range $flag := .VlExtraFlags}} - - --{{$flag}}{{end}}{{if .MevBoostOnValidator}} - - --builder-proposals{{end}}{{if .LoggingDriver}} - logging: - driver: "{{.LoggingDriver}}"{{if eq .LoggingDriver "json-file"}} - options: - max-size: "10m" - max-file: "10"{{end}}{{end}} -{{ end }} \ No newline at end of file From e4d9adf404467c8a5dd918855b69889b880b50b3 Mon Sep 17 00:00:00 2001 From: Haneen Khalifa Date: Tue, 28 May 2024 19:43:05 +0300 Subject: [PATCH 06/11] docs: update documentations --- README.md | 2 +- docs/docs/commands/clients.mdx | 2 +- docs/docs/networks/mainnet.mdx | 1 + internal/pkg/clients/clients_test.go | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 470255b0c..3f59100e3 100644 --- a/README.md +++ b/README.md @@ -137,7 +137,7 @@ Users acknowledge that no warranty is being made of a successful installation. S | Nethermind | Lodestar | Lodestar | | Erigon | Prysm | Prysm | | Besu | Teku | Teku | -| | Grandine | Grandine | +| | Grandine | | ### Sepolia diff --git a/docs/docs/commands/clients.mdx b/docs/docs/commands/clients.mdx index a7ff2a541..6a8e8f23e 100644 --- a/docs/docs/commands/clients.mdx +++ b/docs/docs/commands/clients.mdx @@ -74,7 +74,7 @@ $ sedge clients 2 geth prysm prysm 3 erigon teku teku 4 besu lodestar lodestar - 5 grandine grandine + 5 grandine 2023-10-13 14:13:45 -- [INFO] Listing supported clients for network sepolia diff --git a/docs/docs/networks/mainnet.mdx b/docs/docs/networks/mainnet.mdx index e12e0e19c..b3ed6a014 100644 --- a/docs/docs/networks/mainnet.mdx +++ b/docs/docs/networks/mainnet.mdx @@ -20,6 +20,7 @@ secured by the Proof-of-Stake (PoS) algorithm. - [Lodestar](https://chainsafe.github.io/lodestar/) - [Prysm](https://docs.prylabs.network/docs/getting-started/) - [Teku](https://docs.teku.consensys.net/en/latest/) +- [Grandine](https://docs.grandine.io/) ## Supported Validator Clients - [Lighthouse](https://lighthouse-book.sigmaprime.io/) diff --git a/internal/pkg/clients/clients_test.go b/internal/pkg/clients/clients_test.go index ddb40428b..dc7376a0f 100644 --- a/internal/pkg/clients/clients_test.go +++ b/internal/pkg/clients/clients_test.go @@ -91,7 +91,7 @@ func TestClients(t *testing.T) { inputs := [...]clientsTestCase{ { map[string][]string{ - "consensus": {"lighthouse", "prysm", "teku", "lodestar"}, + "consensus": {"lighthouse", "prysm", "teku", "lodestar", "grandine"}, "validator": {"lighthouse", "prysm", "teku", "lodestar"}, "execution": {"nethermind", "geth", "besu", "erigon"}, }, From ae56c8f25994ff7011d2a03906e9ad6c3901f18e Mon Sep 17 00:00:00 2001 From: Haneen Khalifa Date: Tue, 28 May 2024 22:13:44 +0300 Subject: [PATCH 07/11] feat: adjust client_tests.go for gnosis consensus clients --- internal/pkg/clients/clients_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/pkg/clients/clients_test.go b/internal/pkg/clients/clients_test.go index dc7376a0f..01e61561c 100644 --- a/internal/pkg/clients/clients_test.go +++ b/internal/pkg/clients/clients_test.go @@ -31,7 +31,7 @@ func TestSupportedClients(t *testing.T) { isErr bool }{ {"execution", "gnosis", []string{"nethermind", "erigon"}, false}, - {"consensus", "gnosis", utils.Filter(AllClients["consensus"], func(c string) bool { return c != "prysm" }), false}, + {"consensus", "gnosis", utils.Filter(AllClients["consensus"], func(c string) bool { return c != "prysm" && c != "grandine" }), false}, {"execution", "mainnet", AllClients["execution"], false}, {"consensus", "mainnet", AllClients["consensus"], false}, {"validator", "mainnet", AllClients["validator"], false}, From 60eb36ca7167d40af1967d58c7c96def77a44283 Mon Sep 17 00:00:00 2001 From: Haneen Khalifa Date: Thu, 30 May 2024 15:20:26 +0300 Subject: [PATCH 08/11] feat: add grandine --- internal/pkg/clients/init.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/pkg/clients/init.go b/internal/pkg/clients/init.go index b9af108c5..575bcee2f 100644 --- a/internal/pkg/clients/init.go +++ b/internal/pkg/clients/init.go @@ -27,7 +27,7 @@ var AllClients map[string][]string = map[string][]string{ "prysm", "teku", "lodestar", - "grandine", + "grandine",//add grandine }, "validator": { "lighthouse", From 8f2e591d862d5c5787a24555482bf642f39098c8 Mon Sep 17 00:00:00 2001 From: Haneen Khalifa Date: Thu, 30 May 2024 15:48:59 +0300 Subject: [PATCH 09/11] test: handled TestGenerateComposeServices/Test_generation_of_compose_services_validator:_grandine,_network:_mainnet,_only_validator Test Case --- internal/pkg/clients/init.go | 2 +- .../pkg/generate/generate_scripts_test.go | 23 +++++++++++-------- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/internal/pkg/clients/init.go b/internal/pkg/clients/init.go index 575bcee2f..b9af108c5 100644 --- a/internal/pkg/clients/init.go +++ b/internal/pkg/clients/init.go @@ -27,7 +27,7 @@ var AllClients map[string][]string = map[string][]string{ "prysm", "teku", "lodestar", - "grandine",//add grandine + "grandine", }, "validator": { "lighthouse", diff --git a/internal/pkg/generate/generate_scripts_test.go b/internal/pkg/generate/generate_scripts_test.go index 38ad4355b..9c911c18d 100644 --- a/internal/pkg/generate/generate_scripts_test.go +++ b/internal/pkg/generate/generate_scripts_test.go @@ -293,16 +293,21 @@ func generateTestCases(t *testing.T) (tests []genTestData) { }, CheckFunctions: []CheckFunc{defaultFunc, checkOnlyConsensus, checkValidatorBlocker}, }, - genTestData{ - Description: fmt.Sprintf(baseDescription+"validator: %s, network: %s, only validator", consensusCl, network), - GenerationData: &GenData{ - ValidatorClient: &clients.Client{Name: consensusCl}, - Network: network, - Services: []string{validator}, - }, - CheckFunctions: []CheckFunc{defaultFunc, checkOnlyValidator, checkValidatorBlocker}, - }, ) + // Only add the "only validator" test case if consensus client is not "grandine" + if consensusCl != "grandine" { + tests = append(tests, + genTestData{ + Description: fmt.Sprintf(baseDescription+"validator: %s, network: %s, only validator", consensusCl, network), + GenerationData: &GenData{ + ValidatorClient: &clients.Client{Name: consensusCl}, + Network: network, + Services: []string{validator}, + }, + CheckFunctions: []CheckFunc{defaultFunc, checkOnlyValidator, checkValidatorBlocker}, + }, + ) + } if utils.Contains(validatorClients, consensusCl) { tests = append(tests, genTestData{ From 4aca059b2dd83fbbd2c5f139c7e9d9cb3b7d928d Mon Sep 17 00:00:00 2001 From: Haneen Khalifa Date: Thu, 30 May 2024 15:58:49 +0300 Subject: [PATCH 10/11] style: adjust formatting --- internal/pkg/generate/generate_scripts_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/pkg/generate/generate_scripts_test.go b/internal/pkg/generate/generate_scripts_test.go index 9c911c18d..c3023a1f0 100644 --- a/internal/pkg/generate/generate_scripts_test.go +++ b/internal/pkg/generate/generate_scripts_test.go @@ -307,7 +307,7 @@ func generateTestCases(t *testing.T) (tests []genTestData) { CheckFunctions: []CheckFunc{defaultFunc, checkOnlyValidator, checkValidatorBlocker}, }, ) - } + } if utils.Contains(validatorClients, consensusCl) { tests = append(tests, genTestData{ From da4ccd0fc4140b67b5d8953e958a66b3fa0f74d5 Mon Sep 17 00:00:00 2001 From: Haneen Khalifa Date: Thu, 30 May 2024 19:04:12 +0300 Subject: [PATCH 11/11] test: adjust TestGenerateDockerCompose only_validator test cases for Grandine --- cli/actions/generation_test.go | 59 ++++++++++--------- .../services/merge/consensus/grandine.tmpl | 5 +- 2 files changed, 35 insertions(+), 29 deletions(-) diff --git a/cli/actions/generation_test.go b/cli/actions/generation_test.go index af6896b9b..ded55fdc0 100644 --- a/cli/actions/generation_test.go +++ b/cli/actions/generation_test.go @@ -155,36 +155,41 @@ func TestGenerateDockerCompose(t *testing.T) { ExecutionAuthUrl: "http://localhost:8551", }, }, - genTestData{ - name: fmt.Sprintf("validator: %s, network: %s, only validator", consensusCl, network), - genData: generate.GenData{ - ValidatorClient: &clients.Client{Name: consensusCl, Type: "validator"}, - Services: []string{"validator"}, - Network: network, - ConsensusApiUrl: "http://localhost:4000", + ) + // Only add the "only validator" test case if consensus client is not "grandine" + if consensusCl != "grandine" { + tests = append(tests, + genTestData{ + name: fmt.Sprintf("validator: %s, network: %s, only validator", consensusCl, network), + genData: generate.GenData{ + ValidatorClient: &clients.Client{Name: consensusCl, Type: "validator"}, + Services: []string{"validator"}, + Network: network, + ConsensusApiUrl: "http://localhost:4000", + }, }, - }, - genTestData{ - name: fmt.Sprintf("validator: %s, network: %s, only validator, mev-boost on", consensusCl, network), - genData: generate.GenData{ - ValidatorClient: &clients.Client{Name: consensusCl, Type: "validator"}, - Services: []string{"validator"}, - Network: network, - ConsensusApiUrl: "http://localhost:4000", - MevBoostOnValidator: true, + genTestData{ + name: fmt.Sprintf("validator: %s, network: %s, only validator, mev-boost on", consensusCl, network), + genData: generate.GenData{ + ValidatorClient: &clients.Client{Name: consensusCl, Type: "validator"}, + Services: []string{"validator"}, + Network: network, + ConsensusApiUrl: "http://localhost:4000", + MevBoostOnValidator: true, + }, }, - }, - genTestData{ - name: fmt.Sprintf("validator: %s, network: %s, only validator with tag, https", consensusCl, network), - genData: generate.GenData{ - ValidatorClient: &clients.Client{Name: consensusCl, Type: "validator"}, - Services: []string{"validator"}, - Network: network, - ContainerTag: "sampleTag", - ConsensusApiUrl: "https://localhost:4000", + genTestData{ + name: fmt.Sprintf("validator: %s, network: %s, only validator with tag, https", consensusCl, network), + genData: generate.GenData{ + ValidatorClient: &clients.Client{Name: consensusCl, Type: "validator"}, + Services: []string{"validator"}, + Network: network, + ContainerTag: "sampleTag", + ConsensusApiUrl: "https://localhost:4000", + }, }, - }, - ) + ) + } if utils.Contains(validatorClients, consensusCl) { tests = append(tests, genTestData{ diff --git a/templates/services/merge/consensus/grandine.tmpl b/templates/services/merge/consensus/grandine.tmpl index b1451c242..c9d803729 100644 --- a/templates/services/merge/consensus/grandine.tmpl +++ b/templates/services/merge/consensus/grandine.tmpl @@ -32,8 +32,9 @@ - --http-address=0.0.0.0 - --http-port={{.ClApiPort}}{{if not .CustomConsensusConfigs}} - --network={{if .SplittedNetwork}}${CL_NETWORK}{{else}}${NETWORK}{{end}}{{end}} - - --timeout=10000{{range $flag := .ClExtraFlags}} - - --{{$flag}}{{end}}{{if .MevBoostEndpoint}} + - --metrics + - --metrics-port={{.ClMetricsPort}} + - --metrics-address=0.0.0.0{{if or .ClCheckpointSyncUrl .CheckpointSyncUrl}} - --checkpoint-sync-url={{if .CheckpointSyncUrl}}{{ .CheckpointSyncUrl }}{{else}}${CHECKPOINT_SYNC_URL}{{end}}{{end}}{{range $flag := .ClExtraFlags}} - --{{$flag}}{{end}}{{if .MevBoostEndpoint}} - --builder={{.MevBoostEndpoint}}{{end}}{{if .LoggingDriver}}