Browse Source

types: Remove pubkey from validator hash (#2512)

* types: Remove pubkey from validator hash

* undo lock file change

* Update Spec
pull/2557/head
Dev Ojha 6 years ago
committed by Ethan Buchman
parent
commit
dfda7b442f
3 changed files with 5 additions and 3 deletions
  1. +1
    -0
      CHANGELOG_PENDING.md
  2. +4
    -1
      docs/spec/blockchain/state.md
  3. +0
    -2
      types/validator.go

+ 1
- 0
CHANGELOG_PENDING.md View File

@ -26,6 +26,7 @@ BREAKING CHANGES:
* Blockchain Protocol
* [types] \#2459 `Vote`/`Proposal`/`Heartbeat` use amino encoding instead of JSON in `SignBytes`.
* [types] \#2512 Remove the pubkey field from the validator hash
* P2P Protocol


+ 4
- 1
docs/spec/blockchain/state.md View File

@ -45,7 +45,7 @@ processing transactions, like gas variables and tags - see
### Validator
A validator is an active participant in the consensus with a public key and a voting power.
Validator's also contain an address which is derived from the PubKey:
Validator's also contain an address field, which is a hash digest of the PubKey.
```go
type Validator struct {
@ -55,6 +55,9 @@ type Validator struct {
}
```
When hashing the Validator struct, the pubkey is not hashed,
because the address is already the hash of 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.


+ 0
- 2
types/validator.go View File

@ -73,11 +73,9 @@ func (v *Validator) String() string {
func (v *Validator) Hash() []byte {
return aminoHash(struct {
Address Address
PubKey crypto.PubKey
VotingPower int64
}{
v.Address,
v.PubKey,
v.VotingPower,
})
}


Loading…
Cancel
Save