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.

148 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. 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 functionaluty, 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. ## v0.25.0
  59. This release has minimal impact.
  60. If you use GasWanted in ABCI and want to enforce it, set the MaxGas in the genesis file (default is no max).
  61. ## v0.24.0
  62. New 0.24.0 release contains a lot of changes to the state and types. It's not
  63. compatible to the old versions and there is no straight forward way to update
  64. old data to be compatible with the new version.
  65. To reset the state do:
  66. ```
  67. $ tendermint unsafe_reset_all
  68. ```
  69. Here we summarize some other notable changes to be mindful of.
  70. ### Config changes
  71. `p2p.max_num_peers` was removed in favor of `p2p.max_num_inbound_peers` and
  72. `p2p.max_num_outbound_peers`.
  73. ```
  74. # Maximum number of inbound peers
  75. max_num_inbound_peers = 40
  76. # Maximum number of outbound peers to connect to, excluding persistent peers
  77. max_num_outbound_peers = 10
  78. ```
  79. As you can see, the default ratio of inbound/outbound peers is 4/1. The reason
  80. is we want it to be easier for new nodes to connect to the network. You can
  81. tweak these parameters to alter the network topology.
  82. ### RPC Changes
  83. The result of `/commit` used to contain `header` and `commit` fields at the top level. These are now contained under the `signed_header` field.
  84. ### ABCI Changes
  85. The header has been upgraded and contains new fields, but none of the existing
  86. fields were changed, except their order.
  87. The `Validator` type was split into two, one containing an `Address` and one
  88. containing a `PubKey`. When processing `RequestBeginBlock`, use the `Validator`
  89. type, which contains just the `Address`. When returning `ResponseEndBlock`, use
  90. the `ValidatorUpdate` type, which contains just the `PubKey`.
  91. ### Validator Set Updates
  92. Validator set updates returned in ResponseEndBlock for height `H` used to take
  93. effect immediately at height `H+1`. Now they will be delayed one block, to take
  94. effect at height `H+2`. Note this means that the change will be seen by the ABCI
  95. app in the `RequestBeginBlock.LastCommitInfo` at block `H+3`. Apps were already
  96. required to maintain a map from validator addresses to pubkeys since v0.23 (when
  97. pubkeys were removed from RequestBeginBlock), but now they may need to track
  98. multiple validator sets at once to accomodate this delay.
  99. ### Block Size
  100. The `ConsensusParams.BlockSize.MaxTxs` was removed in favour of
  101. `ConsensusParams.BlockSize.MaxBytes`, which is now enforced. This means blocks
  102. are limitted only by byte-size, not by number of transactions.