diff --git a/node/pkg/chain/utils/utils.go b/node/pkg/chain/utils/utils.go index 7cfcb9448..1c1c59bda 100644 --- a/node/pkg/chain/utils/utils.go +++ b/node/pkg/chain/utils/utils.go @@ -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 { diff --git a/node/pkg/dal/collector/utils.go b/node/pkg/dal/collector/utils.go index bdc2575e3..c0d653fcf 100644 --- a/node/pkg/dal/collector/utils.go +++ b/node/pkg/dal/collector/utils.go @@ -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) }