diff --git a/packages/block/src/consensus/clique.ts b/packages/block/src/consensus/clique.ts index 0e145c5f46..3a89a46319 100644 --- a/packages/block/src/consensus/clique.ts +++ b/packages/block/src/consensus/clique.ts @@ -132,12 +132,12 @@ export function cliqueVerifySignature(header: BlockHeader, signerList: Address[] } /** - * Retrieves the extraData from a sealed block header + * Generates the extraData from a sealed block header * @param header block header from which to retrieve extraData * @param cliqueSigner clique signer key used for creating sealed block - * @returns extradata from the block + * @returns clique seal (i.e. extradata) for the block */ -export function retrieveCliqueBlockExtraData( +export function generateCliqueBlockExtraData( header: BlockHeader, cliqueSigner: Uint8Array, ): Uint8Array { @@ -148,7 +148,7 @@ export function retrieveCliqueBlockExtraData( ;(header.extraData as any) = concatBytes(header.extraData, new Uint8Array(remainingLength)) } - requireClique(header, 'cliqueSealBlock') + requireClique(header, 'generateCliqueBlockExtraData') const ecSignFunction = header.common.customCrypto?.ecsign ?? ecsign const signature = ecSignFunction(cliqueSigHash(header), cliqueSigner) diff --git a/packages/block/src/constructors.ts b/packages/block/src/constructors.ts index 06926380f4..4f346e1308 100644 --- a/packages/block/src/constructors.ts +++ b/packages/block/src/constructors.ts @@ -24,7 +24,7 @@ import { isHexString, } from '@ethereumjs/util' -import { retrieveCliqueBlockExtraData } from './consensus/clique.js' +import { generateCliqueBlockExtraData } from './consensus/clique.js' import { createBlockFromRpc } from './from-rpc.js' import { genRequestsTrieRoot, @@ -526,7 +526,7 @@ export function createSealedCliqueBlock( ...opts, ...{ freeze: false, skipConsensusFormatValidation: true }, }) - ;(sealedCliqueBlock.header.extraData as any) = retrieveCliqueBlockExtraData( + ;(sealedCliqueBlock.header.extraData as any) = generateCliqueBlockExtraData( sealedCliqueBlock.header, cliqueSigner, ) @@ -550,7 +550,7 @@ export function createSealedCliqueBlockHeader( ...opts, ...{ skipConsensusFormatValidation: true }, }) - ;(sealedCliqueBlockHeader.extraData as any) = retrieveCliqueBlockExtraData( + ;(sealedCliqueBlockHeader.extraData as any) = generateCliqueBlockExtraData( sealedCliqueBlockHeader, cliqueSigner, )