#22957·optimism

op-reth: validate fork-specific block-header extraData

Author: asdv23Created Sep 20, 2026Updated Sep 23, 2026

Bug Description

At develop@a6a088325deebbe6cad74db395b9a079669580b6, OpBeaconConsensus::validate_header only applies the generic 32-byte extraData length cap.

It therefore accepts non-genesis pre-Holocene headers with non-empty extraData, and malformed Holocene/Jovian encodings whose length is at most 32 bytes. The OP specifications require empty pre-Holocene extraData, exactly 9 bytes with version 0 during Holocene, and exactly 17 bytes with version 1 from Jovian onward.

The decoders updated by #21292 enforce the fork-specific encoding rules, but they are only reached later when a header is used as the parent for base-fee calculation. They do not validate the current header. This delays rejection by one block and differs from op-geth, which calls ValidateOptimismExtraData while processing engine_newPayload.

Steps to Reproduce

  1. Construct an OpChainSpec with the relevant fork activation.
  2. Construct a sealed header that is otherwise valid but has invalid extraData.
  3. Call OpBeaconConsensus::validate_header.
  4. Observe Ok(()) for examples such as:
    • non-empty pre-Holocene extraData on a non-genesis header;
    • empty or wrong-version Holocene extraData;
    • a 9-byte Holocene encoding after Jovian activation.

Expected behavior

Match the OP execution specification and op-geth ValidateOptimismExtraData behavior:

  • allow arbitrary pre-Holocene extraData only for the configured genesis header;
  • require empty extraData on other pre-Holocene blocks;
  • validate the exact Holocene and Jovian formats at their respective activation timestamps.

Environment Information:

  • Repository: ethereum-optimism/optimism
  • Commit: a6a088325deebbe6cad74db395b9a079669580b6
  • Component: rust/op-reth/crates/consensus
  • Operating system: independent of OS; reproduced by direct consensus validation

Configurations:

Default OpBeaconConsensus with timestamp-activated Holocene/Jovian chain specifications. No special node flags are required.

Logs:

No runtime logs are required. The direct validate_header call unexpectedly returns Ok(()) for the malformed headers above.

Additional context

Related work covers adjacent but incomplete parts of the behavior:

  • #18951 / #21292 added validation to the op-alloy decoders.
  • ethereum-optimism/op-geth#743 added the complete op-geth header validation.
  • paradigmxyz/reth#20858 tightened payload-attribute validation, not block-header validation.

The proposed fix belongs in the consensus layer so every import path applies the same rule.

Source: ethereum-optimism/optimism