consensus: use standard keccak API

This commit is contained in:
Piotr Mikołajczyk 2025-11-18 11:33:23 +01:00
parent 835ef75baa
commit e1211c8953
No known key found for this signature in database
GPG key ID: 2E4C2AAD5E71D22D

View file

@ -42,7 +42,6 @@ import (
"github.com/ethereum/go-ethereum/params"
"github.com/ethereum/go-ethereum/rlp"
"github.com/ethereum/go-ethereum/trie"
"golang.org/x/crypto/sha3"
)
const (
@ -641,11 +640,9 @@ func (c *Clique) Close() error {
}
// SealHash returns the hash of a block prior to it being sealed.
func SealHash(header *types.Header) (hash common.Hash) {
hasher := sha3.NewLegacyKeccak256()
encodeSigHeader(hasher, header)
hasher.(crypto.KeccakState).Read(hash[:])
return hash
func SealHash(header *types.Header) common.Hash {
encoded := CliqueRLP(header)
return crypto.Keccak256Hash(encoded)
}
// CliqueRLP returns the rlp bytes which needs to be signed for the proof-of-authority