From c9510d0f50e455acf8e438a6b72cf9d6c7effc0d Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Wed, 5 Sep 2018 18:26:12 -0400 Subject: [PATCH 1/5] name drop external contribs in changelog --- CHANGELOG_PENDING.md | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/CHANGELOG_PENDING.md b/CHANGELOG_PENDING.md index de91f52e..2d591275 100644 --- a/CHANGELOG_PENDING.md +++ b/CHANGELOG_PENDING.md @@ -1,5 +1,8 @@ # Pending +Special thanks to external contributors with PRs included in this release: ackratos, james-ray, bradyjoestar, +peerlink, Ahmah2009, bluele, b00f + BREAKING CHANGES: * CLI/RPC/Config @@ -21,9 +24,11 @@ BREAKING CHANGES: * Go API - [lite] \#1815 Complete refactor of the package - - [node] \#2212 NewNode now accepts a `*p2p.NodeKey` + - [node] \#2212 NewNode now accepts a `*p2p.NodeKey` (@bradyjoestar) - [libs/common] \#2199 Remove Fmt, in favor of fmt.Sprintf - [libs/common] SplitAndTrim was deleted + - [libs/common] \#2274 Remove unused Math functions like MaxInt, MaxInt64, + MinInt, MinInt64 (@Ahmah2009) - [libs/clist] Panics if list extends beyond MaxLength - [crypto] \#2205 Rename AminoRoute variables to no longer be prefixed by signature type. @@ -49,10 +54,11 @@ BREAKING CHANGES: * P2P Protocol - [p2p] \#2263 Update secret connection to use a little endian encoded nonce - [blockchain] \#2213 Fix Amino routes for blockchain reactor messages + (@peerlink) FEATURES: -- [types] \#2015 Allow genesis file to have 0 validators +- [types] \#2015 Allow genesis file to have 0 validators (@b00f) - Initial validator set can be determined by the app in ResponseInitChain - [rpc] \#2161 New event `ValidatorSetUpdates` for when the validator set changes - [crypto/multisig] \#2164 Introduce multisig pubkey and signature format @@ -60,14 +66,15 @@ FEATURES: IMPROVEMENTS: - [docs] Lint documentation with `write-good` and `stop-words`. -- [scripts] Added json2wal tool, which is supposed to help our users restore +- [scripts] \#2196 Added json2wal tool, which is supposed to help our users restore (@bradyjoestar) corrupted WAL files and compose test WAL files (@bradyjoestar) - [mempool] \#2234 Now stores txs by hash inside of the cache, to mitigate memory leakage +- [mempool] \#2166 Set explicit capacity for map when updating txs (@bluele) BUG FIXES: - [config] \#2284 Replace `db_path` with `db_dir` from automatically generated configuration files. - [mempool] \#2188 Fix OOM issue from cache map and list getting out of sync -- [state] \#2051 KV store index supports searching by `tx.height` +- [state] \#2051 KV store index supports searching by `tx.height` (@ackratos) - [rpc] \#2327 `/dial_peers` does not try to dial existing peers -- [node] \#2323 Filter empty strings from config lists -- [abci/client] \#2236 Fix closing GRPC connection +- [node] \#2323 Filter empty strings from config lists (@james-ray) +- [abci/client] \#2236 Fix closing GRPC connection (@bradyjoestar) From 4416c9e4bc81c89ddebcfb1434c211dab9ece028 Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Wed, 5 Sep 2018 18:43:21 -0400 Subject: [PATCH 2/5] fix links in abci readme. fixes #2335 --- abci/README.md | 8 ++++---- docs/app-dev/ecosystem.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/abci/README.md b/abci/README.md index c536a3bd..63b43e54 100644 --- a/abci/README.md +++ b/abci/README.md @@ -17,10 +17,10 @@ The community has provided a number of addtional implementations, see the [Tende A detailed description of the ABCI methods and message types is contained in: - [A prose specification](specification.md) -- [A protobuf file](https://github.com/tendermint/abci/blob/master/types/types.proto) -- [A Go interface](https://github.com/tendermint/abci/blob/master/types/application.go). +- [A protobuf file](https://github.com/tendermint/tendermint/blob/master/abci/types/types.proto) +- [A Go interface](https://github.com/tendermint/tendermint/blob/master/abci/types/application.go). -For more background information on ABCI, motivations, and tendermint, please visit [the documentation](http://tendermint.readthedocs.io/en/master/). +For more background information on ABCI, motivations, and tendermint, please visit [the documentation](https://tendermint.com/docs/). The two guides to focus on are the `Application Development Guide` and `Using ABCI-CLI`. @@ -94,7 +94,7 @@ Note the length-prefixing used in the socket implementation does not apply for G The `abci-cli` tool wraps an ABCI client and can be used for probing/testing an ABCI server. For instance, `abci-cli test` will run a test sequence against a listening server running the Counter application (see below). It can also be used to run some example applications. -See [the documentation](http://tendermint.readthedocs.io/en/master/) for more details. +See [the documentation](https://tendermint.com/docs/) for more details. ### Examples diff --git a/docs/app-dev/ecosystem.json b/docs/app-dev/ecosystem.json index 728f3a53..67aca2ef 100644 --- a/docs/app-dev/ecosystem.json +++ b/docs/app-dev/ecosystem.json @@ -123,7 +123,7 @@ "abciServers": [ { "name": "abci", - "url": "https://github.com/tendermint/abci", + "url": "https://github.com/tendermint/tendermint/tree/master/abci", "language": "Go", "author": "Tendermint" }, From 61914cf48e6512195dfb3b54fb3cd07d0867cfbf Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Wed, 5 Sep 2018 18:56:58 -0400 Subject: [PATCH 3/5] docs/tm-core/using-tm: fix indentation for genesis.validators --- docs/tendermint-core/using-tendermint.md | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/docs/tendermint-core/using-tendermint.md b/docs/tendermint-core/using-tendermint.md index 71b773f0..a14392c4 100644 --- a/docs/tendermint-core/using-tendermint.md +++ b/docs/tendermint-core/using-tendermint.md @@ -42,12 +42,14 @@ definition](https://github.com/tendermint/tendermint/blob/master/types/genesis.g - `genesis_time`: Official time of blockchain start. - `chain_id`: ID of the blockchain. This must be unique for every blockchain. If your testnet blockchains do not have unique - chain IDs, you will have a bad time. -- `validators`: -- `pub_key`: The first element specifies the `pub_key` type. 1 + chain IDs, you will have a bad time. The ChainID must be less than 50 bytes. +- `validators`: List of initial validators. Note this may be overridden entirely by the + application, and may be left empty to make explicit that the + application will initialize the validator set with ResponseInitChain. + - `pub_key`: The first element specifies the `pub_key` type. 1 == Ed25519. The second element are the pubkey bytes. -- `power`: The validator's voting power. -- `name`: Name of the validator (optional). + - `power`: The validator's voting power. + - `name`: Name of the validator (optional). - `app_hash`: The expected application hash (as returned by the `ResponseInfo` ABCI message) upon genesis. If the app's hash does not match, Tendermint will panic. @@ -93,8 +95,7 @@ definition](https://github.com/tendermint/tendermint/blob/master/types/genesis.g "power": "1", "name": "node3" } - ], - "app_hash": "" + ] } ``` From 80c217089ada28f9545d5cdac6eea321d435d59c Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Wed, 5 Sep 2018 18:57:54 -0400 Subject: [PATCH 4/5] docs/spec/blockchain: remove json tags, dont use HexBytes --- docs/spec/blockchain/blockchain.md | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/docs/spec/blockchain/blockchain.md b/docs/spec/blockchain/blockchain.md index 73f4f35a..35fb9d67 100644 --- a/docs/spec/blockchain/blockchain.md +++ b/docs/spec/blockchain/blockchain.md @@ -42,29 +42,29 @@ the data in the current block, the previous block, and the results returned by t ```go type Header struct { // basic block info - ChainID string `json:"chain_id"` - Height int64 `json:"height"` - Time time.Time `json:"time"` - NumTxs int64 `json:"num_txs"` - TotalTxs int64 `json:"total_txs"` + ChainID string + Height int64 + Time time.Time + NumTxs int64 + TotalTxs int64 // prev block info - LastBlockID BlockID `json:"last_block_id"` + LastBlockID BlockID // hashes of block data - LastCommitHash cmn.HexBytes `json:"last_commit_hash"` // commit from validators from the last block - DataHash cmn.HexBytes `json:"data_hash"` // transactions + LastCommitHash []byte // commit from validators from the last block + DataHash []byte // Merkle root of transactions // hashes from the app output from the prev block - ValidatorsHash cmn.HexBytes `json:"validators_hash"` // validators for the current block - NextValidatorsHash cmn.HexBytes `json:"next_validators_hash"` // validators for the next block - ConsensusHash cmn.HexBytes `json:"consensus_hash"` // consensus params for current block - AppHash cmn.HexBytes `json:"app_hash"` // state after txs from the previous block - LastResultsHash cmn.HexBytes `json:"last_results_hash"` // root hash of all results from the txs from the previous block + ValidatorsHash []byte // validators for the current block + NextValidatorsHash []byte // validators for the next block + ConsensusHash []byte // consensus params for current block + AppHash []byte // state after txs from the previous block + LastResultsHash []byte // root hash of all results from the txs from the previous block // consensus info - EvidenceHash cmn.HexBytes `json:"evidence_hash"` // evidence included in the block - ProposerAddress Address `json:"proposer_address"` // original proposer of the block + EvidenceHash []byte // evidence included in the block + ProposerAddress []byte // original proposer of the block ``` Further details on each of these fields is described below. From 91f8af8fd8a85200ab09a5a610c7b657796c23d9 Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Wed, 5 Sep 2018 19:14:18 -0400 Subject: [PATCH 5/5] docs/spec/blockchain: update vote, signature, time --- docs/spec/blockchain/blockchain.md | 68 ++++++++++-------------------- 1 file changed, 23 insertions(+), 45 deletions(-) diff --git a/docs/spec/blockchain/blockchain.md b/docs/spec/blockchain/blockchain.md index 35fb9d67..dc3ba64b 100644 --- a/docs/spec/blockchain/blockchain.md +++ b/docs/spec/blockchain/blockchain.md @@ -8,9 +8,9 @@ The Tendermint blockchains consists of a short list of basic data types: - `Block` - `Header` -- `Vote` - `BlockID` -- `Signature` +- `Time` +- `Vote` - `Evidence` ## Block @@ -90,6 +90,16 @@ type PartsHeader struct { } ``` +## Time + +Tendermint uses the +[Google.Protobuf.WellKnownTypes.Timestamp](https://developers.google.com/protocol-buffers/docs/reference/csharp/class/google/protobuf/well-known-types/timestamp) +format, which uses two integers, one for Seconds and for Nanoseconds. + +TODO: clarify exact format and reconcile [this +comment](https://github.com/tendermint/tendermint/blob/892b170818cd3be4cd3f919d72dde1ad60c28bbb/types/proto3/block.proto#L43). + + ## Vote A vote is a signed message from a validator for a particular block. @@ -97,14 +107,14 @@ The vote includes information about the validator signing it. ```go type Vote struct { - Timestamp int64 - Address []byte - Index int - Height int64 - Round int - Type int8 - BlockID BlockID - Signature Signature + ValidatorAddress []byte + ValidatorIndex int + Height int64 + Round int + Timestamp Time + Type int8 + BlockID BlockID + Signature []byte } ``` @@ -114,41 +124,9 @@ a _precommit_ has `vote.Type == 2`. ## Signature -Tendermint allows for multiple signature schemes to be used by prepending a single type-byte -to the signature bytes. Different signatures may also come with fixed or variable lengths. -Currently, Tendermint supports Ed25519 and Secp256k1. - -### ED25519 - -An ED25519 signature has `Type == 0x1`. It looks like: - -```go -// Implements Signature -type Ed25519Signature struct { - Type int8 = 0x1 - Signature [64]byte -} -``` - -where `Signature` is the 64 byte signature. - -### Secp256k1 - -A `Secp256k1` signature has `Type == 0x2`. It looks like: - -```go -// Implements Signature -type Secp256k1Signature struct { - Type int8 = 0x2 - Signature []byte -} -``` - -where `Signature` is the DER encoded signature, ie: - -```hex -0x30 <0x02> 0x2 . -``` +Signatures in Tendermint are raw bytes representing the underlying signature. +The only signature scheme currently supported for Tendermint validators is +ED25519. The signature is the raw 64-byte ED25519 signature. ## Evidence