Skip to content
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
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ coverage.txt
profile.out

# heighliner
heighliner
heighliner/

# Vagrant
.vagrant/
Expand All @@ -51,4 +51,5 @@ data
state_export.json

github.com*
gogoproto*
gogoproto*
target/
52 changes: 24 additions & 28 deletions app/keepers/keepers.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,69 +3,65 @@ package keepers
import (
"path/filepath"

"github.com/cosmos/cosmos-sdk/x/upgrade"
"github.com/spf13/cast"

"github.com/CosmWasm/wasmd/x/wasm"
wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper"
"github.com/bitsongofficial/go-bitsong/x/fantoken"
fantokenkeeper "github.com/bitsongofficial/go-bitsong/x/fantoken/keeper"
fantokentypes "github.com/bitsongofficial/go-bitsong/x/fantoken/types"
"github.com/cosmos/cosmos-sdk/baseapp"
"github.com/cosmos/cosmos-sdk/client/flags"
"github.com/cosmos/cosmos-sdk/codec"
"github.com/cosmos/cosmos-sdk/server"
"github.com/cosmos/cosmos-sdk/x/feegrant"
"github.com/cosmos/cosmos-sdk/x/params"
"github.com/cosmos/cosmos-sdk/x/upgrade"

servertypes "github.com/cosmos/cosmos-sdk/server/types"
storetypes "github.com/cosmos/cosmos-sdk/store/types"
"github.com/cosmos/ibc-go/v7/modules/apps/transfer"
porttypes "github.com/cosmos/ibc-go/v7/modules/core/05-port/types"

ibcclient "github.com/cosmos/ibc-go/v7/modules/core/02-client"
ibcclienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types"

wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper"
wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types"
"github.com/bitsongofficial/go-bitsong/x/fantoken"
fantokenkeeper "github.com/bitsongofficial/go-bitsong/x/fantoken/keeper"
fantokentypes "github.com/bitsongofficial/go-bitsong/x/fantoken/types"
authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper"
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
authzkeeper "github.com/cosmos/cosmos-sdk/x/authz/keeper"
bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper"
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
capabilitykeeper "github.com/cosmos/cosmos-sdk/x/capability/keeper"
capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types"
consensusparamkeeper "github.com/cosmos/cosmos-sdk/x/consensus/keeper"
consensusparamtypes "github.com/cosmos/cosmos-sdk/x/consensus/types"
crisiskeeper "github.com/cosmos/cosmos-sdk/x/crisis/keeper"
crisistypes "github.com/cosmos/cosmos-sdk/x/crisis/types"
distrkeeper "github.com/cosmos/cosmos-sdk/x/distribution/keeper"
distrtypes "github.com/cosmos/cosmos-sdk/x/distribution/types"
evidencekeeper "github.com/cosmos/cosmos-sdk/x/evidence/keeper"
evidencetypes "github.com/cosmos/cosmos-sdk/x/evidence/types"
paramproposal "github.com/cosmos/cosmos-sdk/x/params/types/proposal"

"github.com/cosmos/cosmos-sdk/x/feegrant"
govtypesv1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1"
"github.com/cosmos/cosmos-sdk/x/params"

feegrantkeeper "github.com/cosmos/cosmos-sdk/x/feegrant/keeper"
govkeeper "github.com/cosmos/cosmos-sdk/x/gov/keeper"
govtypes "github.com/cosmos/cosmos-sdk/x/gov/types"
govtypesv1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1"
mintkeeper "github.com/cosmos/cosmos-sdk/x/mint/keeper"
minttypes "github.com/cosmos/cosmos-sdk/x/mint/types"
paramskeeper "github.com/cosmos/cosmos-sdk/x/params/keeper"
paramstypes "github.com/cosmos/cosmos-sdk/x/params/types"
paramproposal "github.com/cosmos/cosmos-sdk/x/params/types/proposal"
slashingkeeper "github.com/cosmos/cosmos-sdk/x/slashing/keeper"
slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types"
stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper"
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
upgradekeeper "github.com/cosmos/cosmos-sdk/x/upgrade/keeper"
upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types"
"github.com/spf13/cast"

crisistypes "github.com/cosmos/cosmos-sdk/x/crisis/types"

wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types"
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
consensusparamkeeper "github.com/cosmos/cosmos-sdk/x/consensus/keeper"
consensusparamtypes "github.com/cosmos/cosmos-sdk/x/consensus/types"
distrtypes "github.com/cosmos/cosmos-sdk/x/distribution/types"
govtypes "github.com/cosmos/cosmos-sdk/x/gov/types"
minttypes "github.com/cosmos/cosmos-sdk/x/mint/types"
slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types"
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
"github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v7/packetforward"
packetforwardkeeper "github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v7/packetforward/keeper"
packetforwardtypes "github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v7/packetforward/types"
ibcfeekeeper "github.com/cosmos/ibc-go/v7/modules/apps/29-fee/keeper"
ibctransferkeeper "github.com/cosmos/ibc-go/v7/modules/apps/transfer/keeper"
ibctransfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types"
ibcclient "github.com/cosmos/ibc-go/v7/modules/core/02-client"
ibcclienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types"
ibcexported "github.com/cosmos/ibc-go/v7/modules/core/exported"
ibckeeper "github.com/cosmos/ibc-go/v7/modules/core/keeper"
)
Expand Down
2 changes: 0 additions & 2 deletions cmd/bitsongd/cmd/init_from_state.go
Original file line number Diff line number Diff line change
Expand Up @@ -469,8 +469,6 @@ func ConvertStateExport(clientCtx client.Context, params StateExportParams) (*tm
appStateJSON = bytes.Replace(appStateJSON, []byte(operatorAddr), []byte(sdk.ValAddress(params.TmPubKey.Address()).String()), -1)
appStateJSON = bytes.Replace(appStateJSON, []byte(sdk.ConsAddress(oldValidator.PubKey.Address()).String()), []byte(sdk.ConsAddress(params.TmPubKey.Address()).String()), -1)

// TODO: manually proceed with upgrade if needed

genDoc.AppState = appStateJSON

return &genDoc, nil
Expand Down
15 changes: 3 additions & 12 deletions cmd/bitsongd/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,9 @@ func NewRootCmd() (*cobra.Command, params.EncodingConfig) {

customAppTemplate, customAppConfig := initAppConfig()
customTMConfig := tmcfg.DefaultConfig()
// add customizations to tendermint configuration here
// customTMConfig.P2P.MaxNumInboundPeers = 100
// customTMConfig.P2P.MaxNumOutboundPeers = 40

return server.InterceptConfigsPreRunHandler(cmd, customAppTemplate, customAppConfig, customTMConfig)
},
Expand All @@ -102,18 +105,6 @@ func NewRootCmd() (*cobra.Command, params.EncodingConfig) {
return rootCmd, encodingConfig
}

// initTendermintConfig helps to override default Tendermint Config values.
// return tmcfg.DefaultConfig if no custom configuration is required for the application.
// func initTendermintConfig() *tmcfg.Config {
// cfg := tmcfg.DefaultConfig()

// // these values put a higher strain on node memory
// // cfg.P2P.MaxNumInboundPeers = 100
// // cfg.P2P.MaxNumOutboundPeers = 40

// return
// }

// initAppConfig helps to override default appConfig template and configs.
// return "", nil if no custom configuration is required for the application.
func initAppConfig() (string, interface{}) {
Expand Down
8 changes: 3 additions & 5 deletions cmd/bitsongd/cmd/v18-slash.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ const (
FlagDelegator = "delegator"
)

var ()

// InitFromStateCmd returns a command that initializes all files needed for Tendermint
// and the respective application.
func VerifySlashedDelegatorsV018(defaultNodeHome string) *cobra.Command {
Expand Down Expand Up @@ -149,7 +147,7 @@ func V018ConvertStateExport(clientCtx client.Context, params V018StateExportPara
clientCtx.Codec.MustUnmarshalJSON(appState[slashingtypes.ModuleName], &slashing)

// VO18 Slashed validators
var DELEGATORS = []string{
var VALS = []string{
"bitsongvaloper1slnkc2a8lhxgz5cc7lg9zlgzfedfpdve0rh2p6",
"bitsongvaloper1j98m4tzhzktqgwmmd3q8k9trgch5ssxnpm7r3k",
"bitsongvaloper1l2kthmf0gzlmscca859zs6fa22p769ph3ptgzm",
Expand All @@ -165,7 +163,7 @@ func V018ConvertStateExport(clientCtx client.Context, params V018StateExportPara
delegationsWithSlashActions := make(map[string]map[string]math.Int)
uniqueDelegatorsPerValidator := make(map[string][]string)
// GOAL: get delegators for each validator with a slashing action in state
for _, vse := range DELEGATORS {
for _, vse := range VALS {

// Initialize the validator's delegations map if not already done
if _, ok := delegationsWithSlashActions[vse]; !ok {
Expand Down Expand Up @@ -227,7 +225,7 @@ func V018ConvertStateExport(clientCtx client.Context, params V018StateExportPara
if err != nil {
fmt.Println(err)
}
_, err = filea.Write(jsonData2)
_, err = fileb.Write(jsonData2)
if err != nil {
fmt.Println(err)
}
Expand Down
Loading