Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
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 (*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 ¶
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 ¶
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).