[#56] *: Drop reputation system

Signed-off-by: Pavel Karpy <p.karpy@yadro.com>
This commit is contained in:
Pavel Karpy 2023-04-17 16:03:42 +03:00 committed by fyrchik
parent 237b90f744
commit d0c5d837d2
11 changed files with 0 additions and 1146 deletions

View file

@ -5,7 +5,6 @@ import (
"encoding/binary"
"errors"
"fmt"
"math"
"git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/netmap"
"github.com/nspcc-dev/neo-go/pkg/vm/stackitem"
@ -55,21 +54,11 @@ func (x *NetworkInfo) readFromV2(m netmap.NetworkInfo, checkFieldPresence bool)
err = fmt.Errorf("empty attribute value %s", name)
return true
}
case configEigenTrustAlpha:
var num uint64
num, err = decodeConfigValueUint64(prm.GetValue())
if err == nil {
if alpha := math.Float64frombits(num); alpha < 0 && alpha > 1 {
err = fmt.Errorf("EigenTrust alpha value %0.2f is out of range [0, 1]", alpha)
}
}
case
configAuditFee,
configStoragePrice,
configContainerFee,
configNamedContainerFee,
configEigenTrustNumberOfIterations,
configEpochDuration,
configIRCandidateFee,
configMaxObjSize,
@ -238,12 +227,10 @@ func (x *NetworkInfo) IterateRawNetworkParameters(f func(name string, value []by
default:
f(name, prm.GetValue())
case
configEigenTrustAlpha,
configAuditFee,
configStoragePrice,
configContainerFee,
configNamedContainerFee,
configEigenTrustNumberOfIterations,
configEpochDuration,
configIRCandidateFee,
configMaxObjSize,
@ -394,51 +381,6 @@ func (x NetworkInfo) NamedContainerFee() uint64 {
return x.configUint64(configNamedContainerFee)
}
const configEigenTrustAlpha = "EigenTrustAlpha"
// SetEigenTrustAlpha sets alpha parameter for EigenTrust algorithm used in
// reputation system of the storage nodes. Value MUST be in range [0, 1].
//
// See also EigenTrustAlpha.
func (x *NetworkInfo) SetEigenTrustAlpha(alpha float64) {
if alpha < 0 || alpha > 1 {
panic(fmt.Sprintf("EigenTrust alpha parameter MUST be in range [0, 1], got %.2f", alpha))
}
x.setConfigUint64(configEigenTrustAlpha, math.Float64bits(alpha))
}
// EigenTrustAlpha returns EigenTrust parameter set using SetEigenTrustAlpha.
//
// Zero NetworkInfo has zero alpha parameter.
func (x NetworkInfo) EigenTrustAlpha() float64 {
alpha := math.Float64frombits(x.configUint64(configEigenTrustAlpha))
if alpha < 0 || alpha > 1 {
panic(fmt.Sprintf("unexpected invalid %s parameter value %.2f", configEigenTrustAlpha, alpha))
}
return alpha
}
const configEigenTrustNumberOfIterations = "EigenTrustIterations"
// SetNumberOfEigenTrustIterations sets number of iterations of the EigenTrust
// algorithm to perform. The algorithm is used by the storage nodes for
// calculating the reputation values.
//
// See also NumberOfEigenTrustIterations.
func (x *NetworkInfo) SetNumberOfEigenTrustIterations(num uint64) {
x.setConfigUint64(configEigenTrustNumberOfIterations, num)
}
// NumberOfEigenTrustIterations returns number of EigenTrust iterations set
// using SetNumberOfEigenTrustIterations.
//
// Zero NetworkInfo has zero iteration number.
func (x NetworkInfo) NumberOfEigenTrustIterations() uint64 {
return x.configUint64(configEigenTrustNumberOfIterations)
}
const configEpochDuration = "EpochDuration"
// SetEpochDuration sets FrostFS epoch duration measured in number of blocks of