Skip to content

Commit aef9c30

Browse files
committed
ir: move fschain_autodeploy out of top level
New `fschain.disable_autodeploy` IR configuration, which inverts the value of the `fschain_autodeploy` option. Make `fschain_autodeploy` default to `true`, support it for one more release. Closes #3361. Signed-off-by: Andrey Butusov <[email protected]>
1 parent 2a76d31 commit aef9c30

File tree

8 files changed

+34
-12
lines changed

8 files changed

+34
-12
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ Changelog for NeoFS Node
3030
- Move processing of expired objects from the epoch event handler to the regular GC cycle (#3582)
3131
- More compact EACL table representation in neofs-cli acl extended print command (#3597)
3232
- Storage node returns new Busy/Incomplete/BadRequest status codes when appropriate (#3606)
33+
- New `fschain.disable_autodeploy` configuration option for IR instead of `fschain_autodeploy` (#3619)
3334

3435
### Removed
3536
- `neofs-cli object head --main-only` no-op flag (#3509)
@@ -64,6 +65,9 @@ Drop `--main-only` flag from all `neofs-cli object head` commands.
6465
Drop IR's `timers.stop_estimation.*` and `timers.distribute_basic_income` configuration values, they are not used anymore.
6566
`neofs-adm fschain estimations` was removed.
6667

68+
Use new `fschain.disable_autodeploy` IR configuration option instead of deprecated `fschain_autodeploy`,
69+
that was removed in next release.
70+
6771
## [0.48.3] - 2025-08-14
6872

6973
### Fixed

cmd/neofs-ir/defaults.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,8 @@ func defaultConfiguration(cfg *viper.Viper) {
6565
cfg.SetDefault("fschain.reconnections_delay", 5*time.Second)
6666
cfg.SetDefault("fschain.validators", []string{})
6767

68+
cfg.SetDefault("fschain_autodeploy", true)
69+
6870
cfg.SetDefault("mainnet.dial_timeout", time.Minute)
6971
cfg.SetDefault("mainnet.reconnections_number", 5)
7072
cfg.SetDefault("mainnet.reconnections_delay", 5*time.Second)

cmd/neofs-ir/defaults_test.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,10 @@ func TestValidateDefaultConfig(t *testing.T) {
2626
ReconnectionsNumber: 5,
2727
ReconnectionsDelay: 5000000000,
2828
},
29-
Validators: keys.PublicKeys{},
29+
DisableAutodeploy: false,
30+
Validators: keys.PublicKeys{},
3031
},
31-
FSChainAutodeploy: false,
32+
FSChainAutodeploy: true,
3233
NNS: config.NNS{SystemEmail: ""},
3334
Mainnet: config.BasicChain{
3435
DialTimeout: 60000000000,

cmd/neofs-ir/validate_test.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,8 @@ func TestCheckForUnknownFieldsExample(t *testing.T) {
192192
"wss://sidechain2.fs.neo.org:30333/ws",
193193
},
194194
},
195-
Validators: validators,
195+
DisableAutodeploy: true,
196+
Validators: validators,
196197
Consensus: config.Consensus{
197198
Magic: 15405,
198199
Committee: committee,
@@ -248,7 +249,7 @@ func TestCheckForUnknownFieldsExample(t *testing.T) {
248249
RemoveUntraceableBlocks: false,
249250
P2PNotaryRequestPayloadPoolSize: 100,
250251
}},
251-
FSChainAutodeploy: true,
252+
FSChainAutodeploy: false,
252253
NNS: config.NNS{
253254
SystemEmail: "[email protected]",
254255
},

config/example/ir.env

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ NEOFS_IR_WALLET_PASSWORD=secret
88

99
NEOFS_IR_WITHOUT_MAINNET=false
1010

11+
NEOFS_IR_FSCHAIN_DISABLE_AUTODEPLOY=true
1112
NEOFS_IR_FSCHAIN_DIAL_TIMEOUT=1m
1213
NEOFS_IR_FSCHAIN_RECONNECTIONS_NUMBER=5
1314
NEOFS_IR_FSCHAIN_RECONNECTIONS_DELAY=5s

config/example/ir.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ wallet:
1616
without_mainnet: false # Run application in single chain environment without mainchain
1717

1818
fschain:
19+
disable_autodeploy: true # Optional flag to disable auto-deployment procedure of the FS chain; defaults to 'false'
1920
dial_timeout: 1m # Timeout for RPC client connection to sidechain
2021
reconnections_number: 5 # number of reconnection attempts
2122
reconnections_delay: 5s # time delay b/w reconnection attempts
@@ -109,8 +110,7 @@ fschain:
109110
p2p_notary_request_payload_pool_size: 100 # Optional size of the node's P2P Notary request payloads memory pool.
110111
# Defaults to 1000. Must be unsigned integer in range [1:2147483647].
111112

112-
fschain_autodeploy: true # Optional flag to run auto-deployment procedure of the FS chain. By default,
113-
# the chain is expected to be deployed/updated in the background (e.g. via NeoFS ADM tool).
113+
fschain_autodeploy: false # Optional flag to run auto-deployment procedure of the FS chain. By default, 'true'.
114114
# If set, must be 'true' or 'false'.
115115

116116
nns: # Optional configuration of the NNS domains processed during the FS chain deployment

pkg/innerring/config/fschain.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,10 @@ import (
88

99
// Chain configures settings of FS chain.
1010
type Chain struct {
11-
BasicChain `mapstructure:",squash"`
12-
Validators keys.PublicKeys `mapstructure:"validators"`
13-
Consensus Consensus `mapstructure:"consensus"`
11+
BasicChain `mapstructure:",squash"`
12+
Validators keys.PublicKeys `mapstructure:"validators"`
13+
Consensus Consensus `mapstructure:"consensus"`
14+
DisableAutodeploy bool `mapstructure:"disable_autodeploy"`
1415
}
1516

1617
// Consensus configures Blockchain. All required fields must be set. Specified

pkg/innerring/innerring.go

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -418,6 +418,18 @@ func New(ctx context.Context, log *zap.Logger, cfg *config.Config, errChan chan<
418418

419419
serveMetrics(server, cfg)
420420

421+
// TODO: remove deprecated option in future releases
422+
if cfg.IsSet("fschain_autodeploy") && cfg.IsSet("fschain.disable_autodeploy") &&
423+
cfg.FSChain.DisableAutodeploy == cfg.FSChainAutodeploy {
424+
return nil, fmt.Errorf("fschain_autodeploy and fschain.disable_autodeploy set simultaneously to the same value")
425+
}
426+
if cfg.IsSet("fschain_autodeploy") {
427+
log.Warn("configuration option 'fschain_autodeploy' is deprecated, use 'fschain.disable_autodeploy' with the opposite value instead")
428+
if !cfg.IsSet("fschain.disable_autodeploy") {
429+
cfg.FSChain.DisableAutodeploy = !cfg.FSChainAutodeploy
430+
}
431+
}
432+
421433
var localWSClient *rpcclient.WSClient // set if isLocalConsensus only
422434

423435
// create FS chain client
@@ -472,7 +484,7 @@ func New(ctx context.Context, log *zap.Logger, cfg *config.Config, errChan chan<
472484
fsChainOpts[1] = client.WithLogger(log)
473485
fsChainOpts[2] = client.WithSingleClient(localWSClient)
474486

475-
if !cfg.FSChainAutodeploy {
487+
if cfg.FSChain.DisableAutodeploy {
476488
fsChainOpts = append(fsChainOpts, client.WithAutoFSChainScope())
477489
}
478490

@@ -488,15 +500,15 @@ func New(ctx context.Context, log *zap.Logger, cfg *config.Config, errChan chan<
488500
// fallback to the pure RPC architecture
489501

490502
fsChainParams.key = server.key
491-
fsChainParams.withAutoFSChainScope = !cfg.FSChainAutodeploy
503+
fsChainParams.withAutoFSChainScope = cfg.FSChain.DisableAutodeploy
492504

493505
server.fsChainClient, err = server.createClient(ctx, fsChainParams, errChan)
494506
if err != nil {
495507
return nil, err
496508
}
497509
}
498510

499-
if cfg.FSChainAutodeploy {
511+
if !cfg.FSChain.DisableAutodeploy {
500512
log.Info("auto-deployment configured, initializing FS chain...")
501513

502514
var fschain *fsChain

0 commit comments

Comments
 (0)