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

migrate staking #241

Merged
merged 5 commits into from
May 31, 2023
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions app/testing/test_suite.go
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@ func genesisStateWithValSet(t *testing.T,
defaultStParams.MaxEntries,
defaultStParams.HistoricalEntries,
appparams.BondDenom,
defaultStParams.MinCommissionRate,
)

// set validators and delegations
Expand Down
7 changes: 6 additions & 1 deletion app/upgrades/v4/upgrades.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,21 @@ import (
"github.com/classic-terra/core/app/upgrades"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/module"
"github.com/cosmos/cosmos-sdk/x/staking/keeper"
upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types"
)

func CreateV4UpgradeHandler(
mm *module.Manager,
cfg module.Configurator,
_ upgrades.BaseAppParamManager,
_ *keepers.AppKeepers,
keepers *keepers.AppKeepers,
) upgradetypes.UpgradeHandler {
return func(ctx sdk.Context, _ upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) {
// to run staking store migration
stakingKeeper := keepers.StakingKeeper
stkingMigrator := keeper.NewMigrator(stakingKeeper)
stkingMigrator.Migrate13to14(ctx)
Comment on lines +19 to +22
Copy link
Contributor Author

@alchemist-ti alchemist-ti May 30, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In classic-terra/cosmos-sdk, the ConsensusVersion of the Staking module is not incremented in order to keep it consistent with cosmos/cosmos-sdk, so it is different from common module migrations.

// to run wasm store migration
return mm.RunMigrations(ctx, cfg, fromVM)
}
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module github.com/classic-terra/core
require (
github.com/CosmWasm/wasmd v0.30.0
github.com/CosmWasm/wasmvm v1.1.1
github.com/cosmos/cosmos-sdk v0.45.13
github.com/cosmos/cosmos-sdk v0.45.14
github.com/cosmos/gogoproto v1.4.4
github.com/cosmos/ibc-go/v4 v4.3.0
github.com/gogo/protobuf v1.3.3
Expand Down Expand Up @@ -132,7 +132,7 @@ replace (
github.com/CosmWasm/wasmd => github.com/classic-terra/wasmd v0.30.0-terra.1
github.com/aws/aws-sdk-go v1.25.48 => github.com/aws/aws-sdk-go v1.33.0
github.com/aws/aws-sdk-go v1.27.0 => github.com/aws/aws-sdk-go v1.33.0
github.com/cosmos/cosmos-sdk => github.com/classic-terra/cosmos-sdk v0.45.13-classic
github.com/cosmos/cosmos-sdk => github.com/classic-terra/cosmos-sdk v0.45.14-classic
github.com/cosmos/ledger-cosmos-go => github.com/terra-money/ledger-terra-go v0.11.2
github.com/docker/docker v1.4.2-0.20180625184442-8e610b2b55bf => github.com/docker/docker v1.6.1
github.com/ethereum/go-ethereum v1.9.25 => github.com/ethereum/go-ethereum v1.10.9
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,8 @@ github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5P
github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU=
github.com/circonus-labs/circonus-gometrics v2.3.1+incompatible/go.mod h1:nmEj6Dob7S7YxXgwXpfOuvO54S+tGdZdw9fuRZt25Ag=
github.com/circonus-labs/circonusllhist v0.1.3/go.mod h1:kMXHVDlOchFAehlya5ePtbp5jckzBHf4XRpQvBOLI+I=
github.com/classic-terra/cosmos-sdk v0.45.13-classic h1:gJ1waM0wDVoa4XpJqTn/AvtUOcjJUohnwiG9haiAIuE=
github.com/classic-terra/cosmos-sdk v0.45.13-classic/go.mod h1:KaUwQKijD7mOiKnPa/7JOJoGfDt4Mq+1CGlODMHPmfM=
github.com/classic-terra/cosmos-sdk v0.45.14-classic h1:R3WBEoqnBDGef3LCCq0uTWEqFO8pwwqkIv3nQWv5Z+E=
github.com/classic-terra/cosmos-sdk v0.45.14-classic/go.mod h1:KaUwQKijD7mOiKnPa/7JOJoGfDt4Mq+1CGlODMHPmfM=
github.com/classic-terra/tendermint v0.34.24-terra.0 h1:ZGaJpmKfxjlmmLO80t03jlK2SBQfJKlLsF+ItDbXtko=
github.com/classic-terra/tendermint v0.34.24-terra.0/go.mod h1:rXVrl4OYzmIa1I91av3iLv2HS0fGSiucyW9J4aMTpKI=
github.com/classic-terra/wasmd v0.30.0-terra.1 h1:Qc3zlrMpzFUd/wUAQ4fceiVbV+uCXRyT3QhUt/wMPKM=
Expand Down
5 changes: 4 additions & 1 deletion scripts/run-node.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ BINARY=$1
# check DENOM is set. If not, set to uluna
DENOM=${2:-uluna}

COMMISSION_RATE=0.01
COMMISSION_MAX_RATE=0.02

SED_BINARY=sed
# check if this is OS X
if [[ "$OSTYPE" == "darwin"* ]]; then
Expand Down Expand Up @@ -61,7 +64,7 @@ $SED_BINARY -i '0,/enable = false/s//enable = true/' $HOME/config/app.toml
$SED_BINARY -i 's/swagger = false/swagger = true/' $HOME/config/app.toml

# Sign genesis transaction
$BINARY gentx $KEY "1000000${DENOM}" --keyring-backend $KEYRING --chain-id $CHAIN_ID --home $HOME
$BINARY gentx $KEY "1000000${DENOM}" --commission-rate=$COMMISSION_RATE --commission-max-rate=$COMMISSION_MAX_RATE --keyring-backend $KEYRING --chain-id $CHAIN_ID --home $HOME

# Collect genesis tx
$BINARY collect-gentxs --home $HOME
Expand Down