Skip to content

Implement Block Header Structure with Consensus Verification Support #24

@kingofthebongo2008

Description

@kingofthebongo2008

Description

The Architecture.md specifies the need for light sync to verify canonical chain without full blocks. While tests demonstrate block header encoding/decoding patterns, there is no formal BlockHeader structure or consensus verification utilities. Per Issue #2, this is essential for validating cross-chain messages using RLP-encoded state proofs.

Required for:

  • Light client header chain synchronization
  • Parent hash chain verification
  • Block header validation for each chain (Ethereum PoS, Polygon, BSC PoSA)

Acceptance Criteria

  • Create BlockHeader struct with all 15+ header fields (parentHash, uncleHash, coinbase, stateRoot, etc.)
  • Implement encodeBlockHeader(RlpEncoder&, const BlockHeader&) free function
  • Implement decodeBlockHeader(RlpDecoder&, BlockHeader&) free function
  • Implement computeBlockHash(const BlockHeader&) -> Hash256 utility
  • Implement verifyParentChain(span<const BlockHeader>) for chain consistency
  • Add chain-specific verification hooks (extensible for PoS, PoSA)
  • Add unit tests with real Ethereum mainnet block headers
  • Place in rlp_ethereum.hpp or new rlp_ethereum_blocks.hpp

Priority

High

Related Requirements

  • CLAUDE.md: Const-correctness - All parameter structs passed by const&
  • CLAUDE.md: Named initialization - Structs designed for designated initializers
  • Issue EVM Bridging Messaging System #2: Bridge Message Processing - Validates cross-chain messages using RLP-encoded state proofs

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions