You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

85 lines
3.2 KiB

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