From 957a14da13474c8183debec83a50b885607bace6 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Fri, 27 Sep 2024 11:32:15 +0000 Subject: [PATCH] fix(sims): Use liveness matrix for val sign status in sims (backport #21952) (#21957) Co-authored-by: Alexander Peters Co-authored-by: Julien Robert --- CHANGELOG.md | 4 ++++ x/simulation/mock_cometbft.go | 5 ++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a633c7dbec..45e9a3224d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -51,6 +51,10 @@ Every module contains its own CHANGELOG.md. Please refer to the module you are i * (runtime) [#21704](https://github.com/cosmos/cosmos-sdk/pull/21704) Move `upgradetypes.StoreLoader` to runtime and alias it in upgrade for backward compatibility. * (sims)[#21613](https://github.com/cosmos/cosmos-sdk/pull/21613) Add sims2 framework and factory methods for simpler message factories in modules +### Bug Fixes + +* (sims) [#21952](https://github.com/cosmos/cosmos-sdk/pull/21952) Use liveness matrix for validator sign status in sims + ### 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. diff --git a/x/simulation/mock_cometbft.go b/x/simulation/mock_cometbft.go index c9572dd469..691494c64f 100644 --- a/x/simulation/mock_cometbft.go +++ b/x/simulation/mock_cometbft.go @@ -151,10 +151,13 @@ func RandomRequestFinalizeBlock( signed = false } + var commitStatus cmtproto.BlockIDFlag if signed { event("begin_block", "signing", "signed") + commitStatus = cmtproto.BlockIDFlagCommit } else { event("begin_block", "signing", "missed") + commitStatus = cmtproto.BlockIDFlagAbsent } voteInfos[i] = abci.VoteInfo{ @@ -162,7 +165,7 @@ func RandomRequestFinalizeBlock( Address: SumTruncated(mVal.val.PubKeyBytes), Power: mVal.val.Power, }, - BlockIdFlag: cmtproto.BlockIDFlagCommit, + BlockIdFlag: commitStatus, } }