forked from TrueCloudLab/frostfs-node
[#247] network_config: Drop reputation
Drop the code that was expected to work with global reputation network parameters. Signed-off-by: Pavel Karpy <p.karpy@yadro.com>
This commit is contained in:
parent
b453bb754c
commit
beabed788c
6 changed files with 0 additions and 60 deletions
|
@ -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 {
|
||||
|
|
|
@ -50,11 +50,6 @@ const (
|
|||
subnetContract = "subnet"
|
||||
)
|
||||
|
||||
const (
|
||||
defaultEigenTrustIterations = 4
|
||||
defaultEigenTrustAlpha = "0.1"
|
||||
)
|
||||
|
||||
var (
|
||||
contractList = []string{
|
||||
auditContract,
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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())
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
|
|
@ -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:
|
||||
|
|
Loading…
Reference in a new issue