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.

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