actorstate

package
v0.7.7 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2021 License: Apache-2.0, MIT Imports: 43 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractChainPower added in v0.3.0

func ExtractChainPower(ec *PowerStateExtractionContext) (*powermodel.ChainPower, error)

func ExtractClaimedPower added in v0.3.0

func ExtractMarketDealProposals added in v0.6.0

func ExtractMarketDealProposals(ctx context.Context, ec *MarketStateExtractionContext) (marketmodel.MarketDealProposals, error)

func ExtractMarketDealStates added in v0.6.0

func ExtractMinerCurrentDeadlineInfo added in v0.3.0

func ExtractMinerCurrentDeadlineInfo(ctx context.Context, a ActorInfo, ec *MinerStateExtractionContext) (*minermodel.MinerCurrentDeadlineInfo, error)

func ExtractMinerFeeDebt added in v0.3.0

func ExtractMinerInfo added in v0.3.0

func ExtractMinerLockedFunds added in v0.3.0

func ExtractMinerLockedFunds(ctx context.Context, a ActorInfo, ec *MinerStateExtractionContext) (*minermodel.MinerLockedFund, error)

func ExtractMinerPoSts added in v0.3.0

func ExtractMultisigTransactions added in v0.4.0

func ExtractMultisigTransactions(ctx context.Context, a ActorInfo, ec *MsigExtractionContext) (multisigmodel.MultisigTransactionList, error)

func Register

func Register(code cid.Cid, e ActorStateExtractor)

Register adds an actor state extractor

Types

type AccountExtractor added in v0.4.0

type AccountExtractor struct{}

AccountExtractor is a state extractor that deals with Account actors.

func (AccountExtractor) Extract added in v0.4.0

Extract will create persistable data for a given actor's state.

type ActorExtractor

type ActorExtractor struct{}

ActorExtractor extracts common actor state

func (ActorExtractor) Extract

type ActorExtractorFilter added in v0.5.3

type ActorExtractorFilter interface {
	AllowAddress(addr string) bool
}

type ActorExtractorMap added in v0.5.3

type ActorExtractorMap interface {
	Allow(code cid.Cid) bool
	GetExtractor(code cid.Cid) (ActorStateExtractor, bool)
}

An ActorExtractorMap controls which actor types may be extracted.

type ActorInfo

type ActorInfo struct {
	Actor           types.Actor
	ChangeType      lens.ChangeType
	Address         address.Address
	ParentStateRoot cid.Cid
	Epoch           abi.ChainEpoch
	TipSet          *types.TipSet
	ParentTipSet    *types.TipSet
}

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
	StateGetActor(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
	StateMinerPower(ctx context.Context, addr address.Address, tsk types.TipSetKey) (*api.MinerPower, error)

	// TODO(optimize): StateReadState looks up the tipset and actor that we already have available
	StateReadState(ctx context.Context, addr address.Address, tsk types.TipSetKey) (*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
}

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

type ActorStateError added in v0.5.3

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

type ActorStateExtractor

type ActorStateExtractor interface {
	Extract(ctx context.Context, a ActorInfo, emsgs []*lens.ExecutedMessage, node ActorStateAPI) (model.Persistable, error)
}

An ActorStateExtractor extracts actor state into a persistable format

func GetActorStateExtractor added in v0.4.0

func GetActorStateExtractor(code cid.Cid) (ActorStateExtractor, bool)

type ActorStateResult added in v0.5.3

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

type InitExtractor

type InitExtractor struct{}

InitExtractor extracts init actor state

func (InitExtractor) Extract

type MarketStateExtractionContext added in v0.6.0

type MarketStateExtractionContext struct {
	PrevState market.State
	PrevTs    *types.TipSet

	CurrActor *types.Actor
	CurrState market.State
	CurrTs    *types.TipSet

	Store adt.Store
}

func NewMarketStateExtractionContext added in v0.6.0

func NewMarketStateExtractionContext(ctx context.Context, a ActorInfo, node ActorStateAPI) (*MarketStateExtractionContext, error)

func (*MarketStateExtractionContext) IsGenesis added in v0.6.0

func (m *MarketStateExtractionContext) IsGenesis() bool

type MinerStateExtractionContext added in v0.3.0

type MinerStateExtractionContext struct {
	PrevState miner.State
	PrevTs    *types.TipSet

	CurrActor *types.Actor
	CurrState miner.State
	CurrTs    *types.TipSet
}

func NewMinerStateExtractionContext added in v0.3.0

func NewMinerStateExtractionContext(ctx context.Context, a ActorInfo, node ActorStateAPI) (*MinerStateExtractionContext, error)

func (*MinerStateExtractionContext) HasPreviousState added in v0.6.0

func (m *MinerStateExtractionContext) HasPreviousState() bool

type MsigExtractionContext added in v0.4.0

type MsigExtractionContext struct {
	PrevState multisig.State

	CurrActor *types.Actor
	CurrState multisig.State
	CurrTs    *types.TipSet

	Store adt.Store
}

func NewMultiSigExtractionContext added in v0.4.0

func NewMultiSigExtractionContext(ctx context.Context, a ActorInfo, node ActorStateAPI) (*MsigExtractionContext, error)

func (*MsigExtractionContext) HasPreviousState added in v0.6.0

func (m *MsigExtractionContext) HasPreviousState() bool

type MultiSigActorExtractor added in v0.4.0

type MultiSigActorExtractor struct{}

func (MultiSigActorExtractor) Extract added in v0.4.0

type PartitionStatus added in v0.3.0

type PartitionStatus struct {
	Removed    bitfield.BitField
	Faulted    bitfield.BitField
	Recovering bitfield.BitField
	Recovered  bitfield.BitField
}

PartitionStatus contains bitfileds of sectorID's that are removed, faulted, recovered and recovering.

type PowerStateExtractionContext added in v0.3.0

type PowerStateExtractionContext struct {
	PrevState power.State
	CurrState power.State
	CurrTs    *types.TipSet

	Store adt.Store
}

func NewPowerStateExtractionContext added in v0.3.0

func NewPowerStateExtractionContext(ctx context.Context, a ActorInfo, node ActorStateAPI) (*PowerStateExtractionContext, error)

func (*PowerStateExtractionContext) HasPreviousState added in v0.6.0

func (p *PowerStateExtractionContext) HasPreviousState() bool

type RawActorExtractorMap added in v0.5.3

type RawActorExtractorMap struct{}

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

func (RawActorExtractorMap) Allow added in v0.5.3

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

func (RawActorExtractorMap) GetExtractor added in v0.5.3

func (RawActorExtractorMap) GetExtractor(code cid.Cid) (ActorStateExtractor, bool)

type RewardExtractor

type RewardExtractor struct{}

RewardExtractor extracts reward actor state

func (RewardExtractor) Extract

type StorageMarketExtractor

type StorageMarketExtractor struct{}

StorageMarketExtractor extracts market actor state

func (StorageMarketExtractor) Extract

type StorageMinerExtractor

type StorageMinerExtractor struct{}

StorageMinerExtractor extracts miner actor state

func (StorageMinerExtractor) Extract

type StoragePowerExtractor

type StoragePowerExtractor struct{}

StoragePowerExtractor extracts power actor state

func (StoragePowerExtractor) Extract

type Task added in v0.5.3

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 added in v0.5.3

func NewTask(opener lens.APIOpener, extracterMap ActorExtractorMap) *Task

func (*Task) Close added in v0.5.3

func (t *Task) Close() error

func (*Task) ProcessActors added in v0.5.3

func (t *Task) ProcessActors(ctx context.Context, ts *types.TipSet, pts *types.TipSet, candidates map[string]lens.ActorStateChange, emsgs []*lens.ExecutedMessage) (model.Persistable, *visormodel.ProcessingReport, error)

type TypedActorExtractorMap added in v0.5.3

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

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

func NewTypedActorExtractorMap added in v0.7.0

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

func (*TypedActorExtractorMap) Allow added in v0.5.3

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

func (*TypedActorExtractorMap) GetExtractor added in v0.5.3

func (t *TypedActorExtractorMap) GetExtractor(code cid.Cid) (ActorStateExtractor, bool)

type VerifiedRegistryExtractionContext added in v0.7.6

type VerifiedRegistryExtractionContext struct {
	PrevState, CurrState verifreg.State
	PrevTs, CurrTs       *types.TipSet

	Store adt.Store
}

func NewVerifiedRegistryExtractorContext added in v0.7.6

func NewVerifiedRegistryExtractorContext(ctx context.Context, a ActorInfo, node ActorStateAPI) (*VerifiedRegistryExtractionContext, error)

func (*VerifiedRegistryExtractionContext) HasPreviousState added in v0.7.6

func (v *VerifiedRegistryExtractionContext) HasPreviousState() bool

type VerifiedRegistryExtractor added in v0.7.6

type VerifiedRegistryExtractor struct{}

func (VerifiedRegistryExtractor) Extract added in v0.7.6

Jump to

Keyboard shortcuts

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