Skip to content

Commit

Permalink
#202 Set final values
Browse files Browse the repository at this point in the history
  • Loading branch information
hleb-albau committed Jan 31, 2019
1 parent 9f1a587 commit efb0e2f
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 9 deletions.
23 changes: 19 additions & 4 deletions app/genesis.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand All @@ -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{},
}
}

Expand Down
8 changes: 4 additions & 4 deletions x/bandwidth/params.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
)
2 changes: 1 addition & 1 deletion x/rank/params.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package rank

const (
CalculationPeriod = 5
CalculationPeriod = 100
)

0 comments on commit efb0e2f

Please sign in to comment.