From beabed788c72fe473cafe54b5afac110f7f82532 Mon Sep 17 00:00:00 2001 From: Pavel Karpy Date: Fri, 14 Apr 2023 14:51:13 +0300 Subject: [PATCH] [#247] network_config: Drop reputation Drop the code that was expected to work with global reputation network parameters. Signed-off-by: Pavel Karpy --- .../internal/modules/morph/config.go | 13 ------- .../modules/morph/initialize_deploy.go | 5 --- .../internal/modules/morph/netmap_util.go | 2 -- cmd/frostfs-cli/modules/netmap/netinfo.go | 2 -- cmd/frostfs-node/netmap.go | 2 -- pkg/morph/client/netmap/config.go | 36 ------------------- 6 files changed, 60 deletions(-) diff --git a/cmd/frostfs-adm/internal/modules/morph/config.go b/cmd/frostfs-adm/internal/modules/morph/config.go index 3a60e7197..09d071b53 100644 --- a/cmd/frostfs-adm/internal/modules/morph/config.go +++ b/cmd/frostfs-adm/internal/modules/morph/config.go @@ -56,15 +56,12 @@ func dumpNetworkConfig(cmd *cobra.Command, _ []string) error { switch k { case netmap.AuditFeeConfig, netmap.BasicIncomeRateConfig, netmap.ContainerFeeConfig, netmap.ContainerAliasFeeConfig, - netmap.EtIterationsConfig, netmap.EpochDurationConfig, netmap.IrCandidateFeeConfig, netmap.MaxObjectSizeConfig, netmap.WithdrawFeeConfig: nbuf := make([]byte, 8) copy(nbuf[:], v) n := binary.LittleEndian.Uint64(nbuf) _, _ = tw.Write([]byte(fmt.Sprintf("%s:\t%d (int)\n", k, n))) - case netmap.EtAlphaConfig: - _, _ = tw.Write([]byte(fmt.Sprintf("%s:\t%s (str)\n", k, v))) case netmap.HomomorphicHashingDisabledKey, netmap.MaintenanceModeAllowedConfig: if len(v) == 0 || len(v) > 1 { return invalidConfigValueErr(k) @@ -139,22 +136,12 @@ func parseConfigPair(kvStr string, force bool) (key string, val any, err error) switch key { case netmap.AuditFeeConfig, netmap.BasicIncomeRateConfig, netmap.ContainerFeeConfig, netmap.ContainerAliasFeeConfig, - netmap.EtIterationsConfig, netmap.EpochDurationConfig, netmap.IrCandidateFeeConfig, netmap.MaxObjectSizeConfig, netmap.WithdrawFeeConfig: val, err = strconv.ParseInt(valRaw, 10, 64) if err != nil { err = fmt.Errorf("could not parse %s's value '%s' as int: %w", key, valRaw, err) } - case netmap.EtAlphaConfig: - // just check that it could - // be parsed correctly - _, err = strconv.ParseFloat(v, 64) - if err != nil { - err = fmt.Errorf("could not parse %s's value '%s' as float: %w", key, valRaw, err) - } - - val = valRaw case netmap.HomomorphicHashingDisabledKey, netmap.MaintenanceModeAllowedConfig: val, err = strconv.ParseBool(valRaw) if err != nil { diff --git a/cmd/frostfs-adm/internal/modules/morph/initialize_deploy.go b/cmd/frostfs-adm/internal/modules/morph/initialize_deploy.go index 156b1f788..9a15b69ba 100644 --- a/cmd/frostfs-adm/internal/modules/morph/initialize_deploy.go +++ b/cmd/frostfs-adm/internal/modules/morph/initialize_deploy.go @@ -50,11 +50,6 @@ const ( subnetContract = "subnet" ) -const ( - defaultEigenTrustIterations = 4 - defaultEigenTrustAlpha = "0.1" -) - var ( contractList = []string{ auditContract, diff --git a/cmd/frostfs-adm/internal/modules/morph/netmap_util.go b/cmd/frostfs-adm/internal/modules/morph/netmap_util.go index 4b6de5bd2..23cfd120c 100644 --- a/cmd/frostfs-adm/internal/modules/morph/netmap_util.go +++ b/cmd/frostfs-adm/internal/modules/morph/netmap_util.go @@ -15,8 +15,6 @@ func getDefaultNetmapContractConfigMap() map[string]any { m[netmap.AuditFeeConfig] = viper.GetInt64(auditFeeInitFlag) m[netmap.ContainerFeeConfig] = viper.GetInt64(containerFeeInitFlag) m[netmap.ContainerAliasFeeConfig] = viper.GetInt64(containerAliasFeeInitFlag) - m[netmap.EtIterationsConfig] = int64(defaultEigenTrustIterations) - m[netmap.EtAlphaConfig] = defaultEigenTrustAlpha m[netmap.BasicIncomeRateConfig] = viper.GetInt64(incomeRateInitFlag) m[netmap.IrCandidateFeeConfig] = viper.GetInt64(candidateFeeInitFlag) m[netmap.WithdrawFeeConfig] = viper.GetInt64(withdrawFeeInitFlag) diff --git a/cmd/frostfs-cli/modules/netmap/netinfo.go b/cmd/frostfs-cli/modules/netmap/netinfo.go index f34456c71..17acfd59c 100644 --- a/cmd/frostfs-cli/modules/netmap/netinfo.go +++ b/cmd/frostfs-cli/modules/netmap/netinfo.go @@ -41,8 +41,6 @@ var netInfoCmd = &cobra.Command{ cmd.Printf(format, "Audit fee", netInfo.AuditFee()) cmd.Printf(format, "Storage price", netInfo.StoragePrice()) cmd.Printf(format, "Container fee", netInfo.ContainerFee()) - cmd.Printf(format, "EigenTrust alpha", netInfo.EigenTrustAlpha()) - cmd.Printf(format, "Number of EigenTrust iterations", netInfo.NumberOfEigenTrustIterations()) cmd.Printf(format, "Epoch duration", netInfo.EpochDuration()) cmd.Printf(format, "Inner Ring candidate fee", netInfo.IRCandidateFee()) cmd.Printf(format, "Maximum object size", netInfo.MaxObjectSize()) diff --git a/cmd/frostfs-node/netmap.go b/cmd/frostfs-node/netmap.go index 76cceeb6d..b8a25cb8c 100644 --- a/cmd/frostfs-node/netmap.go +++ b/cmd/frostfs-node/netmap.go @@ -451,8 +451,6 @@ func (n *netInfo) Dump(ver version.Version) (*netmapSDK.NetworkInfo, error) { ni.SetEpochDuration(netInfoMorph.EpochDuration) ni.SetContainerFee(netInfoMorph.ContainerFee) ni.SetNamedContainerFee(netInfoMorph.ContainerAliasFee) - ni.SetNumberOfEigenTrustIterations(netInfoMorph.EigenTrustIterations) - ni.SetEigenTrustAlpha(netInfoMorph.EigenTrustAlpha) ni.SetIRCandidateFee(netInfoMorph.IRCandidateFee) ni.SetWithdrawalFee(netInfoMorph.WithdrawalFee) diff --git a/pkg/morph/client/netmap/config.go b/pkg/morph/client/netmap/config.go index 3011bd541..71ffa2a7a 100644 --- a/pkg/morph/client/netmap/config.go +++ b/pkg/morph/client/netmap/config.go @@ -3,7 +3,6 @@ package netmap import ( "errors" "fmt" - "strconv" "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/morph/client" "github.com/nspcc-dev/neo-go/pkg/encoding/bigint" @@ -17,8 +16,6 @@ const ( EpochDurationConfig = "EpochDuration" ContainerFeeConfig = "ContainerFee" ContainerAliasFeeConfig = "ContainerAliasFee" - EtIterationsConfig = "EigenTrustIterations" - EtAlphaConfig = "EigenTrustAlpha" IrCandidateFeeConfig = "InnerRingCandidateFee" WithdrawFeeConfig = "WithdrawFee" HomomorphicHashingDisabledKey = "HomomorphicHashingDisabled" @@ -90,28 +87,6 @@ func (c *Client) ContainerAliasFee() (uint64, error) { return fee, nil } -// EigenTrustIterations returns global configuration value of iteration cycles -// for EigenTrust algorithm per epoch. -func (c *Client) EigenTrustIterations() (uint64, error) { - iterations, err := c.readUInt64Config(EtIterationsConfig) - if err != nil { - return 0, fmt.Errorf("(%T) could not get eigen trust iterations: %w", c, err) - } - - return iterations, nil -} - -// EigenTrustAlpha returns global configuration value of alpha parameter. -// It receives the alpha as a string and tries to convert it to float. -func (c *Client) EigenTrustAlpha() (float64, error) { - strAlpha, err := c.readStringConfig(EtAlphaConfig) - if err != nil { - return 0, fmt.Errorf("(%T) could not get eigen trust alpha: %w", c, err) - } - - return strconv.ParseFloat(strAlpha, 64) -} - // HomomorphicHashDisabled returns global configuration value of homomorphic hashing // settings. // @@ -246,10 +221,6 @@ type NetworkConfiguration struct { ContainerAliasFee uint64 - EigenTrustIterations uint64 - - EigenTrustAlpha float64 - IRCandidateFee uint64 WithdrawalFee uint64 @@ -311,13 +282,6 @@ func (c *Client) ReadNetworkConfiguration() (NetworkConfiguration, error) { res.ContainerFee = bytesToUint64(value) case ContainerAliasFeeConfig: res.ContainerAliasFee = bytesToUint64(value) - case EtIterationsConfig: - res.EigenTrustIterations = bytesToUint64(value) - case EtAlphaConfig: - res.EigenTrustAlpha, err = strconv.ParseFloat(string(value), 64) - if err != nil { - return fmt.Errorf("invalid prm %s: %v", EtAlphaConfig, err) - } case IrCandidateFeeConfig: res.IRCandidateFee = bytesToUint64(value) case WithdrawFeeConfig: