mirror of
https://github.com/fluencelabs/tendermint
synced 2025-06-12 21:01:21 +00:00
* tmhash is fully 32 bytes. closes #1990 * AddressSize * fix tests * fix max sizes
This commit is contained in:
@ -344,7 +344,7 @@ next validator sets Merkle root.
|
||||
### ConsensusParamsHash
|
||||
|
||||
```go
|
||||
block.ConsensusParamsHash == tmhash(amino(state.ConsensusParams))
|
||||
block.ConsensusParamsHash == TMHASH(amino(state.ConsensusParams))
|
||||
```
|
||||
|
||||
Hash of the amino-encoded consensus parameters.
|
||||
|
@ -176,13 +176,12 @@ greater, for example:
|
||||
h0 h1 h3 h4 h0 h1 h2 h3 h4 h5
|
||||
```
|
||||
|
||||
Tendermint always uses the `TMHASH` hash function, which is the first 20-bytes
|
||||
of the SHA256:
|
||||
Tendermint always uses the `TMHASH` hash function, which is equivalent to
|
||||
SHA256:
|
||||
|
||||
```
|
||||
func TMHASH(bz []byte) []byte {
|
||||
shasum := SHA256(bz)
|
||||
return shasum[:20]
|
||||
return SHA256(bz)
|
||||
}
|
||||
```
|
||||
|
||||
|
@ -56,8 +56,8 @@ type Validator struct {
|
||||
}
|
||||
```
|
||||
|
||||
When hashing the Validator struct, the pubkey is not hashed,
|
||||
because the address is already the hash of the pubkey.
|
||||
When hashing the Validator struct, the address is not included,
|
||||
because it is redundant with the pubkey.
|
||||
|
||||
The `state.Validators`, `state.LastValidators`, and `state.NextValidators`, must always by sorted by validator address,
|
||||
so that there is a canonical order for computing the SimpleMerkleRoot.
|
||||
|
Reference in New Issue
Block a user