Skip to content

Commit 835a470

Browse files
Validate Aggregator hash from the validator set (#822)
When validating the Signed Header in Validate Basic we should check if the aggregator hash corresponds to the hash of the validator set. Closes: #820
1 parent 6a8b5d8 commit 835a470

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

types/validation.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package types
22

33
import (
4+
"bytes"
45
"errors"
56

67
"github.com/tendermint/tendermint/crypto/ed25519"
@@ -61,6 +62,10 @@ func (h *SignedHeader) ValidateBasic() error {
6162
return err
6263
}
6364

65+
if !bytes.Equal(h.Validators.Hash(), h.AggregatorsHash[:]) {
66+
return errors.New("aggregator set hash in signed header and hash of validator set do not match")
67+
}
68+
6469
// Make sure there is exactly one signature
6570
if len(h.Commit.Signatures) != 1 {
6671
return errors.New("expected exactly one signature")

0 commit comments

Comments
 (0)