Skip to content

Commit

Permalink
feat: integrate with v0.52.x (1/n) (#4289)
Browse files Browse the repository at this point in the history
v052 is getting audited, this is time for us to update modules and simapp to the latest version.
This PR focuses on:

- [x] Updating Ignite to use latest SDK
- [ ] Update module wiring to core v1 (follow-up, made only to pass build, follow up will clean it up and wire environment)
- [x] Update simapp to v0.52
- [x] Delete IBC (unsupported for now)
  • Loading branch information
julienrbrt authored Oct 15, 2024
1 parent 8e64eb5 commit 01c94ac
Show file tree
Hide file tree
Showing 95 changed files with 1,876 additions and 7,297 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ node_modules
docs/.vuepress/dist
build/
*coverage.*
*.ign
3 changes: 2 additions & 1 deletion changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@
- [#4131](https://github.com/ignite/cli/pull/4131) Support `bytes` as data type in the `scaffold` commands
- [#4300](https://github.com/ignite/cli/pull/4300) Only panics the module in the most top function level
- [#4327](https://github.com/ignite/cli/pull/4327) Use the TxConfig from simState instead create a new one
- [#4326](https://github.com/ignite/cli/pull/4326) fAdd `buf.build` version to `ignite version` command
- [#4326](https://github.com/ignite/cli/pull/4326) Add `buf.build` version to `ignite version` command
- [#4362](https://github.com/ignite/cli/pull/4362) Scaffold `Makefile`
- [#4289](https://github.com/ignite/cli/pull/4289) Cosmos SDK v0.52 support

### Changes

Expand Down
131 changes: 73 additions & 58 deletions go.mod

Large diffs are not rendered by default.

452 changes: 132 additions & 320 deletions go.sum

Large diffs are not rendered by default.

60 changes: 24 additions & 36 deletions ignite/cmd/chain_simulate.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,19 @@ import (
)

const (
flagSimappGenesis = "genesis"
flagSimappParams = "params"
flagSimappExportParamsPath = "exportParamsPath"
flagSimappExportParamsHeight = "exportParamsHeight"
flagSimappExportStatePath = "exportStatePath"
flagSimappExportStatsPath = "exportStatsPath"
flagSimappSeed = "seed"
flagSimappInitialBlockHeight = "initialBlockHeight"
flagSimappNumBlocks = "numBlocks"
flagSimappBlockSize = "blockSize"
flagSimappLean = "lean"
flagSimappSimulateEveryOperation = "simulateEveryOperation"
flagSimappPrintAllInvariants = "printAllInvariants"
flagSimappVerbose = "verbose"
flagSimappPeriod = "period"
flagSimappGenesisTime = "genesisTime"
flagSimappGenesis = "genesis"
flagSimappParams = "params"
flagSimappExportParamsPath = "exportParamsPath"
flagSimappExportParamsHeight = "exportParamsHeight"
flagSimappExportStatePath = "exportStatePath"
flagSimappExportStatsPath = "exportStatsPath"
flagSimappSeed = "seed"
flagSimappInitialBlockHeight = "initialBlockHeight"
flagSimappNumBlocks = "numBlocks"
flagSimappBlockSize = "blockSize"
flagSimappLean = "lean"
flagSimappPeriod = "period"
flagSimappGenesisTime = "genesisTime"
)

// NewChainSimulate creates a new simulation command to run the blockchain simulation.
Expand All @@ -44,7 +41,6 @@ func NewChainSimulate() *cobra.Command {

func chainSimulationHandler(cmd *cobra.Command, _ []string) error {
var (
verbose, _ = cmd.Flags().GetBool(flagSimappVerbose)
period, _ = cmd.Flags().GetUint(flagSimappPeriod)
genesisTime, _ = cmd.Flags().GetInt64(flagSimappGenesisTime)
config = newConfigFromFlags(cmd)
Expand All @@ -66,7 +62,6 @@ func chainSimulationHandler(cmd *cobra.Command, _ []string) error {
}

return c.Simulate(cmd.Context(),
chain.SimappWithVerbose(verbose),
chain.SimappWithPeriod(period),
chain.SimappWithGenesisTime(genesisTime),
chain.SimappWithConfig(config),
Expand All @@ -76,19 +71,17 @@ func chainSimulationHandler(cmd *cobra.Command, _ []string) error {
// newConfigFromFlags creates a simulation from the retrieved values of the flags.
func newConfigFromFlags(cmd *cobra.Command) simulation.Config {
var (
genesis, _ = cmd.Flags().GetString(flagSimappGenesis)
params, _ = cmd.Flags().GetString(flagSimappParams)
exportParamsPath, _ = cmd.Flags().GetString(flagSimappExportParamsPath)
exportParamsHeight, _ = cmd.Flags().GetInt(flagSimappExportParamsHeight)
exportStatePath, _ = cmd.Flags().GetString(flagSimappExportStatePath)
exportStatsPath, _ = cmd.Flags().GetString(flagSimappExportStatsPath)
seed, _ = cmd.Flags().GetInt64(flagSimappSeed)
initialBlockHeight, _ = cmd.Flags().GetInt(flagSimappInitialBlockHeight)
numBlocks, _ = cmd.Flags().GetInt(flagSimappNumBlocks)
blockSize, _ = cmd.Flags().GetInt(flagSimappBlockSize)
lean, _ = cmd.Flags().GetBool(flagSimappLean)
simulateEveryOperation, _ = cmd.Flags().GetBool(flagSimappSimulateEveryOperation)
printAllInvariants, _ = cmd.Flags().GetBool(flagSimappPrintAllInvariants)
genesis, _ = cmd.Flags().GetString(flagSimappGenesis)
params, _ = cmd.Flags().GetString(flagSimappParams)
exportParamsPath, _ = cmd.Flags().GetString(flagSimappExportParamsPath)
exportParamsHeight, _ = cmd.Flags().GetInt(flagSimappExportParamsHeight)
exportStatePath, _ = cmd.Flags().GetString(flagSimappExportStatePath)
exportStatsPath, _ = cmd.Flags().GetString(flagSimappExportStatsPath)
seed, _ = cmd.Flags().GetInt64(flagSimappSeed)
initialBlockHeight, _ = cmd.Flags().GetInt(flagSimappInitialBlockHeight)
numBlocks, _ = cmd.Flags().GetInt(flagSimappNumBlocks)
blockSize, _ = cmd.Flags().GetInt(flagSimappBlockSize)
lean, _ = cmd.Flags().GetBool(flagSimappLean)
)
return simulation.Config{
Commit: true,
Expand All @@ -103,8 +96,6 @@ func newConfigFromFlags(cmd *cobra.Command) simulation.Config {
NumBlocks: numBlocks,
BlockSize: blockSize,
Lean: lean,
OnOperation: simulateEveryOperation,
AllInvariants: printAllInvariants,
}
}

Expand All @@ -121,11 +112,8 @@ func simappFlags(c *cobra.Command) {
c.Flags().Int(flagSimappNumBlocks, 200, "number of new blocks to simulate from the initial block height")
c.Flags().Int(flagSimappBlockSize, 30, "operations per block")
c.Flags().Bool(flagSimappLean, false, "lean simulation log output")
c.Flags().Bool(flagSimappSimulateEveryOperation, false, "run slow invariants every operation")
c.Flags().Bool(flagSimappPrintAllInvariants, false, "print all invariants if a broken invariant is found")

// simulation flags
c.Flags().BoolP(flagSimappVerbose, "v", false, "verbose log output")
c.Flags().Uint(flagSimappPeriod, 0, "run slow invariants only once every period assertions")
c.Flags().Int64(flagSimappGenesisTime, 0, "override genesis UNIX time instead of using a random UNIX time")
}
8 changes: 4 additions & 4 deletions ignite/cmd/scaffold_module.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,7 @@ import (
)

// moduleNameKeeperAlias is a map of well known module names that have a different keeper name than the usual <module-name>Keeper.
var moduleNameKeeperAlias = map[string]string{
"auth": "account", // TODO(@julienrbrt) remove this when x/accounts is released
}
var moduleNameKeeperAlias = map[string]string{}

const (
flagDep = "dep"
Expand Down Expand Up @@ -103,12 +101,14 @@ params.

c.Flags().AddFlagSet(flagSetYes())
c.Flags().StringSlice(flagDep, []string{}, "add a dependency on another module")
c.Flags().Bool(flagIBC, false, "add IBC functionality")
// c.Flags().Bool(flagIBC, false, "add IBC functionality")
c.Flags().String(flagIBCOrdering, "none", "channel ordering of the IBC module [none|ordered|unordered]")
c.Flags().Bool(flagRequireRegistration, false, "fail if module can't be registered")
c.Flags().StringSlice(flagParams, []string{}, "add module parameters")
c.Flags().StringSlice(flagModuleConfigs, []string{}, "add module configs")

_ = c.Flags().MarkDeprecated(flagIBC, "IBC modules are temporarily not supported in Ignite v29 (waiting to IBC compatible version with Cosmos SDK v0.52)") // https://github.com/ignite/cli/pull/4289

return c
}

Expand Down
45 changes: 24 additions & 21 deletions ignite/internal/plugin/testdata/execute_fail/go.mod
Original file line number Diff line number Diff line change
@@ -1,33 +1,36 @@
module execute_fail

go 1.23
go 1.23.1

replace (
github.com/cosmos/cosmos-sdk => github.com/cosmos/cosmos-sdk v0.52.0-beta.1
github.com/ignite/cli/v29 => ../../../../..
)

require (
github.com/hashicorp/go-plugin v1.6.0
github.com/hashicorp/go-plugin v1.6.1
github.com/ignite/cli/v29 v29.0.0
)

replace github.com/ignite/cli/v29 => ../../../../..

require (
dario.cat/mergo v1.0.0 // indirect
github.com/Microsoft/go-winio v0.6.1 // indirect
github.com/ProtonMail/go-crypto v1.0.0 // indirect
github.com/aymanbagabas/go-osc52 v1.2.1 // indirect
github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect
github.com/aymerick/douceur v0.2.0 // indirect
github.com/blang/semver/v4 v4.0.0 // indirect
github.com/charmbracelet/lipgloss v0.6.0 // indirect
github.com/cloudflare/circl v1.3.7 // indirect
github.com/cockroachdb/errors v1.11.1 // indirect
github.com/cockroachdb/errors v1.11.3 // indirect
github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect
github.com/cockroachdb/redact v1.1.5 // indirect
github.com/cosmos/btcutil v1.0.5 // indirect
github.com/cosmos/cosmos-sdk v0.50.9 // indirect
github.com/cosmos/cosmos-sdk v0.52.0 // indirect
github.com/cyphar/filepath-securejoin v0.2.4 // indirect
github.com/emirpasic/gods v1.18.1 // indirect
github.com/fatih/color v1.17.0 // indirect
github.com/fatih/structs v1.1.0 // indirect
github.com/getsentry/sentry-go v0.27.0 // indirect
github.com/getsentry/sentry-go v0.28.1 // indirect
github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect
github.com/go-git/go-billy/v5 v5.5.0 // indirect
github.com/go-git/go-git/v5 v5.12.0 // indirect
Expand All @@ -51,7 +54,7 @@ require (
github.com/gorilla/css v1.0.0 // indirect
github.com/hashicorp/go-hclog v1.6.3 // indirect
github.com/hashicorp/yamux v0.1.1 // indirect
github.com/imdario/mergo v0.3.13 // indirect
github.com/imdario/mergo v0.3.15 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect
github.com/kevinburke/ssh_config v1.2.0 // indirect
Expand All @@ -60,12 +63,12 @@ require (
github.com/lucasb-eyer/go-colorful v1.2.0 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/mattn/go-runewidth v0.0.14 // indirect
github.com/mattn/go-runewidth v0.0.15 // indirect
github.com/microcosm-cc/bluemonday v1.0.23 // indirect
github.com/mitchellh/go-testing-interface v1.14.1 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/muesli/reflow v0.3.0 // indirect
github.com/muesli/termenv v0.14.0 // indirect
github.com/muesli/termenv v0.15.2 // indirect
github.com/oklog/run v1.1.0 // indirect
github.com/otiai10/copy v1.14.0 // indirect
github.com/pjbgf/sha1cd v0.3.0 // indirect
Expand All @@ -80,18 +83,18 @@ require (
github.com/spf13/cobra v1.8.1 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/xanzy/ssh-agent v0.3.3 // indirect
go.etcd.io/bbolt v1.3.9 // indirect
golang.org/x/crypto v0.26.0 // indirect
golang.org/x/mod v0.20.0 // indirect
golang.org/x/net v0.28.0 // indirect
go.etcd.io/bbolt v1.4.0-alpha.1 // indirect
golang.org/x/crypto v0.27.0 // indirect
golang.org/x/mod v0.21.0 // indirect
golang.org/x/net v0.29.0 // indirect
golang.org/x/sync v0.8.0 // indirect
golang.org/x/sys v0.23.0 // indirect
golang.org/x/term v0.23.0 // indirect
golang.org/x/text v0.17.0 // indirect
golang.org/x/tools v0.24.0 // indirect
golang.org/x/sys v0.25.0 // indirect
golang.org/x/term v0.24.0 // indirect
golang.org/x/text v0.18.0 // indirect
golang.org/x/tools v0.25.0 // indirect
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240730163845-b1a4ccb954bf // indirect
google.golang.org/grpc v1.64.1 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1 // indirect
google.golang.org/grpc v1.66.1 // indirect
google.golang.org/protobuf v1.34.2 // indirect
gopkg.in/warnings.v0 v0.1.2 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
Expand Down
45 changes: 24 additions & 21 deletions ignite/internal/plugin/testdata/execute_ok/go.mod
Original file line number Diff line number Diff line change
@@ -1,33 +1,36 @@
module execute_ok

go 1.23
go 1.23.1

replace (
github.com/cosmos/cosmos-sdk => github.com/cosmos/cosmos-sdk v0.52.0-beta.1
github.com/ignite/cli/v29 => ../../../../..
)

require (
github.com/hashicorp/go-plugin v1.6.0
github.com/hashicorp/go-plugin v1.6.1
github.com/ignite/cli/v29 v29.0.0
)

replace github.com/ignite/cli/v29 => ../../../../..

require (
dario.cat/mergo v1.0.0 // indirect
github.com/Microsoft/go-winio v0.6.1 // indirect
github.com/ProtonMail/go-crypto v1.0.0 // indirect
github.com/aymanbagabas/go-osc52 v1.2.1 // indirect
github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect
github.com/aymerick/douceur v0.2.0 // indirect
github.com/blang/semver/v4 v4.0.0 // indirect
github.com/charmbracelet/lipgloss v0.6.0 // indirect
github.com/cloudflare/circl v1.3.7 // indirect
github.com/cockroachdb/errors v1.11.1 // indirect
github.com/cockroachdb/errors v1.11.3 // indirect
github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect
github.com/cockroachdb/redact v1.1.5 // indirect
github.com/cosmos/btcutil v1.0.5 // indirect
github.com/cosmos/cosmos-sdk v0.50.9 // indirect
github.com/cosmos/cosmos-sdk v0.52.0 // indirect
github.com/cyphar/filepath-securejoin v0.2.4 // indirect
github.com/emirpasic/gods v1.18.1 // indirect
github.com/fatih/color v1.17.0 // indirect
github.com/fatih/structs v1.1.0 // indirect
github.com/getsentry/sentry-go v0.27.0 // indirect
github.com/getsentry/sentry-go v0.28.1 // indirect
github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect
github.com/go-git/go-billy/v5 v5.5.0 // indirect
github.com/go-git/go-git/v5 v5.12.0 // indirect
Expand All @@ -51,7 +54,7 @@ require (
github.com/gorilla/css v1.0.0 // indirect
github.com/hashicorp/go-hclog v1.6.3 // indirect
github.com/hashicorp/yamux v0.1.1 // indirect
github.com/imdario/mergo v0.3.13 // indirect
github.com/imdario/mergo v0.3.15 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect
github.com/kevinburke/ssh_config v1.2.0 // indirect
Expand All @@ -60,12 +63,12 @@ require (
github.com/lucasb-eyer/go-colorful v1.2.0 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/mattn/go-runewidth v0.0.14 // indirect
github.com/mattn/go-runewidth v0.0.15 // indirect
github.com/microcosm-cc/bluemonday v1.0.23 // indirect
github.com/mitchellh/go-testing-interface v1.14.1 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/muesli/reflow v0.3.0 // indirect
github.com/muesli/termenv v0.14.0 // indirect
github.com/muesli/termenv v0.15.2 // indirect
github.com/oklog/run v1.1.0 // indirect
github.com/otiai10/copy v1.14.0 // indirect
github.com/pjbgf/sha1cd v0.3.0 // indirect
Expand All @@ -80,18 +83,18 @@ require (
github.com/spf13/cobra v1.8.1 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/xanzy/ssh-agent v0.3.3 // indirect
go.etcd.io/bbolt v1.3.9 // indirect
golang.org/x/crypto v0.26.0 // indirect
golang.org/x/mod v0.20.0 // indirect
golang.org/x/net v0.28.0 // indirect
go.etcd.io/bbolt v1.4.0-alpha.1 // indirect
golang.org/x/crypto v0.27.0 // indirect
golang.org/x/mod v0.21.0 // indirect
golang.org/x/net v0.29.0 // indirect
golang.org/x/sync v0.8.0 // indirect
golang.org/x/sys v0.23.0 // indirect
golang.org/x/term v0.23.0 // indirect
golang.org/x/text v0.17.0 // indirect
golang.org/x/tools v0.24.0 // indirect
golang.org/x/sys v0.25.0 // indirect
golang.org/x/term v0.24.0 // indirect
golang.org/x/text v0.18.0 // indirect
golang.org/x/tools v0.25.0 // indirect
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240730163845-b1a4ccb954bf // indirect
google.golang.org/grpc v1.64.1 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1 // indirect
google.golang.org/grpc v1.66.1 // indirect
google.golang.org/protobuf v1.34.2 // indirect
gopkg.in/warnings.v0 v0.1.2 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
Expand Down
5 changes: 4 additions & 1 deletion ignite/internal/tools/gen-config-doc/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@ module github.com/ignite/cli/ignite/internal/tools/gen-config-doc

go 1.23

replace github.com/ignite/cli/v29 => ../../../../
replace (
github.com/cosmos/cosmos-sdk => github.com/cosmos/cosmos-sdk v0.52.0-beta.1
github.com/ignite/cli/v29 => ../../../../
)

require (
github.com/gobuffalo/genny/v2 v2.1.0
Expand Down
5 changes: 4 additions & 1 deletion ignite/internal/tools/gen-mig-diffs/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@ module github.com/ignite/cli/ignite/internal/tools/gen-mig-diffs

go 1.23

replace github.com/ignite/cli/v29 => ../../../../
replace (
github.com/ignite/cli/v29 => ../../../../
github.com/cosmos/cosmos-sdk => github.com/cosmos/cosmos-sdk v0.52.0-beta.1
)

require (
github.com/Masterminds/semver/v3 v3.2.1
Expand Down
5 changes: 3 additions & 2 deletions ignite/pkg/chaincmd/chaincmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ const (
commandGentx = "gentx"
commandCollectGentxs = "collect-gentxs"
commandValidateGenesis = "validate"
commandExportGenssis = "export"
commandShowNodeID = "show-node-id"
commandStatus = "status"
commandTx = "tx"
commandQuery = "query"
commandUnsafeReset = "unsafe-reset-all"
commandExport = "export"
commandTendermint = "tendermint"
commandTestnetInPlace = "in-place-testnet"

Expand Down Expand Up @@ -492,7 +492,8 @@ func (c ChainCmd) UnsafeResetCommand() step.Option {
// ExportCommand returns the command to export the state of the blockchain into a genesis file.
func (c ChainCmd) ExportCommand() step.Option {
command := []string{
commandExport,
commandGenesis,
commandExportGenssis,
}
return c.daemonCommand(command)
}
Expand Down
Loading

0 comments on commit 01c94ac

Please sign in to comment.