From 35731fa492b0488a2a237e819ae8e582c567e777 Mon Sep 17 00:00:00 2001 From: Alex Peters Date: Wed, 25 Sep 2024 13:36:22 +0200 Subject: [PATCH 1/3] Skip sims loop when running dry on validators --- x/simulation/simulate.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/x/simulation/simulate.go b/x/simulation/simulate.go index faf69e1df4db..bd4f47704484 100644 --- a/x/simulation/simulate.go +++ b/x/simulation/simulate.go @@ -130,6 +130,10 @@ func SimulateFromSeedX( return blockedAddrs[acc.AddressBech32] }) nextValidators := validators + if len(nextValidators) == 0 { + tb.Skip("skipping: empty validator set") + return + } var ( pastTimes []time.Time @@ -264,6 +268,10 @@ func SimulateFromSeedX( // on the next block validators = nextValidators nextValidators = updateValidators(tb, r, params, validators, res.ValidatorUpdates, eventStats.Tally) + if len(nextValidators) == 0 { + tb.Skip("skipping: empty validator set") + return exportedParams, accs, err + } // update the exported params if config.ExportParamsPath != "" && int64(config.ExportParamsHeight) == blockHeight { From 22947080778de809f4833f3a662597d44c2332d6 Mon Sep 17 00:00:00 2001 From: Alex Peters Date: Wed, 25 Sep 2024 13:39:40 +0200 Subject: [PATCH 2/3] Update Changelog --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7b1f4793636d..00492c1178e0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -55,6 +55,8 @@ Every module contains its own CHANGELOG.md. Please refer to the module you are i ### Bug Fixes +* (sims) [21906](https://github.com/cosmos/cosmos-sdk/pull/21906) Skip sims loop when running dry on validators + ### API Breaking Changes * (types/mempool) [#21744](https://github.com/cosmos/cosmos-sdk/pull/21744) Update types/mempool.Mempool interface to take decoded transactions. This avoid to decode the transaction twice. From 44d6473d76f2eb6b0282c5525003b1aff195631f Mon Sep 17 00:00:00 2001 From: Alex Peters Date: Wed, 25 Sep 2024 13:52:16 +0200 Subject: [PATCH 3/3] Minor updates --- CHANGELOG.md | 2 +- x/simulation/simulate.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 00492c1178e0..096a17085f4b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -55,7 +55,7 @@ Every module contains its own CHANGELOG.md. Please refer to the module you are i ### Bug Fixes -* (sims) [21906](https://github.com/cosmos/cosmos-sdk/pull/21906) Skip sims loop when running dry on validators +* (sims) [21906](https://github.com/cosmos/cosmos-sdk/pull/21906) Skip sims test when running dry on validators ### API Breaking Changes diff --git a/x/simulation/simulate.go b/x/simulation/simulate.go index bd4f47704484..3cd8c5c4f66e 100644 --- a/x/simulation/simulate.go +++ b/x/simulation/simulate.go @@ -131,8 +131,8 @@ func SimulateFromSeedX( }) nextValidators := validators if len(nextValidators) == 0 { - tb.Skip("skipping: empty validator set") - return + tb.Skip("skipping: empty validator set in genesis") + return params, accs, nil } var (