github.com/ari-anchor/sei-tendermint@v0.0.0-20230519144642-dc826b7b56bb/docs/architecture/adr-052-tendermint-mode.md (about)

     1  # ADR 052: Tendermint Mode
     2  
     3  ## Changelog
     4  
     5  * 27-11-2019: Initial draft from ADR-051
     6  * 13-01-2020: Separate ADR Tendermint Mode from ADR-051
     7  * 29-03-2021: Update info regarding defaults
     8  
     9  ## Context
    10  
    11  - Full mode: full mode does not have the capability to become a validator.
    12  - Validator mode : this mode is exactly same as existing state machine behavior. sync without voting on consensus, and participate consensus when fully synced
    13  - Seed mode : lightweight seed node maintaining an address book, p2p like [TenderSeed](https://gitlab.com/polychainlabs/tenderseed)
    14  
    15  ## Decision
    16  
    17  We would like to suggest a simple Tendermint mode abstraction. These modes will live under one binary, and when initializing a node the user will be able to specify which node they would like to create.
    18  
    19  - Which reactor, component to include for each node
    20      - full
    21          - switch, transport
    22          - reactors
    23            - mempool
    24            - consensus
    25            - evidence
    26            - blockchain
    27            - p2p/pex
    28            - statesync
    29          - rpc (safe connections only)
    30          - *~~no privValidator(priv_validator_key.json, priv_validator_state.json)~~*
    31      - validator
    32          - switch, transport
    33          - reactors
    34            - mempool
    35            - consensus
    36            - evidence
    37            - blockchain
    38            - p2p/pex
    39            - statesync
    40          - rpc (safe connections only)
    41          - with privValidator(priv_validator_key.json, priv_validator_state.json)
    42      - seed
    43          - switch, transport
    44          - reactor
    45             - p2p/pex
    46  - Configuration, cli command
    47      - We would like to suggest by introducing `mode` parameter in `config.toml` and cli
    48      - <span v-pre>`mode = "{{ .BaseConfig.Mode }}"`</span> in `config.toml`
    49      - `tendermint start --mode validator`  in cli
    50      - full | validator | seednode
    51      - There will be no default. Users will need to specify when they run `tendermint init`
    52  - RPC modification
    53      - `host:26657/status`
    54          - return empty `validator_info` when in full mode
    55      - no rpc server in seednode
    56  - Where to modify in codebase
    57      - Add  switch for `config.Mode` on `node/node.go:DefaultNewNode`
    58      - If `config.Mode==validator`, call default `NewNode` (current logic)
    59      - If `config.Mode==full`, call `NewNode` with `nil` `privValidator` (do not load or generation)
    60          - Need to add exception routine for `nil` `privValidator` to related functions
    61      - If `config.Mode==seed`, call `NewSeedNode` (seed node version of `node/node.go:NewNode`)
    62          - Need to add exception routine for `nil` `reactor`, `component` to related functions
    63  
    64  ## Status
    65  
    66  Implemented
    67  
    68  ## Consequences
    69  
    70  ### Positive
    71  
    72  - Node operators can choose mode when they run state machine according to the purpose of the node.
    73  - Mode can prevent mistakes because users have to specify which mode they want to run via flag. (eg. If a user want to run a validator node, she/he should explicitly write down validator as mode)
    74  - Different mode needs different reactors, resulting in efficient resource usage.
    75  
    76  ### Negative
    77  
    78  - Users need to study how each mode operate and which capability it has.
    79  
    80  ### Neutral
    81  
    82  ## References
    83  
    84  - Issue [#2237](https://github.com/tendermint/tendermint/issues/2237) : Tendermint "mode"
    85  - [TenderSeed](https://gitlab.com/polychainlabs/tenderseed) : A lightweight Tendermint Seed Node.