Skip to main content

Overview

BlockHeader contains all metadata for a block including Merkle roots, gas limits, timestamps, and consensus-related fields. The block hash is computed from RLP(header).

Type Definition

Creating BlockHeader

from

Universal constructor with all header fields.

Header Fields by Fork

Genesis (All Blocks)

EIP-1559 (London Fork)

Shanghai Fork

EIP-4844 (Cancun Fork)

EIP-7685 (Prague and Osaka)

requestsHash is a 32-byte execution-requests commitment appended after parentBeaconBlockRoot as the 21st RLP field. from, fromRpc, and calculateHash preserve it. Omitting it from a Prague or Osaka header changes the block hash. The Zig field is requests_hash; its RLP encoder and decoder use the same field order.

Post-Merge Changes

After The Merge, several fields are deprecated but still present:

See Also

For Zig rlpDecode, the returned extra_data slice belongs to the caller. Free it with the allocator passed to the decoder after using the header. The decoder preserves those bytes independently of the encoded input.