Skip to content

Conversation

julienrbrt
Copy link
Member

Follow-up of #4423

This PR focuses solely on simulations for modules and the app using the new simx framework.

@julienrbrt julienrbrt marked this pull request as ready for review December 2, 2024 20:01
@julienrbrt
Copy link
Member Author

R4R and to be merged, once cosmos/cosmos-sdk#22721 is merged and backported, ignite testnet/chain simulate should be ok.

@julienrbrt
Copy link
Member Author

Once merged, I'll check the sdk.Context removal. Then onto v2 (where possibly let's scaffold tx validators) :)

@julienrbrt
Copy link
Member Author

R4R and to be merged, once cosmos/cosmos-sdk#22721 is merged and backported, ignite testnet/chain simulate should be ok.

Looks like after SDK bump it shown some issue in simulation wiring. Will fix ASAP

@devdammit
Copy link
Contributor

devdammit commented Dec 6, 2024

Looks like after SDK bump it shown some issue in simulation wiring. Will fix ASAP

Hi! I am getting an panic when running a full simulation on an empty scaffolded project via ignite 0.29 (nightly). Is this a related issue?

Trace:

goos: darwin
goarch: arm64
pkg: kepler/app
cpu: Apple M4 Pro
BenchmarkFullAppSimulation
    simulate.go:110: 2:43PM INF Starting SimulateFromSeed with randomness seed=1
panic: unable to resolve type URL /cosmos.vesting.v1beta1.DelayedVestingAccount

goroutine 41 [running]:
github.com/cosmos/cosmos-sdk/codec.(*ProtoCodec).MustMarshalJSON(0x98?, {0x1031187e0?, 0x140009aa040?})
	/Users/devdammit/.gvm/pkgsets/go1.23.3/global/pkg/mod/github.com/cosmos/cosmos-sdk@v0.52.0-beta.2/codec/proto_codec.go:159 +0x48
github.com/cosmos/cosmos-sdk/x/auth/simulation.RandomizedGenState(0x1400145e9c0, 0x1030f0810)
	/Users/devdammit/.gvm/pkgsets/go1.23.3/global/pkg/mod/github.com/cosmos/cosmos-sdk@v0.52.0-beta.2/x/auth/simulation/genesis.go:114 +0x288
github.com/cosmos/cosmos-sdk/x/auth.AppModule.GenerateGenesisState(...)
	/Users/devdammit/.gvm/pkgsets/go1.23.3/global/pkg/mod/github.com/cosmos/cosmos-sdk@v0.52.0-beta.2/x/auth/module.go:189
github.com/cosmos/cosmos-sdk/testutil/sims.generateGenesisStates(...)
	/Users/devdammit/.gvm/pkgsets/go1.23.3/global/pkg/mod/github.com/cosmos/cosmos-sdk@v0.52.0-beta.2/testutil/sims/state_helpers.go:273
github.com/cosmos/cosmos-sdk/testutil/sims.AppStateRandomizedFn({0x14001d9fa00, 0x5, 0x81b71b66c2?}, 0x1400205ca20, {0x103131a90, 0x140002ac8e0}, {0x14002080000, 0x99f, 0x99f}, {0x24093de1afa?, ...}, ...)
	/Users/devdammit/.gvm/pkgsets/go1.23.3/global/pkg/mod/github.com/cosmos/cosmos-sdk@v0.52.0-beta.2/testutil/sims/state_helpers.go:203 +0x26c
kepler/app.setupStateFactory.AppStateFn.func1(0x1400205ca20, {0x14002080000, _, _}, {{0x0, 0x0}, {0x0, 0x0}, {0x0, 0x0}, ...})
	/Users/devdammit/.gvm/pkgsets/go1.23.3/global/pkg/mod/github.com/cosmos/cosmos-sdk@v0.52.0-beta.2/testutil/sims/state_helpers.go:89 +0x21c
github.com/cosmos/cosmos-sdk/x/simulation.initChain(0x1400205ca20, {0x3fe359608841ff3f, _, _, {_, _, _}, {_, _}, {_, ...}}, ...)
	/Users/devdammit/.gvm/pkgsets/go1.23.3/global/pkg/mod/github.com/cosmos/cosmos-sdk@v0.52.0-beta.2/x/simulation/simulate.go:44 +0x98
github.com/cosmos/cosmos-sdk/x/simulation.SimulateFromSeedX({_, _}, {_, _}, {_, _}, _, _, _, {_, ...}, ...)
	/Users/devdammit/.gvm/pkgsets/go1.23.3/global/pkg/mod/github.com/cosmos/cosmos-sdk@v0.52.0-beta.2/x/simulation/simulate.go:119 +0x428
github.com/cosmos/cosmos-sdk/simsx.RunWithSeed[...]({0x1031569c0, _}, {{0x0, 0x0}, {0x0, 0x0}, {0x0, 0x0}, 0x0, {0x0, ...}, ...}, ...)
	/Users/devdammit/.gvm/pkgsets/go1.23.3/global/pkg/mod/github.com/cosmos/cosmos-sdk@v0.52.0-beta.2/simsx/runner.go:156 +0x5b0
kepler/app.BenchmarkFullAppSimulation(0x14000142788?)
	/Users/devdammit/workspace/dittonetwork/kepler/app/sim_bench_test.go:21 +0x1d0
testing.(*B).runN(0x14000142788, 0x1)
	/Users/devdammit/.gvm/gos/go1.23.3/src/testing/benchmark.go:193 +0x128
testing.(*B).run1.func1()
	/Users/devdammit/.gvm/gos/go1.23.3/src/testing/benchmark.go:215 +0x4c
created by testing.(*B).run1 in goroutine 1
	/Users/devdammit/.gvm/gos/go1.23.3/src/testing/benchmark.go:208 +0x90

@julienrbrt
Copy link
Member Author

Looks like after SDK bump it shown some issue in simulation wiring. Will fix ASAP

Hi! I am getting an panic when running a full simulation on an empty scaffolded project via ignite 0.29 (nightly). Is this a related issue?

Trace:

goos: darwin
goarch: arm64
pkg: kepler/app
cpu: Apple M4 Pro
BenchmarkFullAppSimulation
    simulate.go:110: 2:43PM INF Starting SimulateFromSeed with randomness seed=1
panic: unable to resolve type URL /cosmos.vesting.v1beta1.DelayedVestingAccount

goroutine 41 [running]:
github.com/cosmos/cosmos-sdk/codec.(*ProtoCodec).MustMarshalJSON(0x98?, {0x1031187e0?, 0x140009aa040?})
	/Users/devdammit/.gvm/pkgsets/go1.23.3/global/pkg/mod/github.com/cosmos/cosmos-sdk@v0.52.0-beta.2/codec/proto_codec.go:159 +0x48
github.com/cosmos/cosmos-sdk/x/auth/simulation.RandomizedGenState(0x1400145e9c0, 0x1030f0810)
	/Users/devdammit/.gvm/pkgsets/go1.23.3/global/pkg/mod/github.com/cosmos/cosmos-sdk@v0.52.0-beta.2/x/auth/simulation/genesis.go:114 +0x288
github.com/cosmos/cosmos-sdk/x/auth.AppModule.GenerateGenesisState(...)
	/Users/devdammit/.gvm/pkgsets/go1.23.3/global/pkg/mod/github.com/cosmos/cosmos-sdk@v0.52.0-beta.2/x/auth/module.go:189
github.com/cosmos/cosmos-sdk/testutil/sims.generateGenesisStates(...)
	/Users/devdammit/.gvm/pkgsets/go1.23.3/global/pkg/mod/github.com/cosmos/cosmos-sdk@v0.52.0-beta.2/testutil/sims/state_helpers.go:273
github.com/cosmos/cosmos-sdk/testutil/sims.AppStateRandomizedFn({0x14001d9fa00, 0x5, 0x81b71b66c2?}, 0x1400205ca20, {0x103131a90, 0x140002ac8e0}, {0x14002080000, 0x99f, 0x99f}, {0x24093de1afa?, ...}, ...)
	/Users/devdammit/.gvm/pkgsets/go1.23.3/global/pkg/mod/github.com/cosmos/cosmos-sdk@v0.52.0-beta.2/testutil/sims/state_helpers.go:203 +0x26c
kepler/app.setupStateFactory.AppStateFn.func1(0x1400205ca20, {0x14002080000, _, _}, {{0x0, 0x0}, {0x0, 0x0}, {0x0, 0x0}, ...})
	/Users/devdammit/.gvm/pkgsets/go1.23.3/global/pkg/mod/github.com/cosmos/cosmos-sdk@v0.52.0-beta.2/testutil/sims/state_helpers.go:89 +0x21c
github.com/cosmos/cosmos-sdk/x/simulation.initChain(0x1400205ca20, {0x3fe359608841ff3f, _, _, {_, _, _}, {_, _}, {_, ...}}, ...)
	/Users/devdammit/.gvm/pkgsets/go1.23.3/global/pkg/mod/github.com/cosmos/cosmos-sdk@v0.52.0-beta.2/x/simulation/simulate.go:44 +0x98
github.com/cosmos/cosmos-sdk/x/simulation.SimulateFromSeedX({_, _}, {_, _}, {_, _}, _, _, _, {_, ...}, ...)
	/Users/devdammit/.gvm/pkgsets/go1.23.3/global/pkg/mod/github.com/cosmos/cosmos-sdk@v0.52.0-beta.2/x/simulation/simulate.go:119 +0x428
github.com/cosmos/cosmos-sdk/simsx.RunWithSeed[...]({0x1031569c0, _}, {{0x0, 0x0}, {0x0, 0x0}, {0x0, 0x0}, 0x0, {0x0, ...}, ...}, ...)
	/Users/devdammit/.gvm/pkgsets/go1.23.3/global/pkg/mod/github.com/cosmos/cosmos-sdk@v0.52.0-beta.2/simsx/runner.go:156 +0x5b0
kepler/app.BenchmarkFullAppSimulation(0x14000142788?)
	/Users/devdammit/workspace/dittonetwork/kepler/app/sim_bench_test.go:21 +0x1d0
testing.(*B).runN(0x14000142788, 0x1)
	/Users/devdammit/.gvm/gos/go1.23.3/src/testing/benchmark.go:193 +0x128
testing.(*B).run1.func1()
	/Users/devdammit/.gvm/gos/go1.23.3/src/testing/benchmark.go:215 +0x4c
created by testing.(*B).run1 in goroutine 1
	/Users/devdammit/.gvm/gos/go1.23.3/src/testing/benchmark.go:208 +0x90

Yes! This has been fixed in the SDK: cosmos/cosmos-sdk#22726
This PR updates the simulation to the latest SDK framework.

@julienrbrt julienrbrt requested a review from Pantani December 6, 2024 09:36
@julienrbrt julienrbrt enabled auto-merge (squash) December 6, 2024 09:43
@julienrbrt
Copy link
Member Author

Fixed in last commit cc @Pantani, ready to merge now 👍🏾

@Pantani
Copy link
Collaborator

Pantani commented Dec 6, 2024

There is a deprecated decoded string into the GenerateGenesisState function here

https://github.com/ignite/cli/blob/main/ignite/templates/module/create/files/base/x/%7B%7BmoduleName%7D%7D/module/simulation.go.plush#L34

@julienrbrt julienrbrt merged commit bd9a57f into main Dec 6, 2024
43 of 45 checks passed
@julienrbrt julienrbrt deleted the julien/sims branch December 6, 2024 19:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants