github.com/cosmos/cosmos-sdk@v0.50.10/x/crisis/README.md (about)

     1  ---
     2  sidebar_position: 1
     3  ---
     4  
     5  # `x/crisis`
     6  
     7  ## Overview
     8  
     9  The crisis module halts the blockchain under the circumstance that a blockchain
    10  invariant is broken. Invariants can be registered with the application during the
    11  application initialization process.
    12  
    13  ## Contents
    14  
    15  * [State](#state)
    16  * [Messages](#messages)
    17  * [Events](#events)
    18  * [Parameters](#parameters)
    19  * [Client](#client)
    20      * [CLI](#cli)
    21  
    22  ## State
    23  
    24  ### ConstantFee
    25  
    26  Due to the anticipated large gas cost requirement to verify an invariant (and
    27  potential to exceed the maximum allowable block gas limit) a constant fee is
    28  used instead of the standard gas consumption method. The constant fee is
    29  intended to be larger than the anticipated gas cost of running the invariant
    30  with the standard gas consumption method.
    31  
    32  The ConstantFee param is stored in the module params state with the prefix of `0x01`,
    33  it can be updated with governance or the address with authority.
    34  
    35  * Params: `mint/params -> legacy_amino(sdk.Coin)`
    36  
    37  ## Messages
    38  
    39  In this section we describe the processing of the crisis messages and the
    40  corresponding updates to the state.
    41  
    42  ### MsgVerifyInvariant
    43  
    44  Blockchain invariants can be checked using the `MsgVerifyInvariant` message.
    45  
    46  ```protobuf reference
    47  https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/proto/cosmos/crisis/v1beta1/tx.proto#L26-L42
    48  ```
    49  
    50  This message is expected to fail if:
    51  
    52  * the sender does not have enough coins for the constant fee
    53  * the invariant route is not registered
    54  
    55  This message checks the invariant provided, and if the invariant is broken it
    56  panics, halting the blockchain. If the invariant is broken, the constant fee is
    57  never deducted as the transaction is never committed to a block (equivalent to
    58  being refunded). However, if the invariant is not broken, the constant fee will
    59  not be refunded.
    60  
    61  ## Events
    62  
    63  The crisis module emits the following events:
    64  
    65  ### Handlers
    66  
    67  #### MsgVerifyInvariance
    68  
    69  | Type      | Attribute Key | Attribute Value  |
    70  |-----------|---------------|------------------|
    71  | invariant | route         | {invariantRoute} |
    72  | message   | module        | crisis           |
    73  | message   | action        | verify_invariant |
    74  | message   | sender        | {senderAddress}  |
    75  
    76  ## Parameters
    77  
    78  The crisis module contains the following parameters:
    79  
    80  | Key         | Type          | Example                           |
    81  |-------------|---------------|-----------------------------------|
    82  | ConstantFee | object (coin) | {"denom":"uatom","amount":"1000"} |
    83  
    84  ## Client
    85  
    86  ### CLI
    87  
    88  A user can query and interact with the `crisis` module using the CLI.
    89  
    90  #### Transactions
    91  
    92  The `tx` commands allow users to interact with the `crisis` module.
    93  
    94  ```bash
    95  simd tx crisis --help
    96  ```
    97  
    98  ##### invariant-broken
    99  
   100  The `invariant-broken` command submits proof when an invariant was broken to halt the chain
   101  
   102  ```bash
   103  simd tx crisis invariant-broken [module-name] [invariant-route] [flags]
   104  ```
   105  
   106  Example:
   107  
   108  ```bash
   109  simd tx crisis invariant-broken bank total-supply --from=[keyname or address]
   110  ```