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

Ics mainnet #922

Merged
merged 5 commits into from
Nov 8, 2024
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
14 changes: 7 additions & 7 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ import (
ccvgov "github.com/cosmos/interchain-security/v4/x/ccv/democracy/governance"
ccvstaking "github.com/cosmos/interchain-security/v4/x/ccv/democracy/staking"

tv15 "github.com/comdex-official/comdex/app/upgrades/testnet/v15"
mv15 "github.com/comdex-official/comdex/app/upgrades/mainnet/v15"
)

const (
Expand Down Expand Up @@ -695,6 +695,7 @@ func New(
scopedICAHostKeeper,
app.MsgServiceRouter(),
)
app.ICAHostKeeper.WithQueryRouter(app.GRPCQueryRouter())

app.AssetKeeper = assetkeeper.NewKeeper(
app.cdc,
Expand Down Expand Up @@ -939,13 +940,12 @@ func New(
icqKeeper := icqkeeper.NewKeeper(
appCodec,
app.keys[icqtypes.StoreKey],
app.GetSubspace(icqtypes.ModuleName),
app.IbcKeeper.ChannelKeeper, // may be replaced with middleware
app.IbcKeeper.ChannelKeeper,
&app.IbcKeeper.PortKeeper,
scopedICQKeeper,
app.GRPCQueryRouter(),
// NewQuerierWrapper(baseApp), // in-case of strangelove-ventures icq
govModAddress,
)
app.ICQKeeper = &icqKeeper

Expand Down Expand Up @@ -1106,7 +1106,7 @@ func New(
liquidationsV2.NewAppModule(app.cdc, app.NewliqKeeper, app.AccountKeeper, app.BankKeeper),
auctionsV2.NewAppModule(app.cdc, app.NewaucKeeper, app.BankKeeper),
ibchooks.NewAppModule(app.AccountKeeper),
icq.NewAppModule(*app.ICQKeeper),
icq.NewAppModule(*app.ICQKeeper, app.GetSubspace(icqtypes.ModuleName)),
packetforward.NewAppModule(app.PacketForwardKeeper, app.GetSubspace(packetforwardtypes.ModuleName)),
auctionmoduleskip.NewAppModule(app.cdc, app.AuctionKeeperSkip),
consumerModule,
Expand Down Expand Up @@ -1606,8 +1606,8 @@ func (a *App) ModuleAccountsPermissions() map[string][]string {

func (a *App) registerUpgradeHandlers(appOptions servertypes.AppOptions) {
a.UpgradeKeeper.SetUpgradeHandler(
tv15.UpgradeName,
tv15.CreateUpgradeHandler(a.mm,
mv15.UpgradeName,
mv15.CreateUpgradeHandler(a.mm,
a.configurator,
a.cdc, appOptions,
*a.IbcKeeper,
Expand Down Expand Up @@ -1635,7 +1635,7 @@ func (a *App) registerUpgradeHandlers(appOptions servertypes.AppOptions) {
func upgradeHandlers(upgradeInfo upgradetypes.Plan, a *App, storeUpgrades *storetypes.StoreUpgrades) *storetypes.StoreUpgrades {
switch {

case upgradeInfo.Name == tv15.UpgradeName && !a.UpgradeKeeper.IsSkipHeight(upgradeInfo.Height):
case upgradeInfo.Name == mv15.UpgradeName && !a.UpgradeKeeper.IsSkipHeight(upgradeInfo.Height):
storeUpgrades = &storetypes.StoreUpgrades{
Added: []string{
ccvconsumertypes.StoreKey,
Expand Down
15 changes: 15 additions & 0 deletions app/upgrades/mainnet/v15/constants.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package v15

const (
UpgradeName = "v15.2.0"
UpgradeHeight = ""
UpgradeInfo = `'{
"binaries": {
"darwin/arm64":"",
"darwin/x86_64":"",
"linux/arm64":"",
"linux/x86_64":"",
"windows/x86_64":""
}
}'`
)
58 changes: 58 additions & 0 deletions app/upgrades/mainnet/v15/upgrades.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
package v15

import (
"fmt"

"github.com/cosmos/cosmos-sdk/client/flags"
"github.com/cosmos/cosmos-sdk/codec"
servertypes "github.com/cosmos/cosmos-sdk/server/types"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/module"
genutiltypes "github.com/cosmos/cosmos-sdk/x/genutil/types"
stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper"
upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types"
ibcconnectiontypes "github.com/cosmos/ibc-go/v7/modules/core/03-connection/types"
ibckeeper "github.com/cosmos/ibc-go/v7/modules/core/keeper"
ccvconsumerkeeper "github.com/cosmos/interchain-security/v4/x/ccv/consumer/keeper"
consumertypes "github.com/cosmos/interchain-security/v4/x/ccv/consumer/types"
"github.com/spf13/cast"
)

// CreateUpgradeHandler creates an SDK upgrade handler for v15
func CreateUpgradeHandler(
mm *module.Manager,
configurator module.Configurator,
cdc codec.Codec,
appOpts servertypes.AppOptions,
ibcKeeper ibckeeper.Keeper,
consumerKeeper *ccvconsumerkeeper.Keeper,
stakingKeeper stakingkeeper.Keeper,
) upgradetypes.UpgradeHandler {
return func(ctx sdk.Context, _ upgradetypes.Plan, vm module.VersionMap) (module.VersionMap, error) {
ctx.Logger().Info("Starting upgrade main-net v15...")
ibcKeeper.ConnectionKeeper.SetParams(ctx, ibcconnectiontypes.DefaultParams())

fromVM := make(map[string]uint64)

nodeHome := cast.ToString(appOpts.Get(flags.FlagHome))
consumerUpgradeGenFile := nodeHome + "/config/ccv.json"
appState, _, err := genutiltypes.GenesisStateFromGenFile(consumerUpgradeGenFile)
if err != nil {
return fromVM, fmt.Errorf("failed to unmarshal genesis state: %w", err)
}

var consumerGenesis = consumertypes.GenesisState{}
cdc.MustUnmarshalJSON(appState[consumertypes.ModuleName], &consumerGenesis)

consumerGenesis.PreCCV = true
consumerGenesis.Params.SoftOptOutThreshold = "0.05"
consumerGenesis.Params.RewardDenoms = []string{"ucmdx"}
consumerGenesis.Params.Enabled = true
consumerGenesis.Params.ProviderFeePoolAddrStr = "cosmos1ap0mh6xzfn8943urr84q6ae7zfnar48am2erhd"
consumerGenesis.Params.ConsumerRedistributionFraction = "0.70"
consumerKeeper.InitGenesis(ctx, &consumerGenesis)
consumerKeeper.SetDistributionTransmissionChannel(ctx, "channel-37")

return fromVM, nil
}
}
77 changes: 38 additions & 39 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,34 +6,34 @@ require (
cosmossdk.io/api v0.3.1
cosmossdk.io/errors v1.0.1
cosmossdk.io/math v1.3.0
github.com/CosmWasm/wasmd v0.45.0
github.com/CosmWasm/wasmvm v1.5.2
github.com/CosmWasm/wasmd v0.46.0
github.com/CosmWasm/wasmvm v1.5.5
github.com/bandprotocol/bandchain-packet v0.0.3
github.com/cometbft/cometbft v0.37.6
github.com/cometbft/cometbft v0.37.8
github.com/cometbft/cometbft-db v0.11.0
github.com/cosmos/cosmos-proto v1.0.0-beta.5
github.com/cosmos/cosmos-sdk v0.47.11
github.com/cosmos/cosmos-sdk v0.47.13
github.com/cosmos/gogoproto v1.4.10
github.com/cosmos/ibc-apps/modules/async-icq/v7 v7.0.0
github.com/cosmos/ibc-apps/modules/async-icq/v7 v7.1.1
github.com/cosmos/ibc-apps/modules/ibc-hooks/v7 v7.0.0-20231017170841-8fd49ec0f017
github.com/cosmos/interchain-security/v4 v4.2.0
github.com/cosmos/interchain-security/v4 v4.5.0
github.com/golang/protobuf v1.5.4
github.com/gorilla/mux v1.8.1
github.com/grpc-ecosystem/grpc-gateway v1.16.0
github.com/pkg/errors v0.9.1
github.com/prometheus/client_golang v1.16.0
github.com/skip-mev/block-sdk v1.4.3
github.com/spf13/cast v1.6.0
github.com/spf13/cobra v1.8.0
github.com/spf13/cobra v1.8.1
github.com/stretchr/testify v1.9.0
google.golang.org/genproto/googleapis/api v0.0.0-20240227224415-6ceb2ff114de
google.golang.org/grpc v1.63.2
google.golang.org/protobuf v1.33.0
google.golang.org/genproto/googleapis/api v0.0.0-20240528184218-531527333157
google.golang.org/grpc v1.65.0
google.golang.org/protobuf v1.34.2
)

require (
github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v7 v7.1.3
github.com/cosmos/ibc-go/v7 v7.4.0
github.com/cosmos/ibc-go/v7 v7.8.0
github.com/cosmos/ics23/go v0.10.0 // indirect
github.com/golangci/golangci-lint v1.56.2
github.com/rakyll/statik v0.1.7
Expand All @@ -45,11 +45,10 @@ require (
require (
4d63.com/gocheckcompilerdirectives v1.2.1 // indirect
4d63.com/gochecknoglobals v0.2.1 // indirect
cloud.google.com/go v0.112.0 // indirect
cloud.google.com/go/compute v1.24.0 // indirect
cloud.google.com/go/compute/metadata v0.2.3 // indirect
cloud.google.com/go v0.112.1 // indirect
cloud.google.com/go/compute/metadata v0.3.0 // indirect
cloud.google.com/go/iam v1.1.6 // indirect
cloud.google.com/go/storage v1.36.0 // indirect
cloud.google.com/go/storage v1.38.0 // indirect
cosmossdk.io/core v0.6.1 // indirect
cosmossdk.io/depinject v1.0.0-alpha.4 // indirect
cosmossdk.io/log v1.3.1 // indirect
Expand Down Expand Up @@ -92,7 +91,7 @@ require (
github.com/ccojocar/zxcvbn-go v1.0.2 // indirect
github.com/cenkalti/backoff/v4 v4.1.3 // indirect
github.com/cespare/xxhash v1.1.0 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/charithe/durationcheck v0.0.10 // indirect
github.com/chavacava/garif v0.1.0 // indirect
github.com/chzyer/readline v1.5.1 // indirect
Expand Down Expand Up @@ -155,7 +154,7 @@ require (
github.com/gofrs/flock v0.8.1 // indirect
github.com/gogo/googleapis v1.4.1 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/glog v1.2.0 // indirect
github.com/golang/glog v1.2.1 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/mock v1.6.0 // indirect
github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb // indirect
Expand All @@ -175,7 +174,7 @@ require (
github.com/google/s2a-go v0.1.7 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/googleapis/enterprise-certificate-proxy v0.3.2 // indirect
github.com/googleapis/gax-go/v2 v2.12.0 // indirect
github.com/googleapis/gax-go/v2 v2.12.3 // indirect
github.com/gordonklaus/ineffassign v0.1.0 // indirect
github.com/gorilla/handlers v1.5.1 // indirect
github.com/gorilla/websocket v1.5.0 // indirect
Expand All @@ -188,11 +187,12 @@ require (
github.com/gtank/merlin v0.1.1 // indirect
github.com/gtank/ristretto255 v0.1.2 // indirect
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
github.com/hashicorp/go-getter v1.7.4 // indirect
github.com/hashicorp/go-getter v1.7.5 // indirect
github.com/hashicorp/go-immutable-radix v1.3.1 // indirect
github.com/hashicorp/go-safetemp v1.0.0 // indirect
github.com/hashicorp/go-version v1.6.0 // indirect
github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d // indirect
github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/hdevalence/ed25519consensus v0.1.0 // indirect
github.com/hexops/gotextdiff v1.0.3 // indirect
Expand All @@ -210,7 +210,7 @@ require (
github.com/kisielk/errcheck v1.7.0 // indirect
github.com/kisielk/gotool v1.0.0 // indirect
github.com/kkHAIKE/contextcheck v1.1.4 // indirect
github.com/klauspost/compress v1.17.0 // indirect
github.com/klauspost/compress v1.17.2 // indirect
github.com/kr/pretty v0.3.1 // indirect
github.com/kr/text v0.2.0 // indirect
github.com/kulti/thelper v0.6.3 // indirect
Expand Down Expand Up @@ -248,7 +248,7 @@ require (
github.com/nunnatsa/ginkgolinter v0.15.2 // indirect
github.com/olekukonko/tablewriter v0.0.5 // indirect
github.com/opencontainers/go-digest v1.0.0 // indirect
github.com/pelletier/go-toml/v2 v2.1.0 // indirect
github.com/pelletier/go-toml/v2 v2.2.2 // indirect
github.com/petermattis/goid v0.0.0-20230317030725-371a4b8eda08 // indirect
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
github.com/polyfloyd/go-errorlint v1.4.8 // indirect
Expand Down Expand Up @@ -282,7 +282,7 @@ require (
github.com/sourcegraph/conc v0.3.0 // indirect
github.com/sourcegraph/go-diff v0.7.0 // indirect
github.com/spf13/afero v1.11.0 // indirect
github.com/spf13/viper v1.18.2 // indirect
github.com/spf13/viper v1.19.0 // indirect
github.com/ssgreg/nlreturn/v2 v2.2.1 // indirect
github.com/stbenjam/no-sprintf-host-port v0.1.1 // indirect
github.com/stretchr/objx v0.5.2 // indirect
Expand Down Expand Up @@ -312,30 +312,29 @@ require (
go-simpler.org/sloglint v0.4.0 // indirect
go.etcd.io/bbolt v1.3.8 // indirect
go.opencensus.io v0.24.0 // indirect
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.47.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.47.0 // indirect
go.opentelemetry.io/otel v1.22.0 // indirect
go.opentelemetry.io/otel/metric v1.22.0 // indirect
go.opentelemetry.io/otel/trace v1.22.0 // indirect
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.49.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0 // indirect
go.opentelemetry.io/otel v1.24.0 // indirect
go.opentelemetry.io/otel/metric v1.24.0 // indirect
go.opentelemetry.io/otel/trace v1.24.0 // indirect
go.uber.org/atomic v1.10.0 // indirect
go.uber.org/multierr v1.10.0 // indirect
go.uber.org/zap v1.24.0 // indirect
golang.org/x/crypto v0.21.0 // indirect
golang.org/x/crypto v0.24.0 // indirect
golang.org/x/exp v0.0.0-20240103183307-be819d1f06fc // indirect
golang.org/x/exp/typeparams v0.0.0-20231219180239-dc181d75b848 // indirect
golang.org/x/mod v0.17.0 // indirect
golang.org/x/net v0.23.0 // indirect
golang.org/x/oauth2 v0.17.0 // indirect
golang.org/x/sync v0.6.0 // indirect
golang.org/x/sys v0.18.0 // indirect
golang.org/x/term v0.18.0 // indirect
golang.org/x/text v0.14.0 // indirect
golang.org/x/mod v0.19.0 // indirect
golang.org/x/net v0.26.0 // indirect
golang.org/x/oauth2 v0.20.0 // indirect
golang.org/x/sync v0.7.0 // indirect
golang.org/x/sys v0.21.0 // indirect
golang.org/x/term v0.21.0 // indirect
golang.org/x/text v0.16.0 // indirect
golang.org/x/time v0.5.0 // indirect
golang.org/x/tools v0.18.0 // indirect
google.golang.org/api v0.162.0 // indirect
google.golang.org/appengine v1.6.8 // indirect
golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d // indirect
google.golang.org/api v0.171.0 // indirect
google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240227224415-6ceb2ff114de // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240528184218-531527333157 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
honnef.co/go/tools v0.4.6 // indirect
Expand Down
Loading
Loading