diff --git a/CHANGELOG.md b/CHANGELOG.md index 50a8cc7cf..7591762f6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,11 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## Unreleased +## [Unreleased] + +### Added + +- Support for Erigon in Gnosis ### Fixed diff --git a/internal/pkg/clients/clients_test.go b/internal/pkg/clients/clients_test.go index fbd185682..ddb40428b 100644 --- a/internal/pkg/clients/clients_test.go +++ b/internal/pkg/clients/clients_test.go @@ -30,7 +30,7 @@ func TestSupportedClients(t *testing.T) { want []string isErr bool }{ - {"execution", "gnosis", []string{"nethermind"}, false}, + {"execution", "gnosis", []string{"nethermind", "erigon"}, false}, {"consensus", "gnosis", utils.Filter(AllClients["consensus"], func(c string) bool { return c != "prysm" }), false}, {"execution", "mainnet", AllClients["execution"], false}, {"consensus", "mainnet", AllClients["consensus"], false}, @@ -132,7 +132,7 @@ func TestClients(t *testing.T) { map[string][]string{ "validator": {"lighthouse", "teku", "lodestar"}, "consensus": {"lighthouse", "teku", "lodestar"}, - "execution": {"nethermind"}, + "execution": {"nethermind", "erigon"}, }, []string{"consensus", "execution", "validator"}, "gnosis", diff --git a/internal/pkg/generate/envs_test.go b/internal/pkg/generate/envs_test.go index 96858a24d..36fc0eec4 100644 --- a/internal/pkg/generate/envs_test.go +++ b/internal/pkg/generate/envs_test.go @@ -178,6 +178,26 @@ func TestGenerateEnvFile(t *testing.T) { "KEYSTORE_DIR": "./keystore", }, }, + { + name: "Check Erigon for Gnosis network", + data: &GenData{ + ExecutionClient: &clients.Client{Name: "erigon"}, + Network: "gnosis", + }, + fieldsToCheck: map[string]string{ + "EL_NETWORK": "gnosis", + }, + }, + { + name: "Check Nethermind for Gnosis network", + data: &GenData{ + ExecutionClient: &clients.Client{Name: "nethermind"}, + Network: "gnosis", + }, + fieldsToCheck: map[string]string{ + "EL_NETWORK": "xdai", + }, + }, { name: "Check wrong network", data: &GenData{ @@ -203,7 +223,6 @@ func TestGenerateEnvFile(t *testing.T) { ConsensusClient: &clients.Client{Name: "teku"}, }, fieldsToCheck: map[string]string{ - "EL_NETWORK": "xdai", "CL_NETWORK": "gnosis", }, }, diff --git a/internal/pkg/generate/generate_scripts_test.go b/internal/pkg/generate/generate_scripts_test.go index 10b44bcf7..f12ed6fbf 100644 --- a/internal/pkg/generate/generate_scripts_test.go +++ b/internal/pkg/generate/generate_scripts_test.go @@ -245,12 +245,19 @@ func defaultFunc(t *testing.T, data *GenData, compose, env io.Reader) error { envData := retrieveEnvData(t, env) if data.Network == "gnosis" { // Check that the right network is set - assert.Contains(t, envData, "EL_NETWORK") - assert.Equal(t, "xdai", clean(envData["EL_NETWORK"])) - - assert.Contains(t, envData, "CL_NETWORK") - assert.Equal(t, "gnosis", clean(envData["CL_NETWORK"])) + if data.ExecutionClient != nil { + assert.Contains(t, envData, "EL_NETWORK") + if data.ExecutionClient.Name == "nethermind" { + assert.Equal(t, "xdai", clean(envData["EL_NETWORK"])) + } else { + assert.Equal(t, "gnosis", clean(envData["EL_NETWORK"])) + } + } + if data.ConsensusClient != nil { + assert.Contains(t, envData, "CL_NETWORK") + assert.Equal(t, "gnosis", clean(envData["CL_NETWORK"])) + } } else { // Check that the right network is set assert.Contains(t, envData, "NETWORK") diff --git a/templates/envs/gnosis/env_base.tmpl b/templates/envs/gnosis/env_base.tmpl index 0ac010be0..f921ef97a 100644 --- a/templates/envs/gnosis/env_base.tmpl +++ b/templates/envs/gnosis/env_base.tmpl @@ -1,7 +1,7 @@ {{/* docker-compose_base.tmpl */}} {{ define "env" }} # --- Global configuration --- -EL_NETWORK=xdai +EL_NETWORK=gnosis CL_NETWORK=gnosis {{if .FeeRecipient}} FEE_RECIPIENT={{.FeeRecipient}}{{end}} diff --git a/templates/envs/gnosis/execution/erigon.tmpl b/templates/envs/gnosis/execution/erigon.tmpl new file mode 100644 index 000000000..d59695f92 --- /dev/null +++ b/templates/envs/gnosis/execution/erigon.tmpl @@ -0,0 +1,7 @@ +{{/* erigon.tmpl */}} +{{ define "execution" }} +# --- Execution Layer - Execution Node - configuration --- +EC_IMAGE_VERSION={{.ElImage}} +EC_DATA_DIR={{.ElDataDir}} +EC_JWT_SECRET_PATH={{.JWTSecretPath}} +{{ end }} diff --git a/templates/envs/gnosis/execution/nethermind.tmpl b/templates/envs/gnosis/execution/nethermind.tmpl index 25a605fbc..430f2c824 100644 --- a/templates/envs/gnosis/execution/nethermind.tmpl +++ b/templates/envs/gnosis/execution/nethermind.tmpl @@ -1,5 +1,7 @@ {{/* nethermind.tmpl */}} {{ define "execution" }} +EL_NETWORK=xdai + # --- Execution Layer - Execution Node - configuration --- EC_IMAGE_VERSION={{.ElImage}} NETHERMIND_LOG_LEVEL=INFO