refactor(simulation): adjust unjail operation weight and clarify skip reason (#25294)

Co-authored-by: Alex | Interchain Labs <alex@cosmoslabs.io>
This commit is contained in:
Adrian 2025-09-12 20:21:36 +02:00 committed by GitHub
parent 81de795ded
commit 1a5c57b13d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -22,7 +22,7 @@ import (
const (
OpWeightMsgUnjail = "op_weight_msg_unjail"
DefaultWeightMsgUnjail = 100
DefaultWeightMsgUnjail = 5 // Reduced from 100 since validators are rarely jailed in simulations
)
// WeightedOperations returns all the operations from the module with their respective weights
@ -87,7 +87,8 @@ func SimulateMsgUnjail(
}
if !validator.IsJailed() {
// TODO: due to this condition this message is almost, if not always, skipped !
// This operation is often skipped because validators are rarely jailed in simulations.
// The weight has been reduced to 5 to reflect this reality.
return simtypes.NoOpMsg(types.ModuleName, msgType, "validator is not jailed"), nil, nil
}