mirror of
https://github.com/tendermint/tendermint.git
synced 2026-01-05 13:05:09 +00:00
* update theme * Update version * Updated Questions section in the footer * Remove links to Riot chat * Typo * Add Discord link Co-authored-by: Marko <marbar3778@yahoo.com>
3.1 KiB
3.1 KiB
ADR 052: Tendermint Mode
Changelog
- 27-11-2019: Initial draft from ADR-051
- 13-01-2020: Separate ADR Tendermint Mode from ADR-051
Context
- Fullnode mode: fullnode mode does not have the capability to become a validator.
- Validator mode : this mode is exactly same as existing state machine behavior. sync without voting on consensus, and participate consensus when fully synced
- Seed mode : lightweight seed mode maintaining an address book, p2p like TenderSeed
Decision
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.
- Which reactor, component to include for each node
- fullnode (default)
- switch, transport
- reactors
- mempool
- consensus
- evidence
- blockchain
- p2p/pex
- rpc (safe connections only)
no privValidator(priv_validator_key.json, priv_validator_state.json)
- validator
- switch, transport
- reactors
- mempool
- consensus
- evidence
- blockchain - p2p/pex
- rpc (safe connections only)
- with privValidator(priv_validator_key.json, priv_validator_state.json)
- seed
- switch, transport
- reactor
- p2p/pex
- fullnode (default)
- Configuration, cli command
- We would like to suggest by introducing
modeparameter inconfig.tomland cli mode = "{{ .BaseConfig.Mode }}"inconfig.tomltendermint node --mode validatorin cli- fullnode | validator | seed (default: "fullnode")
- We would like to suggest by introducing
- RPC modification
host:26657/status- return empty
validator_infowhen fullnode mode
- return empty
- no rpc server in seed mode
- Where to modify in codebase
- Add switch for
config.Modeonnode/node.go:DefaultNewNode - If
config.Mode==validator, call defaultNewNode(current logic) - If
config.Mode==fullnode, callNewNodewithnilprivValidator(do not load or generation)- Need to add exception routine for
nilprivValidatorto related functions
- Need to add exception routine for
- If
config.Mode==seed, callNewSeedNode(seed version ofnode/node.go:NewNode)- Need to add exception routine for
nilreactor,componentto related functions
- Need to add exception routine for
- Add switch for
Status
Proposed
Consequences
Positive
- Node operators can choose mode when they run state machine according to the purpose of the node.
- 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)
- Different mode needs different reactors, resulting in efficient resource usage.
Negative
- Users need to study how each mode operate and which capability it has.
Neutral
References
- Issue #2237 : Tendermint "mode"
- TenderSeed : A lightweight Tendermint Seed Node.