diff --git a/CHANGELOG.md b/CHANGELOG.md index a7f7154f677b..45d4fe7d15e7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -36,6 +36,14 @@ Ref: https://keepachangelog.com/en/1.0.0/ # Changelog +## [v0.50.13-xrplevm.2](https://github.com/xrplevm/cosmos-sdk/releases/tag/v0.50.13-xrplevm.2) + +### Bug Fixes + +* (x/slashing) [#2](https://github.com/xrplevm/cosmos-sdk/pull/2) Validate slashing parameters in genesis + +## [v0.50.13-xrplevm.1](https://github.com/xrplevm/cosmos-sdk/releases/tag/v0.50.13-xrplevm.1) + ## [v0.50.11-xrplevm.1](https://github.com/xrplevm/cosmos-sdk/releases/tag/v0.50.11-xrplevm.1) ### Bug Fixes diff --git a/x/slashing/types/genesis.go b/x/slashing/types/genesis.go index 78b163649d95..864fba6c87b1 100644 --- a/x/slashing/types/genesis.go +++ b/x/slashing/types/genesis.go @@ -41,11 +41,19 @@ func ValidateGenesis(data GenesisState) error { if downtime.IsNegative() || downtime.GT(math.LegacyOneDec()) { return fmt.Errorf("slashing fraction downtime should be less than or equal to one and greater than zero, is %s", downtime.String()) } + // NOTE: IF-FINDING-002 Assert that the downtime slash fraction is zero + if !downtime.IsZero() { + return fmt.Errorf("slash fraction downtime must be zero: %s", downtime) + } dblSign := data.Params.SlashFractionDoubleSign if dblSign.IsNegative() || dblSign.GT(math.LegacyOneDec()) { return fmt.Errorf("slashing fraction double sign should be less than or equal to one and greater than zero, is %s", dblSign.String()) } + // NOTE: IF-FINDING-002 Assert that the double sign slash fraction is zero + if !dblSign.IsZero() { + return fmt.Errorf("slash fraction double sign must be zero: %s", downtime) + } minSign := data.Params.MinSignedPerWindow if minSign.IsNegative() || minSign.GT(math.LegacyOneDec()) { diff --git a/x/slashing/types/params.go b/x/slashing/types/params.go index efd1b0358c9a..6d8c9954ce5b 100644 --- a/x/slashing/types/params.go +++ b/x/slashing/types/params.go @@ -127,7 +127,7 @@ func validateSlashFractionDoubleSign(i interface{}) error { // NOTE: IF-FINDING-002 Assert that the double sign slash fraction is zero if !v.IsZero() { - return fmt.Errorf("double sign slash fraction must be zero: %s", v) + return fmt.Errorf("slash fraction double sign must be zero: %s", v) } return nil @@ -151,7 +151,7 @@ func validateSlashFractionDowntime(i interface{}) error { // NOTE: IF-FINDING-002 Assert that the downtime slash fraction is zero if !v.IsZero() { - return fmt.Errorf("downtime sign slash fraction must be zero: %s", v) + return fmt.Errorf("slash fraction downtime must be zero: %s", v) } return nil