simulation

package
v0.0.0-...-c6cd46a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 27, 2025 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OpWeightMsgTypeMsgEnableCCTX                  = "op_weight_msg_enable_crosschain_flags"         // #nosec G101 not a hardcoded credential
	OpWeightMsgTypeMsgDisableCCTX                 = "op_weight_msg_disable_crosschain_flags"        // #nosec G101 not a hardcoded credential
	OpWeightMsgTypeMsgDisableFastConfirmation     = "op_weight_msg_disable_fast_confirmation"       // #nosec G101 not a hardcoded credential
	OpWeightMsgTypeMsgVoteTSS                     = "op_weight_msg_vote_tss"                        // #nosec G101 not a hardcoded credential
	OpWeightMsgTypeMsgUpdateKeygen                = "op_weight_msg_update_keygen"                   // #nosec G101 not a hardcoded credential
	OpWeightMsgTypeMsgUpdateObserver              = "op_weight_msg_update_observer"                 // #nosec G101 not a hardcoded credential
	OpWeightMsgTypeMsgUpdateChainParams           = "op_weight_msg_update_chain_params"             // #nosec G101 not a hardcoded credential
	OpWeightMsgTypeMsgRemoveChainParams           = "op_weight_msg_remove_chain_params"             // #nosec G101 not a hardcoded credential
	OpWeightMsgTypeMsgResetChainNonces            = "op_weight_msg_reset_chain_nonces"              // #nosec G101 not a hardcoded credential
	OpWeightMsgTypeMsgUpdateGasPriceIncreaseFlags = "op_weight_msg_update_gas_price_increase_flags" // #nosec G101 not a hardcoded credential
	OpWeightMsgTypeMsgAddObserver                 = "op_weight_msg_add_observer"                    // #nosec G101 not a hardcoded credential

	// DefaultWeightMsgTypeMsgEnableCCTX We use a high weight for this operation
	// to ensure that it is present in the block more number of times than any operation that changes the validator set
	// Arrived at this number based on the weights used in the cosmos sdk staking module and through some trial and error
	DefaultWeightMsgTypeMsgEnableCCTX                  = 100
	DefaultWeightMsgTypeMsgDisableCCTX                 = 10
	DefaultWeightMsgTypeMsgDisableFastConfirmation     = 10
	DefaultWeightMsgTypeMsgVoteTSS                     = 10
	DefaultWeightMsgTypeMsgUpdateKeygen                = 10
	DefaultWeightMsgTypeMsgUpdateObserver              = 10
	DefaultWeightMsgTypeMsgUpdateChainParams           = 10
	DefaultWeightMsgTypeMsgRemoveChainParams           = 10
	DefaultWeightMsgTypeMsgResetChainNonces            = 5
	DefaultWeightMsgTypeMsgUpdateGasPriceIncreaseFlags = 10
	DefaultWeightMsgTypeMsgAddObserver                 = 5
)

Based on the weights assigned in the cosmos sdk modules, 100 seems to the max weight used,and we should use relative weights to signify the number of each operation in a block.

Variables

View Source
var (
	TypeMsgEnableCCTX                  = sdk.MsgTypeURL(&observertypes.MsgEnableCCTX{})
	TypeMsgDisableCCTX                 = sdk.MsgTypeURL(&observertypes.MsgDisableCCTX{})
	TypeMsgDisableFastConfirmation     = sdk.MsgTypeURL(&observertypes.MsgDisableFastConfirmation{})
	TypeMsgVoteTSS                     = sdk.MsgTypeURL(&observertypes.MsgVoteTSS{})
	TypeMsgUpdateKeygen                = sdk.MsgTypeURL(&observertypes.MsgUpdateKeygen{})
	TypeMsgUpdateObserver              = sdk.MsgTypeURL(&observertypes.MsgUpdateObserver{})
	TypeMsgUpdateChainParams           = sdk.MsgTypeURL(&observertypes.MsgUpdateChainParams{})
	TypeMsgRemoveChainParams           = sdk.MsgTypeURL(&observertypes.MsgRemoveChainParams{})
	TypeMsgResetChainNonces            = sdk.MsgTypeURL(&observertypes.MsgResetChainNonces{})
	TypeMsgUpdateGasPriceIncreaseFlags = sdk.MsgTypeURL(&observertypes.MsgUpdateGasPriceIncreaseFlags{})
	TypeMsgAddObserver                 = sdk.MsgTypeURL(&observertypes.MsgAddObserver{})
)

Functions

func NewDecodeStore

func NewDecodeStore(cdc codec.Codec) func(kvA, kvB kv.Pair) string

NewDecodeStore returns a decoder function closure that unmarshals the KVPair's Value to the corresponding observer types.

func SimulateAddObserver

func SimulateAddObserver(k keeper.Keeper) simtypes.Operation

SimulateAddObserver generates a TypeMsgAddObserver and delivers it. This message sets AddNodeAccountOnly to false; Therefore, it adds the observer to the observer set

func SimulateAddObserverNodeAccount

func SimulateAddObserverNodeAccount(k keeper.Keeper) simtypes.Operation

SimulateAddObserverNodeAccount generates a TypeMsgAddObserver and delivers it. This message sets AddNodeAccountOnly to true to it does not add the observer to the observer set

func SimulateDisableCCTX

func SimulateDisableCCTX(k keeper.Keeper) simtypes.Operation

SimulateDisableCCTX generates a MsgDisableCCTX and delivers it.

func SimulateDisableFastConfirmation

func SimulateDisableFastConfirmation(k keeper.Keeper) simtypes.Operation

SimulateDisableFastConfirmation generates a MsgDisableFastConfirmation and delivers it.

func SimulateEnableCCTX

func SimulateEnableCCTX(k keeper.Keeper) simtypes.Operation

SimulateEnableCCTX generates a MsgEnableCCTX and delivers it.

func SimulateMsgRemoveChainParams

func SimulateMsgRemoveChainParams(k keeper.Keeper) simtypes.Operation

SimulateMsgRemoveChainParams generates a MsgRemoveChainParams and delivers it. This message removes a chain from the list This is not being run right now as the removal causes a lot of errors for the other operations.

func SimulateMsgVoteTSS

func SimulateMsgVoteTSS(k keeper.Keeper) simtypes.Operation

SimulateMsgVoteTSS generates a MsgVoteTSS with random values and delivers it, it also schedules future votes for the same ballot

func SimulateResetChainNonces

func SimulateResetChainNonces(k keeper.Keeper) simtypes.Operation

SimulateResetChainNonces generates a MsgResetChainNonces and delivers it.

func SimulateUpdateChainParams

func SimulateUpdateChainParams(k keeper.Keeper) simtypes.Operation

SimulateUpdateChainParams generates a MsgUpdateChainParams and delivers it.

func SimulateUpdateGasPriceIncreaseFlags

func SimulateUpdateGasPriceIncreaseFlags(k keeper.Keeper) simtypes.Operation

SimulateUpdateGasPriceIncreaseFlags generates a MsgUpdateGasPriceIncreaseFlags with random values

func SimulateUpdateKeygen

func SimulateUpdateKeygen(k keeper.Keeper) simtypes.Operation

SimulateUpdateKeygen generates a MsgUpdateKeygen and delivers it.

func SimulateUpdateObserver

func SimulateUpdateObserver(k keeper.Keeper) simtypes.Operation

SimulateUpdateObserver generates a TypeMsgUpdateObserver and delivers it.

func WeightedOperations

func WeightedOperations(
	appParams simtypes.AppParams, k keeper.Keeper,
) simulation.WeightedOperations

WeightedOperations for observer module

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL