Skip to content

Commit

Permalink
fix: update proof related codes (#1981)
Browse files Browse the repository at this point in the history
  • Loading branch information
nick-bisonai authored Aug 1, 2024
1 parent db3e180 commit 5554d96
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion node/pkg/chain/utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -626,7 +626,9 @@ func RecoverSigner(hash []byte, signature []byte) (address common.Address, err e
// use copy to avoid modifying the original signature
signatureCopy := make([]byte, len(signature))
copy(signatureCopy, signature)
signatureCopy[64] -= 27
if signatureCopy[64] == 27 || signatureCopy[64] == 28 {
signatureCopy[64] -= 27
}

pubKey, err := crypto.SigToPub(hash, signatureCopy)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion node/pkg/dal/collector/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ func removeDuplicateProof(proof []byte) []byte {
uniqueProofs[string(p)] = p
}

result := make([][]byte, 0, len(uniqueProofs)*65)
result := make([][]byte, 0, len(uniqueProofs))
for _, p := range uniqueProofs {
result = append(result, p)
}
Expand Down

0 comments on commit 5554d96

Please sign in to comment.