Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/ Set default power reduction on start #358

Merged
merged 4 commits into from
Apr 29, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions app/app_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ package app
import (
"os"

sdkmath "cosmossdk.io/math"
sdk "github.com/cosmos/cosmos-sdk/types"
ica "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts"
icatypes "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/types"
ibcfee "github.com/cosmos/ibc-go/v7/modules/apps/29-fee"
Expand Down Expand Up @@ -74,6 +76,7 @@ const (
var (
// DefaultNodeHome sets the folder where the application data and configuration will be stored
DefaultNodeHome = os.ExpandEnv("$HOME/.stchaind")
powerReduction = sdkmath.NewInt(1e15)

// ModuleBasics is in charge of setting up basic module elements
ModuleBasics = module.NewBasicManager(
Expand Down Expand Up @@ -292,6 +295,9 @@ var (

func init() {
version.AppName = appName + "d"

//reset DefaultPowerReduction to prevent voting power overflow.
sdk.DefaultPowerReduction = powerReduction
}

// GetMaccPerms returns a copy of the module account permissions
Expand Down