The crisis module halts the blockchain under the circumstance that a blockchain invariant is broken. Invariants can be registered with the application during the application initialization process.
Due to the anticipated large gas cost requirement to verify an invariant (and potential to exceed the maximum allowable block gas limit) a constant fee is used instead of the standard gas consumption method. The constant fee is intended to be larger than the anticipated gas cost of running the invariant with the standard gas consumption method.
The ConstantFee param is stored in the module params state with the prefix of
it can be updated with governance or the address with authority.
mint/params -> legacy_amino(sdk.Coin)
In this section we describe the processing of the crisis messages and the corresponding updates to the state.
Blockchain invariants can be checked using the
This message is expected to fail if:
- the sender does not have enough coins for the constant fee
- the invariant route is not registered
This message checks the invariant provided, and if the invariant is broken it panics, halting the blockchain. If the invariant is broken, the constant fee is never deducted as the transaction is never committed to a block (equivalent to being refunded). However, if the invariant is not broken, the constant fee will not be refunded.
The crisis module emits the following events:
|Type||Attribute Key||Attribute Value|
The crisis module contains the following parameters:
A user can query and interact with the
crisis module using the CLI.
tx commands allow users to interact with the
simd tx crisis --help
invariant-broken command submits proof when an invariant was broken to halt the chain
simd tx crisis invariant-broken [module-name] [invariant-route] [flags]
simd tx crisis invariant-broken bank total-supply --from=[keyname or address]