statemanger

package
v1.15.1 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2024 License: Apache-2.0, MIT Imports: 32 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ComputeState added in v1.10.1

func ComputeState(ctx context.Context, s *Stmgr, height abi.ChainEpoch, msgs []*types.Message, ts *types.TipSet) (cid.Cid, []*types.InvocResult, error)

func MakeMsgGasCost added in v1.10.0

func MakeMsgGasCost(msg *types.Message, ret *vm.Ret) types.MsgGasCost

Types

type IStateManager

type IStateManager interface {
	ResolveToDeterministicAddress(ctx context.Context, addr address.Address, ts *types.TipSet) (address.Address, error)
	GetPaychState(ctx context.Context, addr address.Address, ts *types.TipSet) (*types.Actor, paych.State, error)
	Call(ctx context.Context, msg *types.Message, ts *types.TipSet) (*types.InvocResult, error)
	GetMarketState(ctx context.Context, ts *types.TipSet) (market.State, error)
}

stateManagerAPI defines the methods needed from StateManager todo remove this code and add private interface in market and paychanel package

type Stmgr added in v1.2.0

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

func NewStateManager added in v1.13.0

func NewStateManager(cs *chain.Store,
	ms *chain.MessageStore,
	cp consensus.StateTransformer,
	beacon beacon.Schedule,
	fork fork.IFork,
	gasSchedule *gas.PricesSchedule,
	syscallsImpl vm.SyscallsImpl,
	actorDebugging bool,
) (*Stmgr, error)

func (*Stmgr) Call added in v1.2.0

func (s *Stmgr) Call(ctx context.Context, msg *types.Message, ts *types.TipSet) (*types.InvocResult, error)

Call applies the given message to the given tipset's parent state, at the epoch following the tipset's parent. In the presence of null blocks, the height at which the message is invoked may be less than the specified tipset.

func (*Stmgr) CallAtStateAndVersion added in v1.10.0

func (s *Stmgr) CallAtStateAndVersion(ctx context.Context, msg *types.Message, stateCid cid.Cid, v network.Version) (*types.InvocResult, error)

CallAtStateAndVersion allows you to specify a message to execute on the given stateCid and network version. This should mostly be used for gas modelling on a migrated state. Tipset here is not needed because stateCid and network version fully describe execution we want. The internal function will get the heaviest tipset for use for things like basefee, which we don't really care about here.

func (*Stmgr) CallWithGas added in v1.2.0

func (s *Stmgr) CallWithGas(ctx context.Context, msg *types.Message, priorMsgs []types.ChainMsg, ts *types.TipSet, applyTSMessages bool) (*types.InvocResult, error)

CallWithGas calculates the state for a given tipset, and then applies the given message on top of that state.

func (*Stmgr) Close added in v1.2.0

func (s *Stmgr) Close(ctx context.Context)

func (*Stmgr) ExecutionTrace added in v1.10.1

func (s *Stmgr) ExecutionTrace(ctx context.Context, ts *types.TipSet) (cid.Cid, []*types.InvocResult, error)

func (*Stmgr) FlushChainHead added in v1.2.0

func (s *Stmgr) FlushChainHead() (*types.TipSet, error)

func (*Stmgr) GetActorAt added in v1.2.0

func (s *Stmgr) GetActorAt(ctx context.Context, addr address.Address, ts *types.TipSet) (*types.Actor, error)

func (*Stmgr) GetActorAtTsk added in v1.2.0

func (s *Stmgr) GetActorAtTsk(ctx context.Context, addr address.Address, tsk types.TipSetKey) (*types.Actor, error)

ctx context.Context, ts *types.TipSet, addr address.Address

func (*Stmgr) GetMarketState added in v1.2.0

func (s *Stmgr) GetMarketState(ctx context.Context, ts *types.TipSet) (market.State, error)

func (*Stmgr) GetNetworkVersion added in v1.6.0

func (s *Stmgr) GetNetworkVersion(ctx context.Context, h abi.ChainEpoch) network.Version

func (*Stmgr) GetPaychState added in v1.2.0

func (s *Stmgr) GetPaychState(ctx context.Context, addr address.Address, ts *types.TipSet) (*types.Actor, paych.State, error)

func (*Stmgr) ParentState added in v1.2.0

func (s *Stmgr) ParentState(ctx context.Context, ts *types.TipSet) (*types.TipSet, *tree.State, error)

func (*Stmgr) ParentStateTsk added in v1.2.0

func (s *Stmgr) ParentStateTsk(ctx context.Context, tsk types.TipSetKey) (*types.TipSet, *tree.State, error)

func (*Stmgr) ParentStateView added in v1.2.0

func (s *Stmgr) ParentStateView(ctx context.Context, ts *types.TipSet) (*types.TipSet, *appstate.View, error)

func (*Stmgr) ParentStateViewTsk added in v1.2.0

func (s *Stmgr) ParentStateViewTsk(ctx context.Context, tsk types.TipSetKey) (*types.TipSet, *appstate.View, error)

func (*Stmgr) Replay added in v1.10.0

func (s *Stmgr) Replay(ctx context.Context, ts *types.TipSet, msgCID cid.Cid) (*types.Message, *vm.Ret, error)

func (*Stmgr) ResolveToDeterministicAddress added in v1.10.0

func (s *Stmgr) ResolveToDeterministicAddress(ctx context.Context, addr address.Address, ts *types.TipSet) (address.Address, error)

func (*Stmgr) Rollback added in v1.2.0

func (s *Stmgr) Rollback(ctx context.Context, pts, cts *types.TipSet) error

deprecated: this implementation needs more considerations

func (*Stmgr) RunStateTransition added in v1.2.0

func (s *Stmgr) RunStateTransition(ctx context.Context, ts *types.TipSet, cb vm.ExecCallBack, vmTracing bool) (root cid.Cid, receipts cid.Cid, err error)

func (*Stmgr) RunStateTransitionV2 added in v1.2.0

func (s *Stmgr) RunStateTransitionV2(ctx context.Context, ts *types.TipSet) (cid.Cid, cid.Cid, error)

deprecated: in future use.

func (*Stmgr) StateView added in v1.2.0

func (s *Stmgr) StateView(ctx context.Context, ts *types.TipSet) (cid.Cid, *appstate.View, error)

func (*Stmgr) StateViewTsk added in v1.2.0

func (s *Stmgr) StateViewTsk(ctx context.Context, tsk types.TipSetKey) (*types.TipSet, cid.Cid, *appstate.View, error)

func (*Stmgr) TipsetState added in v1.2.0

func (s *Stmgr) TipsetState(ctx context.Context, ts *types.TipSet) (*tree.State, error)

func (*Stmgr) TipsetStateTsk added in v1.2.0

func (s *Stmgr) TipsetStateTsk(ctx context.Context, tsk types.TipSetKey) (*types.TipSet, *tree.State, error)

Jump to

Keyboard shortcuts

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