diff --git a/CHANGELOG.md b/CHANGELOG.md index d0264d4c9..7168411f0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,7 +15,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed -- Disabled the `authority-claimer` when `CARTESI_EXPERIMENTAL_SUNODO_VALIDATOR_ENABLED` is set to `true`. - Redacted the contents of `CARTESI_EXPERIMENTAL_SUNODO_VALIDATOR_REDIS_ENDPOINT`. ## [1.5.0] 2024-07-22 diff --git a/docs/config.md b/docs/config.md index d0882e3c0..1a1b52639 100644 --- a/docs/config.md +++ b/docs/config.md @@ -151,7 +151,7 @@ All other log configurations are ignored. ## `CARTESI_EXPERIMENTAL_SUNODO_VALIDATOR_ENABLED` -When enabled, the node does not start the authority-claimer service and the Redis server, thus not making claims. +When enabled, the node does not start Redis and should be configured with an external Redis endpoint. * **Type:** `bool` * **Default:** `"false"` @@ -164,7 +164,7 @@ External Redis endpoint for the node when running in the experimental sunodo val ## `CARTESI_FEATURE_DISABLE_CLAIMER` -If set to true, the node will not make claims. +If set to true, the authority-claimer service is disabled. * **Type:** `bool` * **Default:** `"false"` diff --git a/internal/node/config/config.go b/internal/node/config/config.go index cc76bdd59..a1cce3a00 100644 --- a/internal/node/config/config.go +++ b/internal/node/config/config.go @@ -99,10 +99,10 @@ func FromEnv() NodeConfig { config.FeatureDisableClaimer = getFeatureDisableClaimer() config.FeatureReaderModeEnabled = getFeatureReaderModeEnabled() config.ExperimentalSunodoValidatorEnabled = getExperimentalSunodoValidatorEnabled() + // The experimental mode overrides the reader mode and claimer configuration if config.ExperimentalSunodoValidatorEnabled { config.ExperimentalSunodoValidatorRedisEndpoint = Redacted[string]{getExperimentalSunodoValidatorRedisEndpoint()} - config.FeatureDisableClaimer = true } if !config.FeatureDisableClaimer && !getExperimentalSunodoValidatorEnabled() { config.Auth = authFromEnv() diff --git a/internal/node/config/config_test.go b/internal/node/config/config_test.go index eaeb88899..b41de8284 100644 --- a/internal/node/config/config_test.go +++ b/internal/node/config/config_test.go @@ -31,13 +31,6 @@ func TestConfigTest(t *testing.T) { suite.Run(t, new(ConfigTestSuite)) } -func (s *ConfigTestSuite) TestExperimentalSunodoValidatorModeDisablesClaimer() { - os.Setenv("CARTESI_EXPERIMENTAL_SUNODO_VALIDATOR_ENABLED", "true") - os.Setenv("CARTESI_EXPERIMENTAL_SUNODO_VALIDATOR_REDIS_ENDPOINT", "redis://") - c := FromEnv() - assert.Equal(s.T(), true, c.FeatureDisableClaimer) -} - func (s *ConfigTestSuite) TestAuthIsNotSetWhenClaimerIsDisabled() { os.Setenv("CARTESI_FEATURE_DISABLE_CLAIMER", "true") c := FromEnv() @@ -45,9 +38,13 @@ func (s *ConfigTestSuite) TestAuthIsNotSetWhenClaimerIsDisabled() { } func (s *ConfigTestSuite) TestExperimentalSunodoValidatorRedisEndpointIsRedacted() { + enableSunodoValidatorMode() + c := FromEnv() + assert.Equal(s.T(), "[REDACTED]", c.ExperimentalSunodoValidatorRedisEndpoint.String()) +} + +func enableSunodoValidatorMode() { os.Setenv("CARTESI_EXPERIMENTAL_SUNODO_VALIDATOR_ENABLED", "true") os.Setenv("CARTESI_EXPERIMENTAL_SUNODO_VALIDATOR_REDIS_ENDPOINT", "redis://username:p@ssw0rd@hostname:9999") - c := FromEnv() - assert.Equal(s.T(), "[REDACTED]", c.ExperimentalSunodoValidatorRedisEndpoint.String()) } diff --git a/internal/node/config/generate/Config.toml b/internal/node/config/generate/Config.toml index 5139a1e3c..5fb6348c5 100644 --- a/internal/node/config/generate/Config.toml +++ b/internal/node/config/generate/Config.toml @@ -38,7 +38,7 @@ If set to true, the node will not generating any claims.""" default = "false" go-type = "bool" description = """ -If set to true, the node will not make claims.""" +If set to true, the authority-claimer service is disabled.""" [features.CARTESI_FEATURE_DISABLE_MACHINE_HASH_CHECK] default = "false" @@ -231,7 +231,7 @@ The node will also use the 20 ports after this one for internal services.""" default = "false" go-type = "bool" description = """ -When enabled, the node does not start the authority-claimer service and the Redis server, thus not making claims.""" +When enabled, the node does not start Redis and should be configured with an external Redis endpoint.""" [experimental.CARTESI_EXPERIMENTAL_SUNODO_VALIDATOR_REDIS_ENDPOINT] go-type = "string"