Remove audit/reputation leftovers #562
14 changed files with 4 additions and 74 deletions
|
@ -36,9 +36,7 @@ alphabet-wallets: /path # path to consensus node / alphabet wallets s
|
|||
network:
|
||||
max_object_size: 67108864 # max size of a single FrostFS object, bytes
|
||||
epoch_duration: 240 # duration of a FrostFS epoch in blocks, consider block generation frequency in the sidechain
|
||||
basic_income_rate: 0 # basic income rate, for private consider 0
|
||||
fee:
|
||||
audit: 0 # network audit fee, for private installation consider 0
|
||||
candidate: 0 # inner ring candidate registration fee, for private installation consider 0
|
||||
container: 0 # container creation fee, for private installation consider 0
|
||||
container_alias: 0 # container nice-name registration fee, for private installation consider 0
|
||||
|
|
|
@ -34,9 +34,7 @@ alphabet-wallets: /home/user/deploy/alphabet-wallets
|
|||
network:
|
||||
max_object_size: 67108864
|
||||
epoch_duration: 240
|
||||
basic_income_rate: 0
|
||||
fee:
|
||||
audit: 0
|
||||
candidate: 0
|
||||
container: 0
|
||||
withdraw: 0
|
||||
|
@ -142,7 +140,6 @@ Waiting for transactions to persist...
|
|||
Stage 7: set addresses in NNS.
|
||||
Waiting for transactions to persist...
|
||||
NNS: Set alphabet0.frostfs -> f692dfb4d43a15b464eb51a7041160fb29c44b6a
|
||||
NNS: Set audit.frostfs -> 7df847b993affb3852074345a7c2bd622171ee0d
|
||||
NNS: Set balance.frostfs -> 103519b3067a66307080a66570c0491ee8f68879
|
||||
NNS: Set container.frostfs -> cae60bdd689d185901e495352d0247752ce50846
|
||||
NNS: Set frostfsid.frostfs -> c421fb60a3895865a8f24d197d6a80ef686041d2
|
||||
|
|
|
@ -18,8 +18,6 @@ type configTemplate struct {
|
|||
AlphabetDir string
|
||||
MaxObjectSize int
|
||||
EpochDuration int
|
||||
BasicIncomeRate int
|
||||
AuditFee int
|
||||
CandidateFee int
|
||||
ContainerFee int
|
||||
ContainerAliasFee int
|
||||
|
@ -33,10 +31,8 @@ alphabet-wallets: {{ .AlphabetDir}}
|
|||
network:
|
||||
max_object_size: {{ .MaxObjectSize}}
|
||||
epoch_duration: {{ .EpochDuration}}
|
||||
basic_income_rate: {{ .BasicIncomeRate}}
|
||||
homomorphic_hash_disabled: {{ .HomomorphicHashDisabled}}
|
||||
fee:
|
||||
audit: {{ .AuditFee}}
|
||||
candidate: {{ .CandidateFee}}
|
||||
container: {{ .ContainerFee}}
|
||||
container_alias: {{ .ContainerAliasFee }}
|
||||
|
@ -111,9 +107,7 @@ func generateConfigExample(appDir string, credSize int) (string, error) {
|
|||
Endpoint: "https://neo.rpc.node:30333",
|
||||
MaxObjectSize: 67108864, // 64 MiB
|
||||
EpochDuration: 240, // 1 hour with 15s per block
|
||||
BasicIncomeRate: 1_0000_0000, // 0.0001 GAS per GiB (Fixed12)
|
||||
HomomorphicHashDisabled: false, // object homomorphic hash is enabled
|
||||
AuditFee: 1_0000, // 0.00000001 GAS per audit (Fixed12)
|
||||
CandidateFee: 100_0000_0000, // 100.0 GAS (Fixed8)
|
||||
ContainerFee: 1000, // 0.000000001 * 7 GAS per container (Fixed12)
|
||||
ContainerAliasFee: 500, // ContainerFee / 2
|
||||
|
|
|
@ -28,8 +28,6 @@ func TestGenerateConfigExample(t *testing.T) {
|
|||
require.Equal(t, filepath.Join(appDir, "alphabet-wallets"), v.GetString("alphabet-wallets"))
|
||||
require.Equal(t, 67108864, v.GetInt("network.max_object_size"))
|
||||
require.Equal(t, 240, v.GetInt("network.epoch_duration"))
|
||||
require.Equal(t, 100000000, v.GetInt("network.basic_income_rate"))
|
||||
require.Equal(t, 10000, v.GetInt("network.fee.audit"))
|
||||
require.Equal(t, 10000000000, v.GetInt("network.fee.candidate"))
|
||||
require.Equal(t, 1000, v.GetInt("network.fee.container"))
|
||||
require.Equal(t, 100000000, v.GetInt("network.fee.withdraw"))
|
||||
|
|
|
@ -54,8 +54,7 @@ func dumpNetworkConfig(cmd *cobra.Command, _ []string) error {
|
|||
}
|
||||
for k, v := range m {
|
||||
switch k {
|
||||
case netmap.AuditFeeConfig, netmap.BasicIncomeRateConfig,
|
||||
netmap.ContainerFeeConfig, netmap.ContainerAliasFeeConfig,
|
||||
case netmap.ContainerFeeConfig, netmap.ContainerAliasFeeConfig,
|
||||
netmap.EpochDurationConfig, netmap.IrCandidateFeeConfig,
|
||||
netmap.MaxObjectSizeConfig, netmap.WithdrawFeeConfig:
|
||||
nbuf := make([]byte, 8)
|
||||
|
@ -134,8 +133,7 @@ func parseConfigPair(kvStr string, force bool) (key string, val any, err error)
|
|||
valRaw := v
|
||||
|
||||
switch key {
|
||||
case netmap.AuditFeeConfig, netmap.BasicIncomeRateConfig,
|
||||
netmap.ContainerFeeConfig, netmap.ContainerAliasFeeConfig,
|
||||
case netmap.ContainerFeeConfig, netmap.ContainerAliasFeeConfig,
|
||||
netmap.EpochDurationConfig, netmap.IrCandidateFeeConfig,
|
||||
netmap.MaxObjectSizeConfig, netmap.WithdrawFeeConfig:
|
||||
val, err = strconv.ParseInt(valRaw, 10, 64)
|
||||
|
|
|
@ -41,7 +41,6 @@ const (
|
|||
frostfsContract = "frostfs" // not deployed in side-chain.
|
||||
processingContract = "processing" // not deployed in side-chain.
|
||||
alphabetContract = "alphabet"
|
||||
auditContract = "audit"
|
||||
balanceContract = "balance"
|
||||
containerContract = "container"
|
||||
frostfsIDContract = "frostfsid"
|
||||
|
@ -51,7 +50,6 @@ const (
|
|||
|
||||
var (
|
||||
contractList = []string{
|
||||
auditContract,
|
||||
balanceContract,
|
||||
containerContract,
|
||||
frostfsIDContract,
|
||||
|
@ -69,10 +67,8 @@ var (
|
|||
netmapConfigKeys = []string{
|
||||
netmap.EpochDurationConfig,
|
||||
netmap.MaxObjectSizeConfig,
|
||||
netmap.AuditFeeConfig,
|
||||
netmap.ContainerFeeConfig,
|
||||
netmap.ContainerAliasFeeConfig,
|
||||
netmap.BasicIncomeRateConfig,
|
||||
netmap.IrCandidateFeeConfig,
|
||||
netmap.WithdrawFeeConfig,
|
||||
netmap.HomomorphicHashingDisabledKey,
|
||||
|
@ -533,8 +529,6 @@ func (c *initializeContext) getContractDeployData(ctrName string, keysParam []an
|
|||
case processingContract:
|
||||
items = append(items, c.Contracts[frostfsContract].Hash)
|
||||
return items[1:] // no notary info
|
||||
case auditContract:
|
||||
items = append(items, c.Contracts[netmapContract].Hash)
|
||||
case balanceContract:
|
||||
items = append(items,
|
||||
c.Contracts[netmapContract].Hash,
|
||||
|
|
|
@ -12,10 +12,8 @@ func getDefaultNetmapContractConfigMap() map[string]any {
|
|||
m := make(map[string]any)
|
||||
m[netmap.EpochDurationConfig] = viper.GetInt64(epochDurationInitFlag)
|
||||
m[netmap.MaxObjectSizeConfig] = viper.GetInt64(maxObjectSizeInitFlag)
|
||||
m[netmap.AuditFeeConfig] = viper.GetInt64(auditFeeInitFlag)
|
||||
m[netmap.ContainerFeeConfig] = viper.GetInt64(containerFeeInitFlag)
|
||||
m[netmap.ContainerAliasFeeConfig] = viper.GetInt64(containerAliasFeeInitFlag)
|
||||
m[netmap.BasicIncomeRateConfig] = viper.GetInt64(incomeRateInitFlag)
|
||||
m[netmap.IrCandidateFeeConfig] = viper.GetInt64(candidateFeeInitFlag)
|
||||
m[netmap.WithdrawFeeConfig] = viper.GetInt64(withdrawFeeInitFlag)
|
||||
m[netmap.HomomorphicHashingDisabledKey] = viper.GetBool(homomorphicHashDisabledInitFlag)
|
||||
|
|
|
@ -18,10 +18,6 @@ const (
|
|||
maxObjectSizeCLIFlag = "max-object-size"
|
||||
epochDurationInitFlag = "network.epoch_duration"
|
||||
epochDurationCLIFlag = "epoch-duration"
|
||||
incomeRateInitFlag = "network.basic_income_rate"
|
||||
incomeRateCLIFlag = "basic-income-rate"
|
||||
auditFeeInitFlag = "network.fee.audit"
|
||||
auditFeeCLIFlag = "audit-fee"
|
||||
containerFeeInitFlag = "network.fee.container"
|
||||
containerAliasFeeInitFlag = "network.fee.container_alias"
|
||||
containerFeeCLIFlag = "container-fee"
|
||||
|
@ -69,9 +65,7 @@ var (
|
|||
_ = viper.BindPFlag(endpointFlag, cmd.Flags().Lookup(endpointFlag))
|
||||
_ = viper.BindPFlag(epochDurationInitFlag, cmd.Flags().Lookup(epochDurationCLIFlag))
|
||||
_ = viper.BindPFlag(maxObjectSizeInitFlag, cmd.Flags().Lookup(maxObjectSizeCLIFlag))
|
||||
_ = viper.BindPFlag(incomeRateInitFlag, cmd.Flags().Lookup(incomeRateCLIFlag))
|
||||
_ = viper.BindPFlag(homomorphicHashDisabledInitFlag, cmd.Flags().Lookup(homomorphicHashDisabledCLIFlag))
|
||||
_ = viper.BindPFlag(auditFeeInitFlag, cmd.Flags().Lookup(auditFeeCLIFlag))
|
||||
_ = viper.BindPFlag(candidateFeeInitFlag, cmd.Flags().Lookup(candidateFeeCLIFlag))
|
||||
_ = viper.BindPFlag(containerFeeInitFlag, cmd.Flags().Lookup(containerFeeCLIFlag))
|
||||
_ = viper.BindPFlag(containerAliasFeeInitFlag, cmd.Flags().Lookup(containerAliasFeeCLIFlag))
|
||||
|
|
|
@ -38,8 +38,6 @@ var netInfoCmd = &cobra.Command{
|
|||
const format = " %s: %v\n"
|
||||
|
||||
cmd.Println("FrostFS network configuration (system)")
|
||||
cmd.Printf(format, "Audit fee", netInfo.AuditFee())
|
||||
cmd.Printf(format, "Storage price", netInfo.StoragePrice())
|
||||
cmd.Printf(format, "Container fee", netInfo.ContainerFee())
|
||||
cmd.Printf(format, "Epoch duration", netInfo.EpochDuration())
|
||||
cmd.Printf(format, "Inner Ring candidate fee", netInfo.IRCandidateFee())
|
||||
|
|
|
@ -470,8 +470,6 @@ func (n *netInfo) Dump(ver version.Version) (*netmapSDK.NetworkInfo, error) {
|
|||
ni.SetMsPerBlock(msPerBlock)
|
||||
|
||||
ni.SetMaxObjectSize(netInfoMorph.MaxObjectSize)
|
||||
ni.SetStoragePrice(netInfoMorph.StoragePrice)
|
||||
ni.SetAuditFee(netInfoMorph.AuditFee)
|
||||
ni.SetEpochDuration(netInfoMorph.EpochDuration)
|
||||
ni.SetContainerFee(netInfoMorph.ContainerFee)
|
||||
ni.SetNamedContainerFee(netInfoMorph.ContainerAliasFee)
|
||||
|
|
|
@ -409,7 +409,7 @@ const (
|
|||
NetmapCantInvokeNetmapAddPeer = "can't invoke netmap.AddPeer" // Error in ../node/pkg/innerring/processors/netmap/process_peers.go
|
||||
NetmapNonAlphabetModeIgnoreUpdatePeerNotification = "non alphabet mode, ignore update peer notification" // Info in ../node/pkg/innerring/processors/netmap/process_peers.go
|
||||
NetmapPreventSwitchingNodeToMaintenanceState = "prevent switching node to maintenance state" // Info in ../node/pkg/innerring/processors/netmap/process_peers.go
|
||||
NetmapCantInvokeNetmapUpdatePeer = "can't invoke netmap.UpdatePeer" // Error in ../node/pkg/innerring/processors/netmap/process_peers.go // Debug in ../node/pkg/innerring/processors/reputation/processor.go
|
||||
NetmapCantInvokeNetmapUpdatePeer = "can't invoke netmap.UpdatePeer" // Error in ../node/pkg/innerring/processors/netmap/process_peers.go
|
||||
FrostFSIRInternalError = "internal error" // Info in ../node/cmd/frostfs-ir/main.go
|
||||
FrostFSIRCouldNotShutdownHTTPServer = "could not shutdown HTTP server" // Debug in ../node/cmd/frostfs-ir/main.go
|
||||
FrostFSIRApplicationStopped = "application stopped" // Info in ../node/cmd/frostfs-ir/main.go
|
||||
|
|
|
@ -16,7 +16,6 @@ func TestParseContractsSuccess(t *testing.T) {
|
|||
contracts:
|
||||
frostfs: ee3dee6d05dc79c24a5b8f6985e10d68b7cacc62
|
||||
processing: 597f5894867113a41e192801709c02497f611de8
|
||||
audit: 219e37aed2180b87e7fe945dbf97d67125e8d73f
|
||||
balance: d2aa48d14b17b11bc4c68205027884a96706dd16
|
||||
container: ed4a7a66fe3f9bfe50f214b49be8f215a3c886b6
|
||||
frostfsid: 9f5866decbc751a099e74c7c7bc89f609201755a
|
||||
|
@ -138,13 +137,12 @@ contracts:
|
|||
|
||||
func TestParseContractsInvalid(t *testing.T) {
|
||||
t.Parallel()
|
||||
t.Run("invalid audit contract", func(t *testing.T) {
|
||||
t.Run("invalid frostfs contract", func(t *testing.T) {
|
||||
t.Parallel()
|
||||
file := strings.NewReader(`
|
||||
contracts:
|
||||
frostfs: invalid_data
|
||||
processing: 597f5894867113a41e192801709c02497f611de8
|
||||
audit: 219e37aed2180b87e7fe945dbf97d67125e8d73f
|
||||
balance: d2aa48d14b17b11bc4c68205027884a96706dd16
|
||||
container: ed4a7a66fe3f9bfe50f214b49be8f215a3c886b6
|
||||
frostfsid: 9f5866decbc751a099e74c7c7bc89f609201755a
|
||||
|
@ -171,7 +169,6 @@ contracts:
|
|||
contracts:
|
||||
frostfs: ee3dee6d05dc79c24a5b8f6985e10d68b7cacc62
|
||||
processing: 597f5894867113a41e192801709c02497f611de8
|
||||
audit: 219e37aed2180b87e7fe945dbf97d67125e8d73f
|
||||
balance: d2aa48d14b17b11bc4c68205027884a96706dd16
|
||||
container: ed4a7a66fe3f9bfe50f214b49be8f215a3c886b6
|
||||
frostfsid: 9f5866decbc751a099e74c7c7bc89f609201755a
|
||||
|
|
|
@ -11,8 +11,6 @@ import (
|
|||
|
||||
const (
|
||||
MaxObjectSizeConfig = "MaxObjectSize"
|
||||
BasicIncomeRateConfig = "BasicIncomeRate"
|
||||
AuditFeeConfig = "AuditFee"
|
||||
EpochDurationConfig = "EpochDuration"
|
||||
ContainerFeeConfig = "ContainerFee"
|
||||
ContainerAliasFeeConfig = "ContainerAliasFee"
|
||||
|
@ -33,28 +31,6 @@ func (c *Client) MaxObjectSize() (uint64, error) {
|
|||
return objectSize, nil
|
||||
}
|
||||
|
||||
// BasicIncomeRate returns basic income rate configuration value from network
|
||||
// config in netmap contract.
|
||||
func (c *Client) BasicIncomeRate() (uint64, error) {
|
||||
rate, err := c.readUInt64Config(BasicIncomeRateConfig)
|
||||
if err != nil {
|
||||
return 0, fmt.Errorf("(%T) could not get basic income rate: %w", c, err)
|
||||
}
|
||||
|
||||
return rate, nil
|
||||
}
|
||||
|
||||
// AuditFee returns audit fee configuration value from network
|
||||
// config in netmap contract.
|
||||
func (c *Client) AuditFee() (uint64, error) {
|
||||
fee, err := c.readUInt64Config(AuditFeeConfig)
|
||||
if err != nil {
|
||||
return 0, fmt.Errorf("(%T) could not get audit fee: %w", c, err)
|
||||
}
|
||||
|
||||
return fee, nil
|
||||
}
|
||||
|
||||
// EpochDuration returns number of sidechain blocks per one FrostFS epoch.
|
||||
func (c *Client) EpochDuration() (uint64, error) {
|
||||
epochDuration, err := c.readUInt64Config(EpochDurationConfig)
|
||||
|
@ -201,10 +177,6 @@ type RawNetworkParameter struct {
|
|||
type NetworkConfiguration struct {
|
||||
MaxObjectSize uint64
|
||||
|
||||
StoragePrice uint64
|
||||
|
||||
AuditFee uint64
|
||||
|
||||
EpochDuration uint64
|
||||
|
||||
ContainerFee uint64
|
||||
|
@ -262,10 +234,6 @@ func (c *Client) ReadNetworkConfiguration() (NetworkConfiguration, error) {
|
|||
})
|
||||
case MaxObjectSizeConfig:
|
||||
res.MaxObjectSize = bytesToUint64(value)
|
||||
case BasicIncomeRateConfig:
|
||||
res.StoragePrice = bytesToUint64(value)
|
||||
case AuditFeeConfig:
|
||||
res.AuditFee = bytesToUint64(value)
|
||||
case EpochDurationConfig:
|
||||
res.EpochDuration = bytesToUint64(value)
|
||||
case ContainerFeeConfig:
|
||||
|
|
|
@ -21,8 +21,6 @@ import (
|
|||
const (
|
||||
nnsContractID = 1 // NNS contract must be deployed first in the sidechain
|
||||
|
||||
// NNSAuditContractName is a name of the audit contract in NNS.
|
||||
NNSAuditContractName = "audit.frostfs"
|
||||
// NNSBalanceContractName is a name of the balance contract in NNS.
|
||||
NNSBalanceContractName = "balance.frostfs"
|
||||
// NNSContainerContractName is a name of the container contract in NNS.
|
||||
|
|
Loading…
Add table
Reference in a new issue