actorstate

package
v0.11.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2022 License: Apache-2.0, MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ActorExtractorFilter

type ActorExtractorFilter interface {
	AllowAddress(addr string) bool
}

type ActorExtractorMap

type ActorExtractorMap interface {
	Allow(code cid.Cid) bool
	GetExtractors(code cid.Cid) ([]ActorStateExtractor, bool)
}

An ActorExtractorMap controls which actor types may be extracted.

type ActorInfo

type ActorInfo struct {
	Actor      types.Actor
	ChangeType tasks.ChangeType
	Address    address.Address
	Current    *types.TipSet
	Executed   *types.TipSet
}

func (ActorInfo) Attributes added in v0.9.0

func (a ActorInfo) Attributes() []attribute.KeyValue

func (ActorInfo) MarshalLogObject added in v0.9.0

func (a ActorInfo) MarshalLogObject(enc zapcore.ObjectEncoder) error

type ActorStateAPI

type ActorStateAPI interface {
	// TODO(optimize): StateGetActor is just a wrapper around StateManager.LoadActor with a lookup of the tipset which we already have
	Actor(ctx context.Context, addr address.Address, tsk types.TipSetKey) (*types.Actor, error)

	// TODO(optimize): StateMinerPower is just a wrapper for stmgr.GetPowerRaw which loads the power actor as we do in StoragePowerExtractor
	MinerPower(ctx context.Context, addr address.Address, ts *types.TipSet) (*api.MinerPower, error)

	// TODO(optimize): StateReadState looks up the tipset and actor that we already have available
	ActorState(ctx context.Context, addr address.Address, ts *types.TipSet) (*api.ActorState, error)

	// TODO(remove): StateMinerSectors loads the actor and then calls miner.Load which StorageMinerExtractor already has available
	// StateMinerSectors(ctx context.Context, addr address.Address, bf *bitfield.BitField, tsk types.TipSetKey) ([]*miner.SectorOnChainInfo, error)
	Store() adt.Store

	ExecutedAndBlockMessages(ctx context.Context, ts, pts *types.TipSet) (*lens.TipSetMessages, error)

	DiffSectors(ctx context.Context, addr address.Address, ts, pts *types.TipSet, pre, cur miner.State) (*miner.SectorChanges, error)
	DiffPreCommits(ctx context.Context, addr address.Address, ts, pts *types.TipSet, pre, cur miner.State) (*miner.PreCommitChanges, error)

	MinerLoad(store adt.Store, act *types.Actor) (miner.State, error)
}

ActorStateAPI is the minimal subset of lens.API that is needed for actor state extraction

type ActorStateError

type ActorStateError struct {
	Code    string
	Name    string
	Head    string
	Address string
	Error   string
}

type ActorStateExtractor

type ActorStateExtractor interface {
	Extract(ctx context.Context, a ActorInfo, node ActorStateAPI) (model.Persistable, error)
}

An ActorStateExtractor extracts actor state into a persistable format

type ActorStateResult

type ActorStateResult struct {
	Code         cid.Cid
	Head         cid.Cid
	Address      address.Address
	Error        error
	SkippedParse bool
	Data         model.Persistable
}

type CustomTypedActorExtractorMap added in v0.9.0

type CustomTypedActorExtractorMap struct {
	// contains filtered or unexported fields
}

A CustomTypedActorExtractorMap extracts a single type of actor using full parsing of actor state

func NewCustomTypedActorExtractorMap added in v0.9.0

func NewCustomTypedActorExtractorMap(extractors map[cid.Cid][]ActorStateExtractor) *CustomTypedActorExtractorMap

func (*CustomTypedActorExtractorMap) Allow added in v0.9.0

func (c *CustomTypedActorExtractorMap) Allow(code cid.Cid) bool

func (*CustomTypedActorExtractorMap) GetExtractors added in v0.9.0

func (c *CustomTypedActorExtractorMap) GetExtractors(code cid.Cid) ([]ActorStateExtractor, bool)

type RawActorExtractorMap

type RawActorExtractorMap struct {
	// contains filtered or unexported fields
}

A RawActorExtractorMap extracts all types of actors using basic actor extraction which only parses shallow state.

func (*RawActorExtractorMap) Allow

func (r *RawActorExtractorMap) Allow(code cid.Cid) bool

func (*RawActorExtractorMap) GetExtractors added in v0.9.0

func (r *RawActorExtractorMap) GetExtractors(code cid.Cid) ([]ActorStateExtractor, bool)

func (*RawActorExtractorMap) Register added in v0.9.0

func (r *RawActorExtractorMap) Register(ase ActorStateExtractor)

type Task

type Task struct {
	// contains filtered or unexported fields
}

A Task processes the extraction of actor state according the allowed types in its extracter map.

func NewTask

func NewTask(node tasks.DataSource, extracterMap ActorExtractorMap) *Task

func (*Task) ProcessActors

func (t *Task) ProcessActors(ctx context.Context, current *types.TipSet, executed *types.TipSet, candidates tasks.ActorStateChangeDiff) (model.Persistable, *visormodel.ProcessingReport, error)

type TypedActorExtractorMap

type TypedActorExtractorMap struct {
	// contains filtered or unexported fields
}

A TypedActorExtractorMap extracts a single type of actor using full parsing of actor state

func NewTypedActorExtractorMap

func NewTypedActorExtractorMap(codes []cid.Cid, ase ...ActorStateExtractor) *TypedActorExtractorMap

func (*TypedActorExtractorMap) Allow

func (t *TypedActorExtractorMap) Allow(code cid.Cid) bool

func (*TypedActorExtractorMap) GetExtractors added in v0.9.0

func (t *TypedActorExtractorMap) GetExtractors(code cid.Cid) ([]ActorStateExtractor, bool)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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