diff --git a/cmd/neofs-cli/modules/netmap/netinfo.go b/cmd/neofs-cli/modules/netmap/netinfo.go index 9e230aa66c..a3cf04adc7 100644 --- a/cmd/neofs-cli/modules/netmap/netinfo.go +++ b/cmd/neofs-cli/modules/netmap/netinfo.go @@ -47,6 +47,7 @@ var netInfoCmd = &cobra.Command{ cmd.Printf(format, "Inner Ring candidate fee", netInfo.IRCandidateFee()) cmd.Printf(format, "Maximum object size", netInfo.MaxObjectSize()) cmd.Printf(format, "Withdrawal fee", netInfo.WithdrawalFee()) + cmd.Printf(format, "Homomorphic hashing disabled", netInfo.HomomorphicHashingDisabled()) cmd.Println("NeoFS network configuration (other)") netInfo.IterateRawNetworkParameters(func(name string, value []byte) { diff --git a/cmd/neofs-node/netmap.go b/cmd/neofs-node/netmap.go index a2b62acd80..51914c9f50 100644 --- a/cmd/neofs-node/netmap.go +++ b/cmd/neofs-node/netmap.go @@ -400,6 +400,10 @@ func (n *netInfo) Dump(ver version.Version) (*netmapSDK.NetworkInfo, error) { ni.SetIRCandidateFee(netInfoMorph.IRCandidateFee) ni.SetWithdrawalFee(netInfoMorph.WithdrawalFee) + if netInfoMorph.HomomorphicHashingDisabled { + ni.DisableHomomorphicHashing() + } + for i := range netInfoMorph.Raw { ni.SetRawNetworkParameter(netInfoMorph.Raw[i].Name, netInfoMorph.Raw[i].Value) } diff --git a/pkg/morph/client/netmap/config.go b/pkg/morph/client/netmap/config.go index 0d02a57dab..782148e560 100644 --- a/pkg/morph/client/netmap/config.go +++ b/pkg/morph/client/netmap/config.go @@ -244,6 +244,8 @@ type NetworkConfiguration struct { WithdrawalFee uint64 + HomomorphicHashingDisabled bool + Raw []RawNetworkParameter } @@ -308,6 +310,8 @@ func (c *Client) ReadNetworkConfiguration() (NetworkConfiguration, error) { res.IRCandidateFee = bytesToUint64(value) case withdrawFeeConfig: res.WithdrawalFee = bytesToUint64(value) + case homomorphicHashingDisabledKey: + res.HomomorphicHashingDisabled = bytesToBool(value) } return nil @@ -323,6 +327,16 @@ func bytesToUint64(val []byte) uint64 { return bigint.FromBytes(val).Uint64() } +func bytesToBool(val []byte) bool { + for i := range val { + if val[i] != 0 { + return true + } + } + + return false +} + // ErrConfigNotFound is returned when the requested key was not found // in the network config (returned value is `Null`). var ErrConfigNotFound = errors.New("config value not found")