From d45decffafaa07f1b14e4a6ac16f168d82e77bfe Mon Sep 17 00:00:00 2001 From: Hleb Albau Date: Wed, 30 Jan 2019 14:10:03 +0700 Subject: [PATCH] #202 Set final values --- app/genesis.go | 23 +++++++++++++++++++---- x/bandwidth/params.go | 8 ++++---- x/rank/params.go | 2 +- 3 files changed, 24 insertions(+), 9 deletions(-) diff --git a/app/genesis.go b/app/genesis.go index 3e0ff43c..8f0b151d 100644 --- a/app/genesis.go +++ b/app/genesis.go @@ -82,7 +82,6 @@ const ( defaultUnbondingTime = 60 * 60 * 24 * 3 * time.Second ) -// todo set params for each module // NewDefaultGenesisState generates the default state for cyberd. func NewDefaultGenesisState() GenesisState { return GenesisState{ @@ -105,9 +104,25 @@ func NewDefaultGenesisState() GenesisState { BondDenom: coin.CYB, }, }, - SlashingData: slashing.DefaultGenesisState(), - DistrData: distr.DefaultGenesisState(), - GenTxs: []json.RawMessage{}, + SlashingData: slashing.GenesisState{ + Params: slashing.Params{ + MaxEvidenceAge: defaultUnbondingTime, + SignedBlocksWindow: 60 * 30, // ~30min + DowntimeJailDuration: 0, + MinSignedPerWindow: sdk.NewDecWithPrec(70, 1), + SlashFractionDoubleSign: sdk.NewDec(1).Quo(sdk.NewDec(5)), // 20% + SlashFractionDowntime: sdk.NewDec(1).Quo(sdk.NewDec(1000)), // 0.1% + }, + }, + DistrData: distr.GenesisState{ + FeePool: distr.InitialFeePool(), + CommunityTax: sdk.NewDecWithPrec(0, 2), // 0% + BaseProposerReward: sdk.NewDecWithPrec(1, 2), // 1% + BonusProposerReward: sdk.NewDecWithPrec(4, 2), // 4% + WithdrawAddrEnabled: true, + PreviousProposer: nil, + }, + GenTxs: []json.RawMessage{}, } } diff --git a/x/bandwidth/params.go b/x/bandwidth/params.go index 04227e5a..f39b0fab 100644 --- a/x/bandwidth/params.go +++ b/x/bandwidth/params.go @@ -10,10 +10,10 @@ const ( NonLinkMsgCost = LinkMsgCost * 5 // Number of blocks to recover full bandwidth - RecoveryPeriod = 60 * 60 * 24 + RecoveryPeriod = 60 * 60 * 24 // ~24h // Number of blocks before next adjust price - AdjustPricePeriod = 60 * 10 + AdjustPricePeriod = 60 // ~1m BaseCreditPrice float64 = 1.0 - SlidingWindowSize = RecoveryPeriod / 2 - ShouldBeSpentPerSlidingWindow = float64(DesirableNetworkBandwidthForRecoveryPeriod) / (float64(RecoveryPeriod) / float64(SlidingWindowSize)) + SlidingWindowSize = RecoveryPeriod + ShouldBeSpentPerSlidingWindow = float64(DesirableNetworkBandwidthForRecoveryPeriod) ) diff --git a/x/rank/params.go b/x/rank/params.go index 74abf4c0..966cf416 100644 --- a/x/rank/params.go +++ b/x/rank/params.go @@ -1,5 +1,5 @@ package rank const ( - CalculationPeriod = 5 + CalculationPeriod = 100 )