header

package
v1.9.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 23, 2026 License: Apache-2.0, MIT Imports: 7 Imported by: 0

Documentation

Overview

Package header implements Filecoin block-header chain validation. It is the Lantern equivalent of the header-only subset of Lotus' chain/sync.go: parent linkage, BLS aggregate signature verification over the block, beacon entry referencing (delegated to chain/beacon), election-proof signature checks, and tipset construction.

What this package does NOT do (intentionally): execute messages, validate state transitions, or instantiate a VM. Lantern is a light client; message execution lives in full nodes (Forest, Lotus, the future pure-Go FVM).

See docs/design/MODULES.md and docs/design/TRUSTED-ROOT.md for context.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ValidateHeader

func ValidateHeader(
	bh *ltypes.BlockHeader,
	parent *ltypes.TipSet,
	beaconVerifier *beacon.Config,
	beaconPrev *ltypes.BeaconEntry,
) error

ValidateHeader is the Phase 1 light-client validation entry point for one block header against its parent tipset, the beacon entry from the parent epoch, and a configured DRAND verifier.

`beaconPrev` may be nil iff the chain is using an unchained drand scheme (e.g. quicknet on Filecoin mainnet) OR if this is a network-genesis boundary where there is no previous round to chain to.

func ValidateTipsetShape

func ValidateTipsetShape(blocks []*ltypes.BlockHeader) (*ltypes.TipSet, error)

ValidateTipsetShape checks the Filecoin tipset rule across a set of blocks at the same height: identical Parents, ParentStateRoot, ParentMessageReceipts, ParentWeight, Height, and parent beacon-round continuity. Returns the canonical TipSet on success.

func VerifyBlockHeaderCID

func VerifyBlockHeaderCID(bh *ltypes.BlockHeader, expected cid.Cid) error

VerifyBlockHeaderCID returns nil iff bh.Cid() matches `expected`. Lantern uses this on every header it ingests: the CID must hash through the canonical CBOR encoding of the header.

func VerifyParentLinkage

func VerifyParentLinkage(parents []cid.Cid, parentTS *ltypes.TipSet) error

VerifyParentLinkage returns nil iff `parents` is exactly the block-CID set of `parentTS`, treated as an unordered set (the chain spec stores parent pointers in tipset-key canonical order, so the slices should compare equal element-by-element).

Types

This section is empty.

Directories

Path Synopsis
Package store implements Lantern's persistent header store.
Package store implements Lantern's persistent header store.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL