msgsearch

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: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotFound = errors.New("msgsearch: message not found within lookback")

ErrNotFound is returned when the message wasn't found within lookback.

Functions

This section is empty.

Types

type Result

type Result struct {
	TipSet  *ltypes.TipSet
	Height  abi.ChainEpoch
	Receipt ltypes.MessageReceipt
	// MessageIndex is the index in the tipset's combined message order
	// (BLS messages in block order then secp). Useful for diagnostics.
	MessageIndex uint64
}

Result is a found-message tuple.

type Searcher

type Searcher struct {
	Store *hstore.Store
	Block hamt.BlockGetter
}

Searcher walks the chain backward looking for a message CID.

func New

func New(s *hstore.Store, bg hamt.BlockGetter) *Searcher

New returns a Searcher.

func (*Searcher) Find

func (s *Searcher) Find(ctx context.Context, fromEpoch abi.ChainEpoch, msgCID cid.Cid, lookback abi.ChainEpoch) (*Result, error)

Find walks back at most `lookback` epochs from `fromEpoch` looking for `msgCID`. fromEpoch=-1 means "current head".

func (*Searcher) FindChild

func (s *Searcher) FindChild(ts *ltypes.TipSet) (*ltypes.TipSet, error)

FindChild exposes the canonical child-tipset lookup so callers that need a tipset's ParentMessageReceipts (which live in the child) can resolve it. Returns ErrNotFound-style error when no child is available yet.

func (*Searcher) OrderedMessageCIDs

func (s *Searcher) OrderedMessageCIDs(ctx context.Context, ts *ltypes.TipSet) ([]cid.Cid, error)

OrderedMessageCIDs returns ts's messages in the canonical Filecoin application order (all blocks' BLS messages in block order, then all blocks' secp messages, with cross-block duplicates applied once). This is the exact order the child tipset's ParentMessageReceipts AMT is indexed by, so receipt[i] corresponds to OrderedMessageCIDs[i] (lantern#73, used by eth_getLogs to pair events with tx hashes).

Jump to

Keyboard shortcuts

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