Skip to content
This repository was archived by the owner on Jul 15, 2018. It is now read-only.

Commit 887bd8b

Browse files
authored
Merge pull request #268 from tendermint/xla/resolve-divergence
Resolve divergence
2 parents 361277f + 514065a commit 887bd8b

File tree

7 files changed

+265
-161
lines changed

7 files changed

+265
-161
lines changed

CHANGELOG.md

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,27 @@
22

33
## 0.11.0
44

5-
*TBD*
5+
*June 6, 2018*
66

77
BREAKING CHANGES:
88

9-
- [types] Added `type` field to `Evidence` (opaque bytes indicating kind of fraud)
10-
- [types] Added `time` field to `Evidence` (note that this is the timestamp of the block which was double-signed, not the time the evidence was received)
9+
- [example/dummy] Remove. See example/kvstore
10+
- [types] Upgrade many messages:
11+
- RequestInitChain takes all fields from a Genesis file
12+
- RequestBeginBlock provides a list of all validators and whether or not
13+
they signed
14+
- Header: remove some fields, add proposer
15+
- BlockID, PartSetHeader: remove
16+
- Validator: includes address
17+
- PubKey: new message with `type` and `data`
18+
- Evidence: add type and more fields
1119

12-
TODO
20+
FEATURES:
21+
22+
- [types] Add some fields
23+
- ResponseInitChain includes ConsensusParams and Validators
24+
- ResponseBeginBlock includes tags
25+
- ResponseEndBlock includes tags
1326

1427
## 0.10.3 (April 9, 2018)
1528

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,4 +171,4 @@ devdoc_clean:
171171
# To avoid unintended conflicts with file names, always add to .PHONY
172172
# unless there is a reason not to.
173173
# https://www.gnu.org/software/make/manual/html_node/Phony-Targets.html
174-
.PHONY: check protoc build dist install check_tools get_tools get_protoc update_tools get_vendor_deps test test_race test_integrations fmt metalinter metalinter_all docker_build docker_run docker_run_rm devdoc_init devdoc devdoc_save devdoc_clean
174+
.PHONY: check protoc build dist install check_tools get_tools get_protoc update_tools get_vendor_deps test test_race fmt metalinter metalinter_all docker_build docker_run docker_run_rm devdoc_init devdoc devdoc_save devdoc_clean

README.md

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,28 @@
55
Blockchains are systems for multi-master state machine replication.
66
**ABCI** is an interface that defines the boundary between the replication engine (the blockchain),
77
and the state machine (the application).
8-
By using a socket protocol, we enable a consensus engine running in one process
9-
to manage an application state running in another.
10-
11-
For background information on ABCI, motivations, and tendermint, please visit [the documentation](http://tendermint.readthedocs.io/en/master/).
12-
The two guides to focus on are the `Application Development Guide` and `Using ABCI-CLI`.
8+
Using a socket protocol, a consensus engine running in one process
9+
can manage an application state running in another.
1310

1411
Previously, the ABCI was referred to as TMSP.
1512

1613
The community has provided a number of addtional implementations, see the [Tendermint Ecosystem](https://tendermint.com/ecosystem)
1714

1815
## Specification
1916

20-
The [primary specification](https://github.com/tendermint/abci/blob/master/types/types.proto)
21-
is made using Protocol Buffers. To build it, run
17+
A detailed description of the ABCI methods and message types is contained in:
18+
19+
- [A prose specification](specification.md)
20+
- [A protobuf file](https://github.com/tendermint/abci/blob/master/types/types.proto)
21+
- [A Go interface](https://github.com/tendermint/abci/blob/master/types/application.go).
22+
23+
For more background information on ABCI, motivations, and tendermint, please visit [the documentation](http://tendermint.readthedocs.io/en/master/).
24+
The two guides to focus on are the `Application Development Guide` and `Using ABCI-CLI`.
25+
26+
27+
## Protocl Buffers
28+
29+
To compile the protobuf file, run:
2230

2331
```
2432
make protoc
@@ -28,12 +36,10 @@ See `protoc --help` and [the Protocol Buffers site](https://developers.google.co
2836
for details on compiling for other languages. Note we also include a [GRPC](http://www.grpc.io/docs)
2937
service definition.
3038

31-
For the specification as an interface in Go, see the
32-
[types/application.go file](https://github.com/tendermint/abci/blob/master/types/application.go).
33-
34-
See the [spec file](specification.rst) for a detailed description of the message types.
39+
## Install ABCI-CLI
3540

36-
## Install
41+
The `abci-cli` is a simple tool for debugging ABCI servers and running some
42+
example apps. To install it:
3743

3844
```
3945
go get github.com/tendermint/abci

specification.md

Lines changed: 95 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,13 @@ connection. They may be referred to as the `DeliverTx state`, the
5050

5151
See below for more details on the message types and how they are used.
5252

53+
## Request/Response Messages
54+
5355
### Echo
5456

55-
- **Arguments**:
57+
- **Request**:
5658
- `Message (string)`: A string to echo back
57-
- **Returns**:
59+
- **Response**:
5860
- `Message (string)`: The input string
5961
- **Usage**:
6062
- Echo a string to test an abci client/server implementation
@@ -70,9 +72,9 @@ See below for more details on the message types and how they are used.
7072

7173
### Info
7274

73-
- **Arguments**:
75+
- **Request**:
7476
- `Version (string)`: The Tendermint version
75-
- **Returns**:
77+
- **Response**:
7678
- `Data (string)`: Some arbitrary information
7779
- `Version (Version)`: Version information
7880
- `LastBlockHeight (int64)`: Latest block for which the app has
@@ -88,10 +90,10 @@ See below for more details on the message types and how they are used.
8890

8991
### SetOption
9092

91-
- **Arguments**:
93+
- **Request**:
9294
- `Key (string)`: Key to set
9395
- `Value (string)`: Value to set for key
94-
- **Returns**:
96+
- **Response**:
9597
- `Code (uint32)`: Response code
9698
- `Log (string)`: The output of the application's logger. May
9799
be non-deterministic.
@@ -105,15 +107,19 @@ See below for more details on the message types and how they are used.
105107

106108
### InitChain
107109

108-
- **Arguments**:
110+
- **Request**:
109111
- `Validators ([]Validator)`: Initial genesis validators
110112
- `AppStateBytes ([]byte)`: Serialized initial application state
113+
- **Response**:
114+
- `ConsensusParams (ConsensusParams)`: Initial
115+
consensus-critical parameters.
116+
- `Validators ([]Validator)`: Initial validator set.
111117
- **Usage**:
112118
- Called once upon genesis.
113119

114120
### Query
115121

116-
- **Arguments**:
122+
- **Request**:
117123
- `Data ([]byte)`: Raw query bytes. Can be used with or in lieu
118124
of Path.
119125
- `Path (string)`: Path of request, like an HTTP GET path. Can be
@@ -128,7 +134,7 @@ See below for more details on the message types and how they are used.
128134
application's Merkle root hash, which represents the state as it
129135
was after committing the block at Height-1
130136
- `Prove (bool)`: Return Merkle proof with response if possible
131-
- **Returns**:
137+
- **Response**:
132138
- `Code (uint32)`: Response code.
133139
- `Log (string)`: The output of the application's logger. May
134140
be non-deterministic.
@@ -148,26 +154,28 @@ See below for more details on the message types and how they are used.
148154

149155
### BeginBlock
150156

151-
- **Arguments**:
157+
- **Request**:
152158
- `Hash ([]byte)`: The block's hash. This can be derived from the
153159
block header.
154160
- `Header (struct{})`: The block header
155-
- `AbsentValidators ([]int32)`: List of indices of validators not
156-
included in the LastCommit
161+
- `Validators ([]SigningValidator)`: List of validators in the current validator
162+
set and whether or not they signed a vote in the LastCommit
157163
- `ByzantineValidators ([]Evidence)`: List of evidence of
158164
validators that acted maliciously
165+
- **Response**:
166+
- `Tags ([]cmn.KVPair)`: Key-Value tags for filtering and indexing
159167
- **Usage**:
160168
- Signals the beginning of a new block. Called prior to
161169
any DeliverTxs.
162170
- The header is expected to at least contain the Height.
163-
- The `AbsentValidators` and `ByzantineValidators` can be used to
171+
- The `Validators` and `ByzantineValidators` can be used to
164172
determine rewards and punishments for the validators.
165173

166174
### CheckTx
167175

168-
- **Arguments**:
176+
- **Request**:
169177
- `Tx ([]byte)`: The request transaction bytes
170-
- **Returns**:
178+
- **Response**:
171179
- `Code (uint32)`: Response code
172180
- `Data ([]byte)`: Result bytes, if any.
173181
- `Log (string)`: The output of the application's logger. May
@@ -201,9 +209,9 @@ See below for more details on the message types and how they are used.
201209

202210
### DeliverTx
203211

204-
- **Arguments**:
212+
- **Request**:
205213
- `Tx ([]byte)`: The request transaction bytes.
206-
- **Returns**:
214+
- **Response**:
207215
- `Code (uint32)`: Response code.
208216
- `Data ([]byte)`: Result bytes, if any.
209217
- `Log (string)`: The output of the application's logger. May
@@ -224,13 +232,14 @@ See below for more details on the message types and how they are used.
224232

225233
### EndBlock
226234

227-
- **Arguments**:
235+
- **Request**:
228236
- `Height (int64)`: Height of the block just executed.
229-
- **Returns**:
237+
- **Response**:
230238
- `ValidatorUpdates ([]Validator)`: Changes to validator set (set
231239
voting power to 0 to remove).
232240
- `ConsensusParamUpdates (ConsensusParams)`: Changes to
233241
consensus-critical time, size, and other parameters.
242+
- `Tags ([]cmn.KVPair)`: Key-Value tags for filtering and indexing
234243
- **Usage**:
235244
- Signals the end of a block.
236245
- Called prior to each Commit, after all transactions.
@@ -239,11 +248,77 @@ See below for more details on the message types and how they are used.
239248

240249
### Commit
241250

242-
- **Returns**:
251+
- **Response**:
243252
- `Data ([]byte)`: The Merkle root hash
244253
- **Usage**:
245254
- Persist the application state.
246255
- Return a Merkle root hash of the application state.
247256
- It's critical that all application instances return the
248257
same hash. If not, they will not be able to agree on the next
249258
block, because the hash is included in the next block!
259+
260+
## Data Messages
261+
262+
### Header
263+
264+
- **Fields**:
265+
- `ChainID (string)`: ID of the blockchain
266+
- `Height (int64)`: Height of the block in the chain
267+
- `Time (int64)`: Unix time of the block
268+
- `NumTxs (int32)`: Number of transactions in the block
269+
- `TotalTxs (int64)`: Total number of transactions in the blockchain until
270+
now
271+
- `LastBlockHash ([]byte)`: Hash of the previous (parent) block
272+
- `ValidatorsHash ([]byte)`: Hash of the validator set for this block
273+
- `AppHash ([]byte)`: Data returned by the last call to `Commit` - typically the
274+
Merkle root of the application state after executing the previous block's
275+
transactions
276+
- `Proposer (Validator)`: Original proposer for the block
277+
- **Usage**:
278+
- Provided in RequestBeginBlock
279+
- Provides important context about the current state of the blockchain -
280+
especially height and time.
281+
- Provides the proposer of the current block, for use in proposer-based
282+
reward mechanisms.
283+
284+
### Validator
285+
286+
- **Fields**:
287+
- `Address ([]byte)`: Address of the validator (hash of the public key)
288+
- `PubKey (PubKey)`: Public key of the validator
289+
- `Power (int64)`: Voting power of the validator
290+
- **Usage**:
291+
- Provides all identifying information about the validator
292+
293+
### SigningValidator
294+
295+
- **Fields**:
296+
- `Validator (Validator)`: A validator
297+
- `SignedLastBlock (bool)`: Indicated whether or not the validator signed
298+
the last block
299+
- **Usage**:
300+
- Indicates whether a validator signed the last block, allowing for rewards
301+
based on validator availability
302+
303+
### PubKey
304+
305+
- **Fields**:
306+
- `Type (string)`: Type of the public key. A simple string like `"ed25519"`.
307+
In the future, may indicate a serialization algorithm to parse the `Data`,
308+
for instance `"amino"`.
309+
- `Data ([]byte)`: Public key data. For a simple public key, it's just the
310+
raw bytes. If the `Type` indicates an encoding algorithm, this is the
311+
encoded public key.
312+
- **Usage**:
313+
- A generic and extensible typed public key
314+
315+
### Evidence
316+
317+
- **Fields**:
318+
- `Type (string)`: Type of the evidence. A hierarchical path like
319+
"duplicate/vote".
320+
- `Validator (Validator`: The offending validator
321+
- `Height (int64)`: Height when the offense was committed
322+
- `Time (int64)`: Unix time of the block at height `Height`
323+
- `TotalVotingPower (int64)`: Total voting power of the validator set at
324+
height `Height`

0 commit comments

Comments
 (0)