From 9436fcfc705bd28b0bc28c9b4ff0f4b465b55b90 Mon Sep 17 00:00:00 2001 From: Anton Nikiforov Date: Tue, 12 Dec 2023 12:01:10 +0300 Subject: [PATCH] [#858] morph: Disable kludge by default Signed-off-by: Anton Nikiforov --- cmd/frostfs-ir/config.go | 2 +- cmd/frostfs-ir/main.go | 2 +- cmd/frostfs-node/config.go | 2 +- cmd/frostfs-node/config/morph/config.go | 6 +++--- pkg/morph/client/notary.go | 4 ++-- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/cmd/frostfs-ir/config.go b/cmd/frostfs-ir/config.go index 0e1c5567c..cacdfd1d4 100644 --- a/cmd/frostfs-ir/config.go +++ b/cmd/frostfs-ir/config.go @@ -68,7 +68,7 @@ func watchForSignal(cancel func()) { if err != nil { log.Error(logs.FrostFSNodeConfigurationReading, zap.Error(err)) } - client.KeepInvScript = cfg.GetBool("morph.keepinvscript") + client.CleanInvScript = cfg.GetBool("morph.cleaninvscript") log.Info(logs.FrostFSNodeConfigurationHasBeenReloadedSuccessfully) case syscall.SIGTERM, syscall.SIGINT: log.Info(logs.FrostFSNodeTerminationSignalHasBeenReceivedStopping) diff --git a/cmd/frostfs-ir/main.go b/cmd/frostfs-ir/main.go index d1b1fc5fb..19c84ed15 100644 --- a/cmd/frostfs-ir/main.go +++ b/cmd/frostfs-ir/main.go @@ -61,7 +61,7 @@ func main() { var err error cfg, err = newConfig() exitErr(err) - client.KeepInvScript = cfg.GetBool("morph.keepinvscript") + client.CleanInvScript = cfg.GetBool("morph.cleaninvscript") logPrm.MetricsNamespace = "frostfs_ir" err = logPrm.SetLevelString( diff --git a/cmd/frostfs-node/config.go b/cmd/frostfs-node/config.go index 1a591de32..d74eff476 100644 --- a/cmd/frostfs-node/config.go +++ b/cmd/frostfs-node/config.go @@ -214,7 +214,7 @@ func (a *applicationConfiguration) readConfig(c *config.Config) error { a.EngineCfg.rebuildWorkers = engineconfig.EngineRebuildWorkersCount(c) // Kludge - client.KeepInvScript = morphconfig.KeepInvocationScript(c) + client.CleanInvScript = morphconfig.CleanInvocationScript(c) return engineconfig.IterateShards(c, false, func(sc *shardconfig.Config) error { return a.updateShardConfig(c, sc) }) } diff --git a/cmd/frostfs-node/config/morph/config.go b/cmd/frostfs-node/config/morph/config.go index 2384ad7fb..f429c405b 100644 --- a/cmd/frostfs-node/config/morph/config.go +++ b/cmd/frostfs-node/config/morph/config.go @@ -98,7 +98,7 @@ func SwitchInterval(c *config.Config) time.Duration { return SwitchIntervalDefault } -// KeepInvocationScript this is a kludge purely for update to work. -func KeepInvocationScript(c *config.Config) bool { - return config.Bool(c.Sub(subsection), "keepinvscript") +// CleanInvocationScript this is a kludge purely for update to work. +func CleanInvocationScript(c *config.Config) bool { + return config.Bool(c.Sub(subsection), "cleaninvscript") } diff --git a/pkg/morph/client/notary.go b/pkg/morph/client/notary.go index 817a9f498..65b3e8f27 100644 --- a/pkg/morph/client/notary.go +++ b/pkg/morph/client/notary.go @@ -68,7 +68,7 @@ const ( var errUnexpectedItems = errors.New("invalid number of NEO VM arguments on stack") // This is a kludge purely for update to work. -var KeepInvScript bool +var CleanInvScript bool func defaultNotaryConfig(c *Client) *notaryCfg { return ¬aryCfg{ @@ -421,7 +421,7 @@ func (c *Client) NotarySignAndInvokeTX(mainTx *transaction.Transaction) error { return err } - if !KeepInvScript { + if CleanInvScript { // This is necessary to suppress this check on neo-go side: // https://github.com/nspcc-dev/neo-go/blob/8ed6d97085d3229d4faf56a47bbd6cf73c132a76/pkg/services/notary/notary.go#L538 // This is a kludge purely for update to work.