Skip to content

Commit 3ff479b

Browse files
authored
signer/core: always pad clique header extra data with space for sealer's signature (#24941)
* signer/core: always pad clique header extra data with space for sealer's signature * capitalize comment
1 parent 94c8de0 commit 3ff479b

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

signer/core/signed_data.go

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -147,13 +147,11 @@ func (api *SignerAPI) determineSignatureFormat(ctx context.Context, contentType
147147
if err := rlp.DecodeBytes(cliqueData, header); err != nil {
148148
return nil, useEthereumV, err
149149
}
150-
// The incoming clique header is already truncated, sent to us with a extradata already shortened
151-
if len(header.Extra) < 65 {
152-
// Need to add it back, to get a suitable length for hashing
153-
newExtra := make([]byte, len(header.Extra)+65)
154-
copy(newExtra, header.Extra)
155-
header.Extra = newExtra
156-
}
150+
// Add space in the extradata to put the signature
151+
newExtra := make([]byte, len(header.Extra)+65)
152+
copy(newExtra, header.Extra)
153+
header.Extra = newExtra
154+
157155
// Get back the rlp data, encoded by us
158156
sighash, cliqueRlp, err := cliqueHeaderHashAndRlp(header)
159157
if err != nil {

0 commit comments

Comments
 (0)