From 26a78aa366ef2874d97997cd1a13a60dbd748d13 Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Thu, 3 Aug 2023 14:18:56 +0300 Subject: [PATCH] [#248] adm: Remove obsolete network parameters Signed-off-by: Evgenii Stratonikov --- cmd/frostfs-adm/README.md | 2 -- cmd/frostfs-adm/docs/deploy.md | 2 -- cmd/frostfs-adm/internal/modules/config/config.go | 6 ------ cmd/frostfs-adm/internal/modules/config/config_test.go | 2 -- cmd/frostfs-adm/internal/modules/morph/config.go | 6 ++---- cmd/frostfs-adm/internal/modules/morph/initialize_deploy.go | 2 -- cmd/frostfs-adm/internal/modules/morph/netmap_util.go | 2 -- cmd/frostfs-adm/internal/modules/morph/root.go | 6 ------ 8 files changed, 2 insertions(+), 26 deletions(-) diff --git a/cmd/frostfs-adm/README.md b/cmd/frostfs-adm/README.md index dac264239..f3dbe6950 100644 --- a/cmd/frostfs-adm/README.md +++ b/cmd/frostfs-adm/README.md @@ -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 diff --git a/cmd/frostfs-adm/docs/deploy.md b/cmd/frostfs-adm/docs/deploy.md index 974c2a93c..b40dc75b0 100644 --- a/cmd/frostfs-adm/docs/deploy.md +++ b/cmd/frostfs-adm/docs/deploy.md @@ -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 diff --git a/cmd/frostfs-adm/internal/modules/config/config.go b/cmd/frostfs-adm/internal/modules/config/config.go index ebefe1d2c..9dfab9f85 100644 --- a/cmd/frostfs-adm/internal/modules/config/config.go +++ b/cmd/frostfs-adm/internal/modules/config/config.go @@ -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 diff --git a/cmd/frostfs-adm/internal/modules/config/config_test.go b/cmd/frostfs-adm/internal/modules/config/config_test.go index 292fe76da..3fa800a06 100644 --- a/cmd/frostfs-adm/internal/modules/config/config_test.go +++ b/cmd/frostfs-adm/internal/modules/config/config_test.go @@ -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")) diff --git a/cmd/frostfs-adm/internal/modules/morph/config.go b/cmd/frostfs-adm/internal/modules/morph/config.go index 09d071b53..a86829aaa 100644 --- a/cmd/frostfs-adm/internal/modules/morph/config.go +++ b/cmd/frostfs-adm/internal/modules/morph/config.go @@ -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) diff --git a/cmd/frostfs-adm/internal/modules/morph/initialize_deploy.go b/cmd/frostfs-adm/internal/modules/morph/initialize_deploy.go index 8a0a88899..dc6bc646c 100644 --- a/cmd/frostfs-adm/internal/modules/morph/initialize_deploy.go +++ b/cmd/frostfs-adm/internal/modules/morph/initialize_deploy.go @@ -69,10 +69,8 @@ var ( netmapConfigKeys = []string{ netmap.EpochDurationConfig, netmap.MaxObjectSizeConfig, - netmap.AuditFeeConfig, netmap.ContainerFeeConfig, netmap.ContainerAliasFeeConfig, - netmap.BasicIncomeRateConfig, netmap.IrCandidateFeeConfig, netmap.WithdrawFeeConfig, netmap.HomomorphicHashingDisabledKey, diff --git a/cmd/frostfs-adm/internal/modules/morph/netmap_util.go b/cmd/frostfs-adm/internal/modules/morph/netmap_util.go index 23cfd120c..fa7aa0af3 100644 --- a/cmd/frostfs-adm/internal/modules/morph/netmap_util.go +++ b/cmd/frostfs-adm/internal/modules/morph/netmap_util.go @@ -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) diff --git a/cmd/frostfs-adm/internal/modules/morph/root.go b/cmd/frostfs-adm/internal/modules/morph/root.go index 6a9e5b9c1..bee1837a3 100644 --- a/cmd/frostfs-adm/internal/modules/morph/root.go +++ b/cmd/frostfs-adm/internal/modules/morph/root.go @@ -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))