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.

264 lines
10 KiB

  1. # Upgrading Tendermint Core
  2. This guide provides steps to be followed when you upgrade your applications to
  3. a newer version of Tendermint Core.
  4. ## v0.29.0
  5. This release contains some breaking changes to the block and p2p protocols,
  6. and will not be compatible with any previous versions of the software, primarily
  7. due to changes in how various data structures are hashed.
  8. Any implementations of Tendermint blockchain verification, including lite clients,
  9. will need to be updated. For specific details:
  10. - [Merkle tree](./docs/spec/blockchain/encoding.md#merkle-trees)
  11. - [ConsensusParams](./docs/spec/blockchain/state.md#consensusparams)
  12. There was also a small change to field ordering in the vote struct. Any
  13. implementations of an out-of-process validator (like a Key-Management Server)
  14. will need to be updated. For specific details:
  15. - [Vote](https://github.com/tendermint/tendermint/blob/develop/docs/spec/consensus/signing.md#votes)
  16. Finally, the proposer selection algorithm continues to evolve. See the
  17. [work-in-progress
  18. specification](https://github.com/tendermint/tendermint/pull/3140).
  19. For everything else, please see the [CHANGELOG](./CHANGELOG.md#v0.29.0).
  20. ## v0.28.0
  21. This release breaks the format for the `priv_validator.json` file
  22. and the protocol used for the external validator process.
  23. It is compatible with v0.27.0 blockchains (neither the BlockProtocol nor the
  24. P2PProtocol have changed).
  25. Please read carefully for details about upgrading.
  26. **Note:** Backup your `config/priv_validator.json`
  27. before proceeding.
  28. ### `priv_validator.json`
  29. The `config/priv_validator.json` is now two files:
  30. `config/priv_validator_key.json` and `data/priv_validator_state.json`.
  31. The former contains the key material, the later contains the details on the last
  32. message signed.
  33. When running v0.28.0 for the first time, it will back up any pre-existing
  34. `priv_validator.json` file and proceed to split it into the two new files.
  35. Upgrading should happen automatically without problem.
  36. To upgrade manually, use the provided `privValUpgrade.go` script, with exact paths for the old
  37. `priv_validator.json` and the locations for the two new files. It's recomended
  38. to use the default paths, of `config/priv_validator_key.json` and
  39. `data/priv_validator_state.json`, respectively:
  40. ```
  41. go run scripts/privValUpgrade.go <old-path> <new-key-path> <new-state-path>
  42. ```
  43. ### External validator signers
  44. The Unix and TCP implementations of the remote signing validator
  45. have been consolidated into a single implementation.
  46. Thus in both cases, the external process is expected to dial
  47. Tendermint. This is different from how Unix sockets used to work, where
  48. Tendermint dialed the external process.
  49. The `PubKeyMsg` was also split into separate `Request` and `Response` types
  50. for consistency with other messages.
  51. Note that the TCP sockets don't yet use a persistent key,
  52. so while they're encrypted, they can't yet be properly authenticated.
  53. See [#3105](https://github.com/tendermint/tendermint/issues/3105).
  54. Note the Unix socket has neither encryption nor authentication, but will
  55. add a shared-secret in [#3099](https://github.com/tendermint/tendermint/issues/3099).
  56. ## v0.27.0
  57. This release contains some breaking changes to the block and p2p protocols,
  58. but does not change any core data structures, so it should be compatible with
  59. existing blockchains from the v0.26 series that only used Ed25519 validator keys.
  60. Blockchains using Secp256k1 for validators will not be compatible. This is due
  61. to the fact that we now enforce which key types validators can use as a
  62. consensus param. The default is Ed25519, and Secp256k1 must be activated
  63. explicitly.
  64. It is recommended to upgrade all nodes at once to avoid incompatibilities at the
  65. peer layer - namely, the heartbeat consensus message has been removed (only
  66. relevant if `create_empty_blocks=false` or `create_empty_blocks_interval > 0`),
  67. and the proposer selection algorithm has changed. Since proposer information is
  68. never included in the blockchain, this change only affects the peer layer.
  69. ### Go API Changes
  70. #### libs/db
  71. The ReverseIterator API has changed the meaning of `start` and `end`.
  72. Before, iteration was from `start` to `end`, where
  73. `start > end`. Now, iteration is from `end` to `start`, where `start < end`.
  74. The iterator also excludes `end`. This change allows a simplified and more
  75. intuitive logic, aligning the semantic meaning of `start` and `end` in the
  76. `Iterator` and `ReverseIterator`.
  77. ### Applications
  78. This release enforces a new consensus parameter, the
  79. ValidatorParams.PubKeyTypes. Applications must ensure that they only return
  80. validator updates with the allowed PubKeyTypes. If a validator update includes a
  81. pubkey type that is not included in the ConsensusParams.Validator.PubKeyTypes,
  82. block execution will fail and the consensus will halt.
  83. By default, only Ed25519 pubkeys may be used for validators. Enabling
  84. Secp256k1 requires explicit modification of the ConsensusParams.
  85. Please update your application accordingly (ie. restrict validators to only be
  86. able to use Ed25519 keys, or explicitly add additional key types to the genesis
  87. file).
  88. ## v0.26.0
  89. This release contains a lot of changes to core data types and protocols. It is not
  90. compatible to the old versions and there is no straight forward way to update
  91. old data to be compatible with the new version.
  92. To reset the state do:
  93. ```
  94. $ tendermint unsafe_reset_all
  95. ```
  96. Here we summarize some other notable changes to be mindful of.
  97. ### Config Changes
  98. All timeouts must be changed from integers to strings with their duration, for
  99. instance `flush_throttle_timeout = 100` would be changed to
  100. `flush_throttle_timeout = "100ms"` and `timeout_propose = 3000` would be changed
  101. to `timeout_propose = "3s"`.
  102. ### RPC Changes
  103. The default behaviour of `/abci_query` has been changed to not return a proof,
  104. and the name of the parameter that controls this has been changed from `trusted`
  105. to `prove`. To get proofs with your queries, ensure you set `prove=true`.
  106. Various version fields like `amino_version`, `p2p_version`, `consensus_version`,
  107. and `rpc_version` have been removed from the `node_info.other` and are
  108. consolidated under the tendermint semantic version (ie. `node_info.version`) and
  109. the new `block` and `p2p` protocol versions under `node_info.protocol_version`.
  110. ### ABCI Changes
  111. Field numbers were bumped in the `Header` and `ResponseInfo` messages to make
  112. room for new `version` fields. It should be straight forward to recompile the
  113. protobuf file for these changes.
  114. #### Proofs
  115. The `ResponseQuery.Proof` field is now structured as a `[]ProofOp` to support
  116. generalized Merkle tree constructions where the leaves of one Merkle tree are
  117. the root of another. If you don't need this functionality, and you used to
  118. return `<proof bytes>` here, you should instead return a single `ProofOp` with
  119. just the `Data` field set:
  120. ```
  121. []ProofOp{
  122. ProofOp{
  123. Data: <proof bytes>,
  124. }
  125. }
  126. ```
  127. For more information, see:
  128. - [ADR-026](https://github.com/tendermint/tendermint/blob/30519e8361c19f4bf320ef4d26288ebc621ad725/docs/architecture/adr-026-general-merkle-proof.md)
  129. - [Relevant ABCI
  130. documentation](https://github.com/tendermint/tendermint/blob/30519e8361c19f4bf320ef4d26288ebc621ad725/docs/spec/abci/apps.md#query-proofs)
  131. - [Description of
  132. keys](https://github.com/tendermint/tendermint/blob/30519e8361c19f4bf320ef4d26288ebc621ad725/crypto/merkle/proof_key_path.go#L14)
  133. ### Go API Changes
  134. #### crypto/merkle
  135. The `merkle.Hasher` interface was removed. Functions which used to take `Hasher`
  136. now simply take `[]byte`. This means that any objects being Merklized should be
  137. serialized before they are passed in.
  138. #### node
  139. The `node.RunForever` function was removed. Signal handling and running forever
  140. should instead be explicitly configured by the caller. See how we do it
  141. [here](https://github.com/tendermint/tendermint/blob/30519e8361c19f4bf320ef4d26288ebc621ad725/cmd/tendermint/commands/run_node.go#L60).
  142. ### Other
  143. All hashes, except for public key addresses, are now 32-bytes.
  144. ## v0.25.0
  145. This release has minimal impact.
  146. If you use GasWanted in ABCI and want to enforce it, set the MaxGas in the genesis file (default is no max).
  147. ## v0.24.0
  148. New 0.24.0 release contains a lot of changes to the state and types. It's not
  149. compatible to the old versions and there is no straight forward way to update
  150. old data to be compatible with the new version.
  151. To reset the state do:
  152. ```
  153. $ tendermint unsafe_reset_all
  154. ```
  155. Here we summarize some other notable changes to be mindful of.
  156. ### Config changes
  157. `p2p.max_num_peers` was removed in favor of `p2p.max_num_inbound_peers` and
  158. `p2p.max_num_outbound_peers`.
  159. ```
  160. # Maximum number of inbound peers
  161. max_num_inbound_peers = 40
  162. # Maximum number of outbound peers to connect to, excluding persistent peers
  163. max_num_outbound_peers = 10
  164. ```
  165. As you can see, the default ratio of inbound/outbound peers is 4/1. The reason
  166. is we want it to be easier for new nodes to connect to the network. You can
  167. tweak these parameters to alter the network topology.
  168. ### RPC Changes
  169. The result of `/commit` used to contain `header` and `commit` fields at the top level. These are now contained under the `signed_header` field.
  170. ### ABCI Changes
  171. The header has been upgraded and contains new fields, but none of the existing
  172. fields were changed, except their order.
  173. The `Validator` type was split into two, one containing an `Address` and one
  174. containing a `PubKey`. When processing `RequestBeginBlock`, use the `Validator`
  175. type, which contains just the `Address`. When returning `ResponseEndBlock`, use
  176. the `ValidatorUpdate` type, which contains just the `PubKey`.
  177. ### Validator Set Updates
  178. Validator set updates returned in ResponseEndBlock for height `H` used to take
  179. effect immediately at height `H+1`. Now they will be delayed one block, to take
  180. effect at height `H+2`. Note this means that the change will be seen by the ABCI
  181. app in the `RequestBeginBlock.LastCommitInfo` at block `H+3`. Apps were already
  182. required to maintain a map from validator addresses to pubkeys since v0.23 (when
  183. pubkeys were removed from RequestBeginBlock), but now they may need to track
  184. multiple validator sets at once to accomodate this delay.
  185. ### Block Size
  186. The `ConsensusParams.BlockSize.MaxTxs` was removed in favour of
  187. `ConsensusParams.BlockSize.MaxBytes`, which is now enforced. This means blocks
  188. are limitted only by byte-size, not by number of transactions.