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.

818 lines
32 KiB

  1. # Upgrading Tendermint Core
  2. This guide provides instructions for upgrading to specific versions of Tendermint Core.
  3. ## Unreleased
  4. ### ABCI Changes
  5. * Added `AbciVersion` to `RequestInfo`. Applications should check that the ABCI version they expect is being used in order to avoid unimplemented changes errors.
  6. * The method `SetOption` has been removed from the ABCI.Client interface. This feature was used in the early ABCI implementation's.
  7. * Messages are written to a byte stream using uin64 length delimiters instead of int64.
  8. * When mempool `v1` is enabled, transactions broadcasted via `sync` mode may return a successful
  9. response with a transaction hash indicating that the transaction was successfully inserted into
  10. the mempool. While this is true for `v0`, the `v1` mempool reactor may at a later point in time
  11. evict or even drop this transaction after a hash has been returned. Thus, the user or client must
  12. query for that transaction to check if it is still in the mempool.
  13. ### Config Changes
  14. * `fast_sync = "v1"` is no longer supported. Please use `v2` instead.
  15. * All config parameters are now hyphen-case (also known as kebab-case) instead of snake_case. Before restarting the node make sure
  16. you have updated all the variables in your `config.toml` file.
  17. * Added `--mode` flag and `mode` config variable on `config.toml` for setting Mode of the Node: `full` | `validator` | `seed` (default: `full`)
  18. [ADR-52](https://github.com/tendermint/tendermint/blob/master/docs/architecture/adr-052-tendermint-mode.md)
  19. * `BootstrapPeers` has been added as part of the new p2p stack. This will eventually replace
  20. `Seeds`. Bootstrap peers are connected with on startup if needed for peer discovery. Unlike
  21. persistent peers, there's no gaurantee that the node will remain connected with these peers.
  22. - configuration values starting with `priv-validator-` have moved to the new
  23. `priv-validator` section, without the `priv-validator-` prefix.
  24. ### CLI Changes
  25. * You must now specify the node mode (validator|full|seed) in `tendermint init [mode]`
  26. * If you had previously used `tendermint gen_node_key` to generate a new node
  27. key, keep in mind that it no longer saves the output to a file. You can use
  28. `tendermint init validator` or pipe the output of `tendermint gen_node_key` to
  29. `$TMHOME/config/node_key.json`:
  30. ```
  31. $ tendermint gen_node_key > $TMHOME/config/node_key.json
  32. ```
  33. * CLI commands and flags are all now hyphen-case instead of snake_case.
  34. Make sure to adjust any scripts that calls a cli command with snake_casing
  35. ### API Changes
  36. The p2p layer was reimplemented as part of the 0.35 release cycle, and
  37. all reactors were refactored. As part of that work these
  38. implementations moved into the `internal` package and are no longer
  39. considered part of the public Go API of tendermint. These packages
  40. are:
  41. - `p2p`
  42. - `mempool`
  43. - `consensus`
  44. - `statesync`
  45. - `blockchain`
  46. - `evidence`
  47. Accordingly, the space `node` package was changed to reduce access to
  48. tendermint internals: applications that use tendermint as a library
  49. will need to change to accommodate these changes. Most notably:
  50. - The `Node` type has become internal, and all constructors return a
  51. `service.Service` implementation.
  52. - The `node.DefaultNewNode` and `node.NewNode` constructors are no
  53. longer exported and have been replaced with `node.New` and
  54. `node.NewDefault` which provide more functional interfaces.
  55. ## v0.34.0
  56. **Upgrading to Tendermint 0.34 requires a blockchain restart.**
  57. This release is not compatible with previous blockchains due to changes to
  58. the encoding format (see "Protocol Buffers," below) and the block header (see "Blockchain Protocol").
  59. Note also that Tendermint 0.34 also requires Go 1.16 or higher.
  60. ### ABCI Changes
  61. * The `ABCIVersion` is now `0.17.0`.
  62. * New ABCI methods (`ListSnapshots`, `LoadSnapshotChunk`, `OfferSnapshot`, and `ApplySnapshotChunk`)
  63. were added to support the new State Sync feature.
  64. Previously, syncing a new node to a preexisting network could take days; but with State Sync,
  65. new nodes are able to join a network in a matter of seconds.
  66. Read [the spec](https://docs.tendermint.com/master/spec/abci/apps.html#state-sync)
  67. if you want to learn more about State Sync, or if you'd like your application to use it.
  68. (If you don't want to support State Sync in your application, you can just implement these new
  69. ABCI methods as no-ops, leaving them empty.)
  70. * `KV.Pair` has been replaced with `abci.EventAttribute`. The `EventAttribute.Index` field
  71. allows ABCI applications to dictate which events should be indexed.
  72. * The blockchain can now start from an arbitrary initial height,
  73. provided to the application via `RequestInitChain.InitialHeight`.
  74. * ABCI evidence type is now an enum with two recognized types of evidence:
  75. `DUPLICATE_VOTE` and `LIGHT_CLIENT_ATTACK`.
  76. Applications should be able to handle these evidence types
  77. (i.e., through slashing or other accountability measures).
  78. * The [`PublicKey` type](https://github.com/tendermint/tendermint/blob/master/proto/tendermint/crypto/keys.proto#L13-L15)
  79. (used in ABCI as part of `ValidatorUpdate`) now uses a `oneof` protobuf type.
  80. Note that since Tendermint only supports ed25519 validator keys, there's only one
  81. option in the `oneof`. For more, see "Protocol Buffers," below.
  82. * The field `Proof`, on the ABCI type `ResponseQuery`, is now named `ProofOps`.
  83. For more, see "Crypto," below.
  84. * The method `SetOption` has been removed from the ABCI.Client interface. This feature was used in the early ABCI implementation's.
  85. ### P2P Protocol
  86. The default codec is now proto3, not amino. The schema files can be found in the `/proto`
  87. directory. For more, see "Protobuf," below.
  88. ### Blockchain Protocol
  89. * `Header#LastResultsHash`, which is the root hash of a Merkle tree built from
  90. `ResponseDeliverTx(Code, Data)` as of v0.34 also includes `GasWanted` and `GasUsed`
  91. fields.
  92. * Merkle hashes of empty trees previously returned nothing, but now return the hash of an empty input,
  93. to conform with [RFC-6962](https://tools.ietf.org/html/rfc6962).
  94. This mainly affects `Header#DataHash`, `Header#LastResultsHash`, and
  95. `Header#EvidenceHash`, which are often empty. Non-empty hashes can also be affected, e.g. if their
  96. inputs depend on other (empty) Merkle hashes, giving different results.
  97. ### Transaction Indexing
  98. Tendermint now relies on the application to tell it which transactions to index. This means that
  99. in the `config.toml`, generated by Tendermint, there is no longer a way to specify which
  100. transactions to index. `tx.height` and `tx.hash` will always be indexed when using the `kv` indexer.
  101. Applications must now choose to either a) enable indexing for all transactions, or
  102. b) allow node operators to decide which transactions to index.
  103. Applications can notify Tendermint to index a specific transaction by setting
  104. `Index: bool` to `true` in the Event Attribute:
  105. ```go
  106. []types.Event{
  107. {
  108. Type: "app",
  109. Attributes: []types.EventAttribute{
  110. {Key: []byte("creator"), Value: []byte("Cosmoshi Netowoko"), Index: true},
  111. },
  112. },
  113. }
  114. ```
  115. ### Protocol Buffers
  116. Tendermint 0.34 replaces Amino with Protocol Buffers for encoding.
  117. This migration is extensive and results in a number of changes, however,
  118. Tendermint only uses the types generated from Protocol Buffers for disk and
  119. wire serialization.
  120. **This means that these changes should not affect you as a Tendermint user.**
  121. However, Tendermint users and contributors may note the following changes:
  122. * Directory layout changes: All proto files have been moved under one directory, `/proto`.
  123. This is in line with the recommended file layout by [Buf](https://buf.build).
  124. For more, see the [Buf documentation](https://buf.build/docs/lint-checkers#file_layout).
  125. * ABCI Changes: As noted in the "ABCI Changes" section above, the `PublicKey` type now uses
  126. a `oneof` type.
  127. For more on the Protobuf changes, please see our [blog post on this migration](https://medium.com/tendermint/tendermint-0-34-protocol-buffers-and-you-8c40558939ae).
  128. ### Consensus Parameters
  129. Tendermint 0.34 includes new and updated consensus parameters.
  130. #### Version Parameters (New)
  131. * `AppVersion`, which is the version of the ABCI application.
  132. #### Evidence Parameters
  133. * `MaxBytes`, which caps the total amount of evidence. The default is 1048576 (1 MB).
  134. ### Crypto
  135. #### Keys
  136. * Keys no longer include a type prefix. For example, ed25519 pubkeys have been renamed from
  137. `PubKeyEd25519` to `PubKey`. This reduces stutter (e.g., `ed25519.PubKey`).
  138. * Keys are now byte slices (`[]byte`) instead of byte arrays (`[<size>]byte`).
  139. * The multisig functionality that was previously in Tendermint now has
  140. a new home within the Cosmos SDK:
  141. [`cosmos/cosmos-sdk/types/multisig`](https://github.com/cosmos/cosmos-sdk/blob/master/crypto/types/multisig/multisignature.go).
  142. #### `merkle` Package
  143. * `SimpleHashFromMap()` and `SimpleProofsFromMap()` were removed.
  144. * The prefix `Simple` has been removed. (For example, `SimpleProof` is now called `Proof`.)
  145. * All protobuf messages have been moved to the `/proto` directory.
  146. * The protobuf message `Proof` that contained multiple ProofOp's has been renamed to `ProofOps`.
  147. As noted above, this affects the ABCI type `ResponseQuery`:
  148. The field that was named Proof is now named `ProofOps`.
  149. * `HashFromByteSlices` and `ProofsFromByteSlices` now return a hash for empty inputs, to conform with
  150. [RFC-6962](https://tools.ietf.org/html/rfc6962).
  151. ### `libs` Package
  152. The `bech32` package has moved to the Cosmos SDK:
  153. [`cosmos/cosmos-sdk/types/bech32`](https://github.com/cosmos/cosmos-sdk/tree/4173ea5ebad906dd9b45325bed69b9c655504867/types/bech32).
  154. ### CLI
  155. The `tendermint lite` command has been renamed to `tendermint light` and has a slightly different API.
  156. See [the docs](https://docs.tendermint.com/master/tendermint-core/light-client-protocol.html#http-proxy) for details.
  157. ### Light Client
  158. We have a new, rewritten light client! You can
  159. [read more](https://medium.com/tendermint/everything-you-need-to-know-about-the-tendermint-light-client-f80d03856f98)
  160. about the justifications and details behind this change.
  161. Other user-relevant changes include:
  162. * The old `lite` package was removed; the new light client uses the `light` package.
  163. * The `Verifier` was broken up into two pieces:
  164. * Core verification logic (pure `VerifyX` functions)
  165. * `Client` object, which represents the complete light client
  166. * The new light clients stores headers & validator sets as `LightBlock`s
  167. * The RPC client can be found in the `/rpc` directory.
  168. * The HTTP(S) proxy is located in the `/proxy` directory.
  169. ### `state` Package
  170. * A new field `State.InitialHeight` has been added to record the initial chain height, which must be `1`
  171. (not `0`) if starting from height `1`. This can be configured via the genesis field `initial_height`.
  172. * The `state` package now has a `Store` interface. All functions in
  173. [state/store.go](https://github.com/tendermint/tendermint/blob/56911ee35298191c95ef1c7d3d5ec508237aaff4/state/store.go#L42-L42)
  174. are now part of the interface. The interface returns errors on all methods and can be used by calling `state.NewStore(dbm.DB)`.
  175. ### `privval` Package
  176. All requests are now accompanied by the chain ID from the network.
  177. This is a optional field and can be ignored by key management systems;
  178. however, if you are using the same key management system for multiple different
  179. blockchains, we recommend that you check the chain ID.
  180. ### RPC
  181. * `/unsafe_start_cpu_profiler`, `/unsafe_stop_cpu_profiler` and
  182. `/unsafe_write_heap_profile` were removed.
  183. For profiling, please use the pprof server, which can
  184. be enabled through `--rpc.pprof_laddr=X` flag or `pprof_laddr=X` config setting
  185. in the rpc section.
  186. * The `Content-Type` header returned on RPC calls is now (correctly) set as `application/json`.
  187. ### Version
  188. Version is now set through Go linker flags `ld_flags`. Applications that are using tendermint as a library should set this at compile time.
  189. Example:
  190. ```sh
  191. go install -mod=readonly -ldflags "-X github.com/tendermint/tendermint/version.TMCoreSemVer=$(go list -m github.com/tendermint/tendermint | sed 's/ /\@/g') -s -w " -trimpath ./cmd
  192. ```
  193. Additionally, the exported constant `version.Version` is now `version.TMCoreSemVer`.
  194. ## v0.33.4
  195. ### Go API
  196. * `rpc/client` HTTP and local clients have been moved into `http` and `local`
  197. subpackages, and their constructors have been renamed to `New()`.
  198. ### Protobuf Changes
  199. When upgrading to version 0.33.4 you will have to fetch the `third_party`
  200. directory along with the updated proto files.
  201. ### Block Retention
  202. ResponseCommit added a field for block retention. The application can provide information to Tendermint on how to prune blocks.
  203. If an application would like to not prune any blocks pass a `0` in this field.
  204. ```proto
  205. message ResponseCommit {
  206. // reserve 1
  207. bytes data = 2; // the Merkle root hash
  208. ++ uint64 retain_height = 3; // the oldest block height to retain ++
  209. }
  210. ```
  211. ## v0.33.0
  212. This release is not compatible with previous blockchains due to commit becoming
  213. signatures only and fields in the header have been removed.
  214. ### Blockchain Protocol
  215. `TotalTxs` and `NumTxs` were removed from the header. `Commit` now consists
  216. mostly of just signatures.
  217. ```go
  218. type Commit struct {
  219. Height int64
  220. Round int
  221. BlockID BlockID
  222. Signatures []CommitSig
  223. }
  224. ```
  225. ```go
  226. type BlockIDFlag byte
  227. const (
  228. // BlockIDFlagAbsent - no vote was received from a validator.
  229. BlockIDFlagAbsent BlockIDFlag = 0x01
  230. // BlockIDFlagCommit - voted for the Commit.BlockID.
  231. BlockIDFlagCommit = 0x02
  232. // BlockIDFlagNil - voted for nil.
  233. BlockIDFlagNil = 0x03
  234. )
  235. type CommitSig struct {
  236. BlockIDFlag BlockIDFlag
  237. ValidatorAddress Address
  238. Timestamp time.Time
  239. Signature []byte
  240. }
  241. ```
  242. See [\#63](https://github.com/tendermint/spec/pull/63) for the complete spec
  243. change.
  244. ### P2P Protocol
  245. The secret connection now includes a transcript hashing. If you want to
  246. implement a handshake (or otherwise have an existing implementation), you'll
  247. need to make the same changes that were made
  248. [here](https://github.com/tendermint/tendermint/pull/3668).
  249. ### Config Changes
  250. You will need to generate a new config if you have used a prior version of tendermint.
  251. Tags have been entirely renamed throughout the codebase to events and there
  252. keys are called
  253. [compositeKeys](https://github.com/tendermint/tendermint/blob/6d05c531f7efef6f0619155cf10ae8557dd7832f/docs/app-dev/indexing-transactions.md).
  254. Evidence Params has been changed to include duration.
  255. * `consensus_params.evidence.max_age_duration`.
  256. * Renamed `consensus_params.evidence.max_age` to `max_age_num_blocks`.
  257. ### Go API
  258. * `libs/common` has been removed in favor of specific pkgs.
  259. * `async`
  260. * `service`
  261. * `rand`
  262. * `net`
  263. * `strings`
  264. * `cmap`
  265. * removal of `errors` pkg
  266. ### RPC Changes
  267. * `/validators` is now paginated (default: 30 vals per page)
  268. * `/block_results` response format updated [see RPC docs for details](https://docs.tendermint.com/master/rpc/#/Info/block_results)
  269. * Event suffix has been removed from the ID in event responses
  270. * IDs are now integers not `json-client-XYZ`
  271. ## v0.32.0
  272. This release is compatible with previous blockchains,
  273. however the new ABCI Events mechanism may create some complexity
  274. for nodes wishing to continue operation with v0.32 from a previous version.
  275. There are some minor breaking changes to the RPC.
  276. ### Config Changes
  277. If you have `db_backend` set to `leveldb` in your config file, please change it
  278. to `goleveldb` or `cleveldb`.
  279. ### RPC Changes
  280. The default listen address for the RPC is now `127.0.0.1`. If you want to expose
  281. it publicly, you have to explicitly configure it. Note exposing the RPC to the
  282. public internet may not be safe - endpoints which return a lot of data may
  283. enable resource exhaustion attacks on your node, causing the process to crash.
  284. Any consumers of `/block_results` need to be mindful of the change in all field
  285. names from CamelCase to Snake case, eg. `results.DeliverTx` is now `results.deliver_tx`.
  286. This is a fix, but it's breaking.
  287. ### ABCI Changes
  288. ABCI responses which previously had a `Tags` field now have an `Events` field
  289. instead. The original `Tags` field was simply a list of key-value pairs, where
  290. each key effectively represented some attribute of an event occuring in the
  291. blockchain, like `sender`, `receiver`, or `amount`. However, it was difficult to
  292. represent the occurence of multiple events (for instance, multiple transfers) in a single list.
  293. The new `Events` field contains a list of `Event`, where each `Event` is itself a list
  294. of key-value pairs, allowing for more natural expression of multiple events in
  295. eg. a single DeliverTx or EndBlock. Note each `Event` also includes a `Type`, which is meant to categorize the
  296. event.
  297. For transaction indexing, the index key is
  298. prefixed with the event type: `{eventType}.{attributeKey}`.
  299. If the same event type and attribute key appear multiple times, the values are
  300. appended in a list.
  301. To make queries, include the event type as a prefix. For instance if you
  302. previously queried for `recipient = 'XYZ'`, and after the upgrade you name your event `transfer`,
  303. the new query would be for `transfer.recipient = 'XYZ'`.
  304. Note that transactions indexed on a node before upgrading to v0.32 will still be indexed
  305. using the old scheme. For instance, if a node upgraded at height 100,
  306. transactions before 100 would be queried with `recipient = 'XYZ'` and
  307. transactions after 100 would be queried with `transfer.recipient = 'XYZ'`.
  308. While this presents additional complexity to clients, it avoids the need to
  309. reindex. Of course, you can reset the node and sync from scratch to re-index
  310. entirely using the new scheme.
  311. We illustrate further with a more complete example.
  312. Prior to the update, suppose your `ResponseDeliverTx` look like:
  313. ```go
  314. abci.ResponseDeliverTx{
  315. Tags: []kv.Pair{
  316. {Key: []byte("sender"), Value: []byte("foo")},
  317. {Key: []byte("recipient"), Value: []byte("bar")},
  318. {Key: []byte("amount"), Value: []byte("35")},
  319. }
  320. }
  321. ```
  322. The following queries would match this transaction:
  323. ```go
  324. query.MustParse("tm.event = 'Tx' AND sender = 'foo'")
  325. query.MustParse("tm.event = 'Tx' AND recipient = 'bar'")
  326. query.MustParse("tm.event = 'Tx' AND sender = 'foo' AND recipient = 'bar'")
  327. ```
  328. Following the upgrade, your `ResponseDeliverTx` would look something like:
  329. the following `Events`:
  330. ```go
  331. abci.ResponseDeliverTx{
  332. Events: []abci.Event{
  333. {
  334. Type: "transfer",
  335. Attributes: kv.Pairs{
  336. {Key: []byte("sender"), Value: []byte("foo")},
  337. {Key: []byte("recipient"), Value: []byte("bar")},
  338. {Key: []byte("amount"), Value: []byte("35")},
  339. },
  340. }
  341. }
  342. ```
  343. Now the following queries would match this transaction:
  344. ```go
  345. query.MustParse("tm.event = 'Tx' AND transfer.sender = 'foo'")
  346. query.MustParse("tm.event = 'Tx' AND transfer.recipient = 'bar'")
  347. query.MustParse("tm.event = 'Tx' AND transfer.sender = 'foo' AND transfer.recipient = 'bar'")
  348. ```
  349. For further documentation on `Events`, see the [docs](https://github.com/tendermint/tendermint/blob/60827f75623b92eff132dc0eff5b49d2025c591e/docs/spec/abci/abci.md#events).
  350. ### Go Applications
  351. The ABCI Application interface changed slightly so the CheckTx and DeliverTx
  352. methods now take Request structs. The contents of these structs are just the raw
  353. tx bytes, which were previously passed in as the argument.
  354. ## v0.31.6
  355. There are no breaking changes in this release except Go API of p2p and
  356. mempool packages. Hovewer, if you're using cleveldb, you'll need to change
  357. the compilation tag:
  358. Use `cleveldb` tag instead of `gcc` to compile Tendermint with CLevelDB or
  359. use `make build_c` / `make install_c` (full instructions can be found at
  360. <https://tendermint.com/docs/introduction/install.html#compile-with-cleveldb-support>)
  361. ## v0.31.0
  362. This release contains a breaking change to the behaviour of the pubsub system.
  363. It also contains some minor breaking changes in the Go API and ABCI.
  364. There are no changes to the block or p2p protocols, so v0.31.0 should work fine
  365. with blockchains created from the v0.30 series.
  366. ### RPC
  367. The pubsub no longer blocks on publishing. This may cause some WebSocket (WS) clients to stop working as expected.
  368. If your WS client is not consuming events fast enough, Tendermint can terminate the subscription.
  369. In this case, the WS client will receive an error with description:
  370. ```json
  371. {
  372. "jsonrpc": "2.0",
  373. "id": "{ID}#event",
  374. "error": {
  375. "code": -32000,
  376. "msg": "Server error",
  377. "data": "subscription was canceled (reason: client is not pulling messages fast enough)" // or "subscription was canceled (reason: Tendermint exited)"
  378. }
  379. }
  380. Additionally, there are now limits on the number of subscribers and
  381. subscriptions that can be active at once. See the new
  382. `rpc.max_subscription_clients` and `rpc.max_subscriptions_per_client` values to
  383. configure this.
  384. ```
  385. ### Applications
  386. Simple rename of `ConsensusParams.BlockSize` to `ConsensusParams.Block`.
  387. The `ConsensusParams.Block.TimeIotaMS` field was also removed. It's configured
  388. in the ConsensusParsm in genesis.
  389. ### Go API
  390. See the [CHANGELOG](CHANGELOG.md). These are relatively straight forward.
  391. ## v0.30.0
  392. This release contains a breaking change to both the block and p2p protocols,
  393. however it may be compatible with blockchains created with v0.29.0 depending on
  394. the chain history. If your blockchain has not included any pieces of evidence,
  395. or no piece of evidence has been included in more than one block,
  396. and if your application has never returned multiple updates
  397. for the same validator in a single block, then v0.30.0 will work fine with
  398. blockchains created with v0.29.0.
  399. The p2p protocol change is to fix the proposer selection algorithm again.
  400. Note that proposer selection is purely a p2p concern right
  401. now since the algorithm is only relevant during real time consensus.
  402. This change is thus compatible with v0.29.0, but
  403. all nodes must be upgraded to avoid disagreements on the proposer.
  404. ### Applications
  405. Applications must ensure they do not return duplicates in
  406. `ResponseEndBlock.ValidatorUpdates`. A pubkey must only appear once per set of
  407. updates. Duplicates will cause irrecoverable failure. If you have a very good
  408. reason why we shouldn't do this, please open an issue.
  409. ## v0.29.0
  410. This release contains some breaking changes to the block and p2p protocols,
  411. and will not be compatible with any previous versions of the software, primarily
  412. due to changes in how various data structures are hashed.
  413. Any implementations of Tendermint blockchain verification, including lite clients,
  414. will need to be updated. For specific details:
  415. * [Merkle tree](https://github.com/tendermint/spec/blob/master/spec/blockchain/encoding.md#merkle-trees)
  416. * [ConsensusParams](https://github.com/tendermint/spec/blob/master/spec/blockchain/state.md#consensusparams)
  417. There was also a small change to field ordering in the vote struct. Any
  418. implementations of an out-of-process validator (like a Key-Management Server)
  419. will need to be updated. For specific details:
  420. * [Vote](https://github.com/tendermint/spec/blob/master/spec/consensus/signing.md#votes)
  421. Finally, the proposer selection algorithm continues to evolve. See the
  422. [work-in-progress
  423. specification](https://github.com/tendermint/tendermint/pull/3140).
  424. For everything else, please see the [CHANGELOG](./CHANGELOG.md#v0.29.0).
  425. ## v0.28.0
  426. This release breaks the format for the `priv_validator.json` file
  427. and the protocol used for the external validator process.
  428. It is compatible with v0.27.0 blockchains (neither the BlockProtocol nor the
  429. P2PProtocol have changed).
  430. Please read carefully for details about upgrading.
  431. **Note:** Backup your `config/priv_validator.json`
  432. before proceeding.
  433. ### `priv_validator.json`
  434. The `config/priv_validator.json` is now two files:
  435. `config/priv_validator_key.json` and `data/priv_validator_state.json`.
  436. The former contains the key material, the later contains the details on the last
  437. message signed.
  438. When running v0.28.0 for the first time, it will back up any pre-existing
  439. `priv_validator.json` file and proceed to split it into the two new files.
  440. Upgrading should happen automatically without problem.
  441. To upgrade manually, use the provided `privValUpgrade.go` script, with exact paths for the old
  442. `priv_validator.json` and the locations for the two new files. It's recomended
  443. to use the default paths, of `config/priv_validator_key.json` and
  444. `data/priv_validator_state.json`, respectively:
  445. ```sh
  446. go run scripts/privValUpgrade.go <old-path> <new-key-path> <new-state-path>
  447. ```
  448. ### External validator signers
  449. The Unix and TCP implementations of the remote signing validator
  450. have been consolidated into a single implementation.
  451. Thus in both cases, the external process is expected to dial
  452. Tendermint. This is different from how Unix sockets used to work, where
  453. Tendermint dialed the external process.
  454. The `PubKeyMsg` was also split into separate `Request` and `Response` types
  455. for consistency with other messages.
  456. Note that the TCP sockets don't yet use a persistent key,
  457. so while they're encrypted, they can't yet be properly authenticated.
  458. See [#3105](https://github.com/tendermint/tendermint/issues/3105).
  459. Note the Unix socket has neither encryption nor authentication, but will
  460. add a shared-secret in [#3099](https://github.com/tendermint/tendermint/issues/3099).
  461. ## v0.27.0
  462. This release contains some breaking changes to the block and p2p protocols,
  463. but does not change any core data structures, so it should be compatible with
  464. existing blockchains from the v0.26 series that only used Ed25519 validator keys.
  465. Blockchains using Secp256k1 for validators will not be compatible. This is due
  466. to the fact that we now enforce which key types validators can use as a
  467. consensus param. The default is Ed25519, and Secp256k1 must be activated
  468. explicitly.
  469. It is recommended to upgrade all nodes at once to avoid incompatibilities at the
  470. peer layer - namely, the heartbeat consensus message has been removed (only
  471. relevant if `create_empty_blocks=false` or `create_empty_blocks_interval > 0`),
  472. and the proposer selection algorithm has changed. Since proposer information is
  473. never included in the blockchain, this change only affects the peer layer.
  474. ### Go API Changes
  475. #### libs/db
  476. The ReverseIterator API has changed the meaning of `start` and `end`.
  477. Before, iteration was from `start` to `end`, where
  478. `start > end`. Now, iteration is from `end` to `start`, where `start < end`.
  479. The iterator also excludes `end`. This change allows a simplified and more
  480. intuitive logic, aligning the semantic meaning of `start` and `end` in the
  481. `Iterator` and `ReverseIterator`.
  482. ### Applications
  483. This release enforces a new consensus parameter, the
  484. ValidatorParams.PubKeyTypes. Applications must ensure that they only return
  485. validator updates with the allowed PubKeyTypes. If a validator update includes a
  486. pubkey type that is not included in the ConsensusParams.Validator.PubKeyTypes,
  487. block execution will fail and the consensus will halt.
  488. By default, only Ed25519 pubkeys may be used for validators. Enabling
  489. Secp256k1 requires explicit modification of the ConsensusParams.
  490. Please update your application accordingly (ie. restrict validators to only be
  491. able to use Ed25519 keys, or explicitly add additional key types to the genesis
  492. file).
  493. ## v0.26.0
  494. This release contains a lot of changes to core data types and protocols. It is not
  495. compatible to the old versions and there is no straight forward way to update
  496. old data to be compatible with the new version.
  497. To reset the state do:
  498. ```sh
  499. tendermint unsafe_reset_all
  500. ```
  501. Here we summarize some other notable changes to be mindful of.
  502. ### Config Changes
  503. All timeouts must be changed from integers to strings with their duration, for
  504. instance `flush_throttle_timeout = 100` would be changed to
  505. `flush_throttle_timeout = "100ms"` and `timeout_propose = 3000` would be changed
  506. to `timeout_propose = "3s"`.
  507. ### RPC Changes
  508. The default behaviour of `/abci_query` has been changed to not return a proof,
  509. and the name of the parameter that controls this has been changed from `trusted`
  510. to `prove`. To get proofs with your queries, ensure you set `prove=true`.
  511. Various version fields like `amino_version`, `p2p_version`, `consensus_version`,
  512. and `rpc_version` have been removed from the `node_info.other` and are
  513. consolidated under the tendermint semantic version (ie. `node_info.version`) and
  514. the new `block` and `p2p` protocol versions under `node_info.protocol_version`.
  515. ### ABCI Changes
  516. Field numbers were bumped in the `Header` and `ResponseInfo` messages to make
  517. room for new `version` fields. It should be straight forward to recompile the
  518. protobuf file for these changes.
  519. #### Proofs
  520. The `ResponseQuery.Proof` field is now structured as a `[]ProofOp` to support
  521. generalized Merkle tree constructions where the leaves of one Merkle tree are
  522. the root of another. If you don't need this functionality, and you used to
  523. return `<proof bytes>` here, you should instead return a single `ProofOp` with
  524. just the `Data` field set:
  525. ```go
  526. []ProofOp{
  527. ProofOp{
  528. Data: <proof bytes>,
  529. }
  530. }
  531. ```
  532. For more information, see:
  533. * [ADR-026](https://github.com/tendermint/tendermint/blob/30519e8361c19f4bf320ef4d26288ebc621ad725/docs/architecture/adr-026-general-merkle-proof.md)
  534. * [Relevant ABCI
  535. documentation](https://github.com/tendermint/tendermint/blob/30519e8361c19f4bf320ef4d26288ebc621ad725/docs/spec/abci/apps.md#query-proofs)
  536. * [Description of
  537. keys](https://github.com/tendermint/tendermint/blob/30519e8361c19f4bf320ef4d26288ebc621ad725/crypto/merkle/proof_key_path.go#L14)
  538. ### Go API Changes
  539. #### crypto/merkle
  540. The `merkle.Hasher` interface was removed. Functions which used to take `Hasher`
  541. now simply take `[]byte`. This means that any objects being Merklized should be
  542. serialized before they are passed in.
  543. #### node
  544. The `node.RunForever` function was removed. Signal handling and running forever
  545. should instead be explicitly configured by the caller. See how we do it
  546. [here](https://github.com/tendermint/tendermint/blob/30519e8361c19f4bf320ef4d26288ebc621ad725/cmd/tendermint/commands/run_node.go#L60).
  547. ### Other
  548. All hashes, except for public key addresses, are now 32-bytes.
  549. ## v0.25.0
  550. This release has minimal impact.
  551. If you use GasWanted in ABCI and want to enforce it, set the MaxGas in the genesis file (default is no max).
  552. ## v0.24.0
  553. New 0.24.0 release contains a lot of changes to the state and types. It's not
  554. compatible to the old versions and there is no straight forward way to update
  555. old data to be compatible with the new version.
  556. To reset the state do:
  557. ```sh
  558. tendermint unsafe_reset_all
  559. ```
  560. Here we summarize some other notable changes to be mindful of.
  561. ### Config changes
  562. `p2p.max_num_peers` was removed in favor of `p2p.max_num_inbound_peers` and
  563. `p2p.max_num_outbound_peers`.
  564. ```toml
  565. # Maximum number of inbound peers
  566. max_num_inbound_peers = 40
  567. # Maximum number of outbound peers to connect to, excluding persistent peers
  568. max_num_outbound_peers = 10
  569. ```
  570. As you can see, the default ratio of inbound/outbound peers is 4/1. The reason
  571. is we want it to be easier for new nodes to connect to the network. You can
  572. tweak these parameters to alter the network topology.
  573. ### RPC Changes
  574. The result of `/commit` used to contain `header` and `commit` fields at the top level. These are now contained under the `signed_header` field.
  575. ### ABCI Changes
  576. The header has been upgraded and contains new fields, but none of the existing
  577. fields were changed, except their order.
  578. The `Validator` type was split into two, one containing an `Address` and one
  579. containing a `PubKey`. When processing `RequestBeginBlock`, use the `Validator`
  580. type, which contains just the `Address`. When returning `ResponseEndBlock`, use
  581. the `ValidatorUpdate` type, which contains just the `PubKey`.
  582. ### Validator Set Updates
  583. Validator set updates returned in ResponseEndBlock for height `H` used to take
  584. effect immediately at height `H+1`. Now they will be delayed one block, to take
  585. effect at height `H+2`. Note this means that the change will be seen by the ABCI
  586. app in the `RequestBeginBlock.LastCommitInfo` at block `H+3`. Apps were already
  587. required to maintain a map from validator addresses to pubkeys since v0.23 (when
  588. pubkeys were removed from RequestBeginBlock), but now they may need to track
  589. multiple validator sets at once to accomodate this delay.
  590. ### Block Size
  591. The `ConsensusParams.BlockSize.MaxTxs` was removed in favour of
  592. `ConsensusParams.BlockSize.MaxBytes`, which is now enforced. This means blocks
  593. are limitted only by byte-size, not by number of transactions.