mirror of
https://github.com/fluencelabs/tendermint
synced 2025-06-26 11:11:41 +00:00
Add docs changes
This commit is contained in:
@ -10,6 +10,7 @@ The Tendermint blockchains consists of a short list of basic data types:
|
|||||||
- `Header`
|
- `Header`
|
||||||
- `Vote`
|
- `Vote`
|
||||||
- `BlockID`
|
- `BlockID`
|
||||||
|
- `Commit`
|
||||||
- `Signature`
|
- `Signature`
|
||||||
- `Evidence`
|
- `Evidence`
|
||||||
|
|
||||||
@ -22,7 +23,7 @@ and a list of evidence of malfeasance (ie. signing conflicting votes).
|
|||||||
type Block struct {
|
type Block struct {
|
||||||
Header Header
|
Header Header
|
||||||
Txs [][]byte
|
Txs [][]byte
|
||||||
LastCommit []Vote
|
LastCommit Commit
|
||||||
Evidence []Evidence
|
Evidence []Evidence
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
@ -107,6 +108,29 @@ There are two types of votes:
|
|||||||
a *prevote* has `vote.Type == 1` and
|
a *prevote* has `vote.Type == 1` and
|
||||||
a *precommit* has `vote.Type == 2`.
|
a *precommit* has `vote.Type == 2`.
|
||||||
|
|
||||||
|
## Commit
|
||||||
|
|
||||||
|
A Commit contains enough data to verify that a BlockID was committed to at a certain
|
||||||
|
height and round by a sufficient set of validators.
|
||||||
|
|
||||||
|
```go
|
||||||
|
type Commit struct {
|
||||||
|
BlockID BlockID
|
||||||
|
Precommits []*CommitSig
|
||||||
|
RoundNum int
|
||||||
|
HeightNum int64
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
The `CommitSig` values of the `Precommits` array contain the data for each validator needed to reconstruct and verify their precommit vote. For each entry, if the validator did not vote for the committed `BlockID`, their `CommitSig` value is `nil`. The only data unique to each vote is the `Timestamp` and `Signature`, all other data can be stored once in the `Commit` struct.
|
||||||
|
|
||||||
|
```go
|
||||||
|
type CommitSig struct {
|
||||||
|
Signature []byte
|
||||||
|
Timestamp time.Time
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
## Signature
|
## Signature
|
||||||
|
|
||||||
Tendermint allows for multiple signature schemes to be used by prepending a single type-byte
|
Tendermint allows for multiple signature schemes to be used by prepending a single type-byte
|
||||||
|
@ -73,7 +73,7 @@ they are commited to the chain.
|
|||||||
|
|
||||||
The
|
The
|
||||||
[Commit](https://godoc.org/github.com/tendermint/tendermint/types#Commit)
|
[Commit](https://godoc.org/github.com/tendermint/tendermint/types#Commit)
|
||||||
contains a set of
|
contains the information needed to reconstruct the set of
|
||||||
[Votes](https://godoc.org/github.com/tendermint/tendermint/types#Vote)
|
[Votes](https://godoc.org/github.com/tendermint/tendermint/types#Vote)
|
||||||
that were made by the validator set to reach consensus on this block.
|
that were made by the validator set to reach consensus on this block.
|
||||||
This is the key to the security in any PoS system, and actually no data
|
This is the key to the security in any PoS system, and actually no data
|
||||||
|
Reference in New Issue
Block a user