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.

152 lines
5.3 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.26.0
  5. New 0.26.0 release contains a lot of changes to core data types and protocols. It is not
  6. compatible to the old versions and there is no straight forward way to update
  7. old data to be compatible with the new version.
  8. To reset the state do:
  9. ```
  10. $ tendermint unsafe_reset_all
  11. ```
  12. Here we summarize some other notable changes to be mindful of.
  13. ### Config Changes
  14. All timeouts must be changed from integers to strings with their duration, for
  15. instance `flush_throttle_timeout = 100` would be changed to
  16. `flush_throttle_timeout = "100ms"` and `timeout_propose = 3000` would be changed
  17. to `timeout_propose = "3s"`.
  18. ### RPC Changes
  19. The default behaviour of `/abci_query` has been changed to not return a proof,
  20. and the name of the parameter that controls this has been changed from `trusted`
  21. to `prove`. To get proofs with your queries, ensure you set `prove=true`.
  22. Various version fields like `amino_version`, `p2p_version`, `consensus_version`,
  23. and `rpc_version` have been removed from the `node_info.other` and are
  24. consolidated under the tendermint semantic version (ie. `node_info.version`) and
  25. the new `block` and `p2p` protocol versions under `node_info.protocol_version`.
  26. ### ABCI Changes
  27. Field numbers were bumped in the `Header` and `ResponseInfo` messages to make
  28. room for new `version` fields. It should be straight forward to recompile the
  29. protobuf file for these changes.
  30. #### Proofs
  31. The `ResponseQuery.Proof` field is now structured as a `[]ProofOp` to support
  32. generalized Merkle tree constructions where the leaves of one Merkle tree are
  33. the root of another. If you don't need this functionality, and you used to
  34. return `<proof bytes>` here, you should instead return a single `ProofOp` with
  35. just the `Data` field set:
  36. ```
  37. []ProofOp{
  38. ProofOp{
  39. Data: <proof bytes>,
  40. }
  41. }
  42. ```
  43. For more information, see:
  44. - [ADR-026](https://github.com/tendermint/tendermint/blob/30519e8361c19f4bf320ef4d26288ebc621ad725/docs/architecture/adr-026-general-merkle-proof.md)
  45. - [Relevant ABCI
  46. documentation](https://github.com/tendermint/tendermint/blob/30519e8361c19f4bf320ef4d26288ebc621ad725/docs/spec/abci/apps.md#query-proofs)
  47. - [Description of
  48. keys](https://github.com/tendermint/tendermint/blob/30519e8361c19f4bf320ef4d26288ebc621ad725/crypto/merkle/proof_key_path.go#L14)
  49. ### Go API Changes
  50. #### crypto.merkle
  51. The `merkle.Hasher` interface was removed. Functions which used to take `Hasher`
  52. now simply take `[]byte`. This means that any objects being Merklized should be
  53. serialized before they are passed in.
  54. #### node
  55. The `node.RunForever` function was removed. Signal handling and running forever
  56. should instead be explicitly configured by the caller. See how we do it
  57. [here](https://github.com/tendermint/tendermint/blob/30519e8361c19f4bf320ef4d26288ebc621ad725/cmd/tendermint/commands/run_node.go#L60).
  58. ### Other
  59. All hashes, except for public key addresses, are now 32-bytes.
  60. ## v0.25.0
  61. This release has minimal impact.
  62. If you use GasWanted in ABCI and want to enforce it, set the MaxGas in the genesis file (default is no max).
  63. ## v0.24.0
  64. New 0.24.0 release contains a lot of changes to the state and types. It's not
  65. compatible to the old versions and there is no straight forward way to update
  66. old data to be compatible with the new version.
  67. To reset the state do:
  68. ```
  69. $ tendermint unsafe_reset_all
  70. ```
  71. Here we summarize some other notable changes to be mindful of.
  72. ### Config changes
  73. `p2p.max_num_peers` was removed in favor of `p2p.max_num_inbound_peers` and
  74. `p2p.max_num_outbound_peers`.
  75. ```
  76. # Maximum number of inbound peers
  77. max_num_inbound_peers = 40
  78. # Maximum number of outbound peers to connect to, excluding persistent peers
  79. max_num_outbound_peers = 10
  80. ```
  81. As you can see, the default ratio of inbound/outbound peers is 4/1. The reason
  82. is we want it to be easier for new nodes to connect to the network. You can
  83. tweak these parameters to alter the network topology.
  84. ### RPC Changes
  85. The result of `/commit` used to contain `header` and `commit` fields at the top level. These are now contained under the `signed_header` field.
  86. ### ABCI Changes
  87. The header has been upgraded and contains new fields, but none of the existing
  88. fields were changed, except their order.
  89. The `Validator` type was split into two, one containing an `Address` and one
  90. containing a `PubKey`. When processing `RequestBeginBlock`, use the `Validator`
  91. type, which contains just the `Address`. When returning `ResponseEndBlock`, use
  92. the `ValidatorUpdate` type, which contains just the `PubKey`.
  93. ### Validator Set Updates
  94. Validator set updates returned in ResponseEndBlock for height `H` used to take
  95. effect immediately at height `H+1`. Now they will be delayed one block, to take
  96. effect at height `H+2`. Note this means that the change will be seen by the ABCI
  97. app in the `RequestBeginBlock.LastCommitInfo` at block `H+3`. Apps were already
  98. required to maintain a map from validator addresses to pubkeys since v0.23 (when
  99. pubkeys were removed from RequestBeginBlock), but now they may need to track
  100. multiple validator sets at once to accomodate this delay.
  101. ### Block Size
  102. The `ConsensusParams.BlockSize.MaxTxs` was removed in favour of
  103. `ConsensusParams.BlockSize.MaxBytes`, which is now enforced. This means blocks
  104. are limitted only by byte-size, not by number of transactions.