@ethereumjs/block / BlockHeader
Defined in: header/header.ts:44
An object that represents the block header.
new BlockHeader(
headerData
,opts
):BlockHeader
Defined in: header/header.ts:95
This constructor takes the values, validates them, assigns them and freezes the object.
BlockOptions
= {}
BlockHeader
Use the public static factory methods to assist in creating a Header object from varying data types. For a default empty header, use createBlockHeader.
readonly
optional
baseFeePerGas:bigint
Defined in: header/header.ts:60
readonly
optional
blobGasUsed:bigint
Defined in: header/header.ts:62
readonly
coinbase:Address
Defined in: header/header.ts:47
readonly
common:Common
Defined in: header/header.ts:67
readonly
difficulty:bigint
Defined in: header/header.ts:52
readonly
optional
excessBlobGas:bigint
Defined in: header/header.ts:63
readonly
extraData:Uint8Array
Defined in: header/header.ts:57
readonly
gasLimit:bigint
Defined in: header/header.ts:54
readonly
gasUsed:bigint
Defined in: header/header.ts:55
readonly
logsBloom:Uint8Array
Defined in: header/header.ts:51
readonly
mixHash:Uint8Array
Defined in: header/header.ts:58
readonly
nonce:Uint8Array
Defined in: header/header.ts:59
readonly
number:bigint
Defined in: header/header.ts:53
readonly
optional
parentBeaconBlockRoot:Uint8Array
<ArrayBufferLike
>
Defined in: header/header.ts:64
readonly
parentHash:Uint8Array
Defined in: header/header.ts:45
readonly
receiptTrie:Uint8Array
Defined in: header/header.ts:50
readonly
optional
requestsHash:Uint8Array
<ArrayBufferLike
>
Defined in: header/header.ts:65
readonly
stateRoot:Uint8Array
Defined in: header/header.ts:48
readonly
timestamp:bigint
Defined in: header/header.ts:56
readonly
transactionsTrie:Uint8Array
Defined in: header/header.ts:49
readonly
uncleHash:Uint8Array
Defined in: header/header.ts:46
readonly
optional
withdrawalsRoot:Uint8Array
<ArrayBufferLike
>
Defined in: header/header.ts:61
get prevRandao():
Uint8Array
<ArrayBufferLike
>
Defined in: header/header.ts:78
EIP-4399: After merge to PoS, mixHash
supplanted as prevRandao
Uint8Array
<ArrayBufferLike
>
calcDataFee(
numBlobs
):bigint
Defined in: header/header.ts:551
Returns the total fee for blob gas spent for including blobs in block.
number
number of blobs in the transaction/block
bigint
the total blob gas fee for numBlobs blobs
calcNextBaseFee():
bigint
Defined in: header/header.ts:500
Calculates the base fee for a potential next block
bigint
calcNextBlobGasPrice(
childCommon
):bigint
Defined in: header/header.ts:578
Calculate the blob gas price of the block built on top of this one
Common
bigint
The blob gas price
calcNextExcessBlobGas(
childCommon
):bigint
Defined in: header/header.ts:562
Calculates the excess blob gas for next (hopefully) post EIP 4844 block.
Common
bigint
errorStr():
string
Defined in: header/header.ts:802
Return a compact error string representation of the object
string
ethashCanonicalDifficulty(
parentBlockHeader
):bigint
Defined in: header/header.ts:658
Returns the canonical difficulty for this block.
BlockHeader
the header from the parent Block
of this header
bigint
getBlobGasPrice():
bigint
Defined in: header/header.ts:538
Returns the price per unit of blob gas for a blob transaction in the current/pending block
bigint
the price in gwei per unit of blob gas spent
hash():
Uint8Array
Defined in: header/header.ts:636
Returns the hash of the block header.
Uint8Array
isGenesis():
boolean
Defined in: header/header.ts:649
Checks if the block header is a genesis header.
boolean
raw():
BlockHeaderBytes
Defined in: header/header.ts:585
Returns a Uint8Array Array of the raw Bytes in this header, in order.
serialize():
Uint8Array
Defined in: header/header.ts:729
Returns the rlp encoding of the block header.
Uint8Array
toJSON():
JSONHeader
Defined in: header/header.ts:736
Returns the block header in JSON format.
validateGasLimit(
parentBlockHeader
):void
Defined in: header/header.ts:454
Validates if the block gasLimit remains in the boundaries set by the protocol. Throws if out of bounds.
BlockHeader
the header from the parent Block
of this header
void