diff --git a/CHANGELOG.md b/CHANGELOG.md index 016e611c50..11a682281b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,8 @@ Changelog for NeoFS Node ### Fixed ### Removed +- Deprecated `morph.rpc_endpoint` SN and `morph.endpoint.client` IR config sections (#2400) +- `neofs_node_object_epoch` metric for IR and SN (#2347) ### Changed - CLI `--timeout` flag configures whole execution timeout from now (#2124) @@ -23,6 +25,11 @@ on timeout, try increasing the value, for example, twice. Also note that the execution of commands with the `--await` flag and without an explicitly specified time period is now limited to 1 minute. This value can be changed with `--timeout` flag. +Deprecated `morph.rpc_endpoint` SN and `morph.endpoint.client` IR configurations +have been removed. Use `morph.endpoints` for both instead. +Deprecated `neofs_node_object_epoch` metric for IR and SN (the same for both) +has been removed. Use `neofs_node_state_epoch` for SN and `neofs_ir_state_epoch` +for IR instead. ## [0.37.0] - 2023-06-15 - Sogado diff --git a/cmd/neofs-adm/internal/modules/storagecfg/config.go b/cmd/neofs-adm/internal/modules/storagecfg/config.go index 1efe0751b0..3f19e749e0 100644 --- a/cmd/neofs-adm/internal/modules/storagecfg/config.go +++ b/cmd/neofs-adm/internal/modules/storagecfg/config.go @@ -38,9 +38,9 @@ control: morph: dial_timeout: 20s # timeout for side chain NEO RPC client connection cache_ttl: 15s # use TTL cache for side chain GET operations - rpc_endpoint: # side chain N3 RPC endpoints + endpoints: # side chain N3 RPC endpoints {{- range .MorphRPC }} - - address: wss://{{.}}/ws{{end}} + - wss://{{.}}/ws{{end}} {{if not .Relay }} storage: shard_pool_size: 15 # size of per-shard worker pools used for PUT operations diff --git a/cmd/neofs-node/config/morph/config.go b/cmd/neofs-node/config/morph/config.go index a39b8ba0c7..e50d679168 100644 --- a/cmd/neofs-node/config/morph/config.go +++ b/cmd/neofs-node/config/morph/config.go @@ -2,7 +2,6 @@ package morphconfig import ( "fmt" - "strconv" "time" "github.com/nspcc-dev/neofs-node/cmd/neofs-node/config" @@ -30,24 +29,9 @@ const ( // // Throws panic if list is empty. func Endpoints(c *config.Config) []string { - var endpointsDeprecated []string - - sub := c.Sub(subsection).Sub("rpc_endpoint") - for i := 0; ; i++ { - s := sub.Sub(strconv.FormatInt(int64(i), 10)) - addr := config.StringSafe(s, "address") - if addr == "" { - break - } - - endpointsDeprecated = append(endpointsDeprecated, addr) - } - endpoints := config.StringSliceSafe(c.Sub(subsection), "endpoints") - endpoints = append(endpoints, endpointsDeprecated...) - if len(endpoints) == 0 { - panic(fmt.Errorf("no morph chain RPC endpoints, see `morph.rpc_endpoint` section")) + panic(fmt.Errorf("no morph chain RPC endpoints, see `morph.endpoints` section")) } return endpoints } diff --git a/docs/storage-node-configuration.md b/docs/storage-node-configuration.md index 8e31fe9f0c..ad24e680d5 100644 --- a/docs/storage-node-configuration.md +++ b/docs/storage-node-configuration.md @@ -132,9 +132,9 @@ contracts: morph: dial_timeout: 30s cache_ttl: 15s - rpc_endpoint: - - address: wss://rpc1.morph.fs.neo.org:40341/ws - - address: wss://rpc2.morph.fs.neo.org:40341/ws + endpoints: + - wss://rpc1.morph.fs.neo.org:40341/ws + - wss://rpc2.morph.fs.neo.org:40341/ws ``` | Parameter | Type | Default value | Description | diff --git a/pkg/innerring/config.go b/pkg/innerring/config.go index 0315216ab3..464ba962d5 100644 --- a/pkg/innerring/config.go +++ b/pkg/innerring/config.go @@ -22,12 +22,7 @@ import ( // checks if Inner Ring app is configured to be launched in local consensus // mode. func isLocalConsensusMode(cfg *viper.Viper) bool { - const morphRPCSectionDeprecated = "morph.endpoint.client" - // first expression required for ENVs in which nesting breaks - deprecatedNotSet := !cfg.IsSet(morphRPCSectionDeprecated+".0.address") && !cfg.IsSet(morphRPCSectionDeprecated) - actualNotSet := !cfg.IsSet("morph.endpoints") - - return deprecatedNotSet && actualNotSet + return !cfg.IsSet("morph.endpoints") } func parseBlockchainConfig(v *viper.Viper, _logger *logger.Logger) (c blockchain.Config, err error) { diff --git a/pkg/innerring/config_test.go b/pkg/innerring/config_test.go index 1af5a65413..2945c34a3f 100644 --- a/pkg/innerring/config_test.go +++ b/pkg/innerring/config_test.go @@ -401,7 +401,7 @@ func TestIsLocalConsensusMode(t *testing.T) { v.SetEnvPrefix("neofs_ir") v.SetEnvKeyReplacer(strings.NewReplacer(".", "_")) - const envKey = "NEOFS_IR_MORPH_ENDPOINT_CLIENT_0_ADDRESS" + const envKey = "NEOFS_IR_MORPH_ENDPOINTS" err := os.Unsetenv(envKey) require.NoError(t, err) @@ -419,15 +419,14 @@ func TestIsLocalConsensusMode(t *testing.T) { v.SetConfigType("yaml") err := v.ReadConfig(strings.NewReader(` morph: - endpoint: - client: - - address: ws://morph-chain:30333/ws + endpoints: + - ws://morph-chain:30333/ws `)) require.NoError(t, err) require.False(t, isLocalConsensusMode(v)) - resetConfig(t, v, "morph.endpoint.client") + resetConfig(t, v, "morph.endpoints") require.True(t, isLocalConsensusMode(v)) }) diff --git a/pkg/innerring/innerring.go b/pkg/innerring/innerring.go index 5452f381c4..c86727fde7 100644 --- a/pkg/innerring/innerring.go +++ b/pkg/innerring/innerring.go @@ -1019,18 +1019,6 @@ func createListener(ctx context.Context, cli *client.Client, p *chainParams) (ev func createClient(ctx context.Context, p *chainParams, errChan chan<- error) (*client.Client, error) { endpoints := p.cfg.GetStringSlice(p.name + ".endpoints") - - // deprecated endpoints with priorities - section := p.name + ".endpoint.client" - for i := 0; ; i++ { - addr := p.cfg.GetString(fmt.Sprintf("%s.%d.%s", section, i, "address")) - if addr == "" { - break - } - - endpoints = append(endpoints, addr) - } - if len(endpoints) == 0 { return nil, fmt.Errorf("%s chain client endpoints not provided", p.name) } diff --git a/pkg/metrics/innerring.go b/pkg/metrics/innerring.go index 201efac659..9492c29170 100644 --- a/pkg/metrics/innerring.go +++ b/pkg/metrics/innerring.go @@ -1,21 +1,14 @@ package metrics import ( - "fmt" - "github.com/prometheus/client_golang/prometheus" ) const innerRingNameSpace = "neofs_ir" -// FIXME: drop after v0.38.0 release: #2347. -const innerRingNameSpaceDeprecated = storageNodeNameSpace -const innerRingSubsystemDeprecated = objectSubsystem - // InnerRingServiceMetrics contains metrics collected by inner ring. type InnerRingServiceMetrics struct { - epoch prometheus.Gauge - epochDeprecated prometheus.Gauge + epoch prometheus.Gauge } // NewInnerRingMetrics returns new instance of metrics collectors for inner ring. @@ -30,22 +23,12 @@ func NewInnerRingMetrics(version string) InnerRingServiceMetrics { }) prometheus.MustRegister(epoch) - epochDeprecated := prometheus.NewGauge(prometheus.GaugeOpts{ - Namespace: innerRingNameSpaceDeprecated, - Subsystem: innerRingSubsystemDeprecated, - Name: "epoch", - Help: fmt.Sprintf("Current epoch as seen by inner-ring node. DEPRECATED: use [%s_%s_epoch] instead.", innerRingNameSpace, stateSubsystem), - }) - prometheus.MustRegister(epochDeprecated) - return InnerRingServiceMetrics{ - epoch: epoch, - epochDeprecated: epochDeprecated, + epoch: epoch, } } // SetEpoch updates epoch metrics. func (m InnerRingServiceMetrics) SetEpoch(epoch uint64) { m.epoch.Set(float64(epoch)) - m.epochDeprecated.Set(float64(epoch)) } diff --git a/pkg/metrics/metrics.go b/pkg/metrics/metrics.go index debe68eadf..14275d6cdf 100644 --- a/pkg/metrics/metrics.go +++ b/pkg/metrics/metrics.go @@ -1,8 +1,6 @@ package metrics import ( - "fmt" - "github.com/prometheus/client_golang/prometheus" ) @@ -12,8 +10,7 @@ type NodeMetrics struct { objectServiceMetrics engineMetrics stateMetrics - epoch prometheus.Gauge - epochDeprecated prometheus.Gauge + epoch prometheus.Gauge } func NewNodeMetrics(version string) *NodeMetrics { @@ -36,27 +33,15 @@ func NewNodeMetrics(version string) *NodeMetrics { }) prometheus.MustRegister(epoch) - // FIXME: drop after v0.38.0 release: #2347. - const stateSubsystemDeprecated = objectSubsystem - epochDeprecated := prometheus.NewGauge(prometheus.GaugeOpts{ - Namespace: storageNodeNameSpace, - Subsystem: stateSubsystemDeprecated, - Name: "epoch", - Help: fmt.Sprintf("Current epoch as seen by inner-ring node. DEPRECATED: use [%s_%s_epoch] instead.", storageNodeNameSpace, stateSubsystem), - }) - prometheus.MustRegister(epochDeprecated) - return &NodeMetrics{ objectServiceMetrics: objectService, engineMetrics: engine, stateMetrics: state, epoch: epoch, - epochDeprecated: epochDeprecated, } } // SetEpoch updates epoch metric. func (m *NodeMetrics) SetEpoch(epoch uint64) { m.epoch.Set(float64(epoch)) - m.epochDeprecated.Set(float64(epoch)) }