Documentation ¶
Index ¶
- Constants
- Variables
- func Copy(from, to blockstore.Blockstore, root cid.Cid) error
- func DecodeParams(b []byte, out interface{}) error
- func DumpActorState(code cid.Cid, b []byte) (interface{}, error)
- func NewBLSAccountActor() *types.Actor
- func NewSecp256k1AccountActor() *types.Actor
- func ResolveToKeyAddr(state types.StateTree, cst cbor.IpldStore, addr address.Address) (address.Address, aerrors.ActorError)
- func Syscalls(verifier ffiwrapper.Verifier) runtime.Syscalls
- func TryCreateAccountActor(rt *Runtime, addr address.Address) (*types.Actor, aerrors.ActorError)
- type ApplyRet
- type GasCharge
- type Invokee
- type Invoker
- type Pricelist
- type Rand
- type Runtime
- func (rt *Runtime) AbortStateMsg(msg string)
- func (rt *Runtime) Abortf(code exitcode.ExitCode, msg string, args ...interface{})
- func (rt *Runtime) ChargeGas(name string, compute int64, virtual int64)
- func (rt *Runtime) Context() context.Context
- func (rt *Runtime) CreateActor(codeID cid.Cid, address address.Address)
- func (rt *Runtime) CurrEpoch() abi.ChainEpoch
- func (rt *Runtime) CurrentBalance() abi.TokenAmount
- func (rt *Runtime) DeleteActor(addr address.Address)
- func (rt *Runtime) Get(c cid.Cid, o vmr.CBORUnmarshaler) bool
- func (rt *Runtime) GetActorCodeCID(addr address.Address) (ret cid.Cid, ok bool)
- func (rt *Runtime) GetBalance(a address.Address) (types.BigInt, aerrors.ActorError)
- func (rt *Runtime) GetRandomness(personalization crypto.DomainSeparationTag, randEpoch abi.ChainEpoch, ...) abi.Randomness
- func (rt *Runtime) Message() vmr.Message
- func (rt *Runtime) NewActorAddress() address.Address
- func (rt *Runtime) Pricelist() Pricelist
- func (rt *Runtime) Put(x vmr.CBORMarshaler) cid.Cid
- func (rt *Runtime) ResolveAddress(addr address.Address) (ret address.Address, ok bool)
- func (rt *Runtime) Send(to address.Address, method abi.MethodNum, m vmr.CBORMarshaler, ...) (vmr.SendReturn, exitcode.ExitCode)
- func (rt *Runtime) StartSpan(name string) vmr.TraceSpan
- func (rt *Runtime) State() vmr.StateHandle
- func (rt *Runtime) Store() vmr.Store
- func (rt *Runtime) Syscalls() vmr.Syscalls
- func (rt *Runtime) TotalFilCircSupply() abi.TokenAmount
- func (rt *Runtime) ValidateImmediateCallerAcceptAny()
- func (rt *Runtime) ValidateImmediateCallerIs(as ...address.Address)
- func (rt *Runtime) ValidateImmediateCallerType(ts ...cid.Cid)
- type VM
- func (vm *VM) ActorBalance(addr address.Address) (types.BigInt, aerrors.ActorError)
- func (vm *VM) ApplyImplicitMessage(ctx context.Context, msg *types.Message) (*ApplyRet, error)
- func (vm *VM) ApplyMessage(ctx context.Context, cmsg types.ChainMsg) (*ApplyRet, error)
- func (vm *VM) Flush(ctx context.Context) (cid.Cid, error)
- func (vm *VM) Invoke(act *types.Actor, rt *Runtime, method abi.MethodNum, params []byte) ([]byte, aerrors.ActorError)
- func (vm *VM) MutateState(ctx context.Context, addr address.Address, fn interface{}) error
- func (vm *VM) SetBlockHeight(h abi.ChainEpoch)
- func (vm *VM) SetInvoker(i *Invoker)
- func (vm *VM) StateTree() types.StateTree
Constants ¶
View Source
const ( GasStorageMulti = 1 GasComputeMulti = 1 )
Variables ¶
View Source
var BatchSealVerifyParallelism = goruntime.NumCPU()
View Source
var EmptyObjectCid cid.Cid
Functions ¶
func Copy ¶
func Copy(from, to blockstore.Blockstore, root cid.Cid) error
func DecodeParams ¶
func DumpActorState ¶
func NewBLSAccountActor ¶
func ResolveToKeyAddr ¶
func ResolveToKeyAddr(state types.StateTree, cst cbor.IpldStore, addr address.Address) (address.Address, aerrors.ActorError)
ResolveToKeyAddr returns the public key type of address (`BLS`/`SECP256K1`) of an account actor identified by `addr`.
func TryCreateAccountActor ¶
func TryCreateAccountActor(rt *Runtime, addr address.Address) (*types.Actor, aerrors.ActorError)
TryCreateAccountActor creates account actors from only BLS/SECP256K1 addresses.
Types ¶
type ApplyRet ¶
type ApplyRet struct { types.MessageReceipt ActorErr aerrors.ActorError Penalty types.BigInt ExecutionTrace types.ExecutionTrace Duration time.Duration }
type GasCharge ¶ added in v0.4.0
type GasCharge struct { Name string Extra interface{} ComputeGas int64 StorageGas int64 VirtualCompute int64 VirtualStorage int64 }
func (GasCharge) WithVirtual ¶ added in v0.4.0
type Invoker ¶ added in v0.3.1
type Invoker struct {
// contains filtered or unexported fields
}
func NewInvoker ¶ added in v0.2.8
func NewInvoker() *Invoker
type Pricelist ¶ added in v0.3.0
type Pricelist interface { // OnChainMessage returns the gas used for storing a message of a given size in the chain. OnChainMessage(msgSize int) GasCharge // OnChainReturnValue returns the gas used for storing the response of a message in the chain. OnChainReturnValue(dataSize int) GasCharge // OnMethodInvocation returns the gas used when invoking a method. OnMethodInvocation(value abi.TokenAmount, methodNum abi.MethodNum) GasCharge // OnIpldGet returns the gas used for storing an object OnIpldGet(dataSize int) GasCharge // OnIpldPut returns the gas used for storing an object OnIpldPut(dataSize int) GasCharge // OnCreateActor returns the gas used for creating an actor OnCreateActor() GasCharge // OnDeleteActor returns the gas used for deleting an actor OnDeleteActor() GasCharge OnVerifySignature(sigType crypto.SigType, planTextSize int) (GasCharge, error) OnHashing(dataSize int) GasCharge OnComputeUnsealedSectorCid(proofType abi.RegisteredSealProof, pieces []abi.PieceInfo) GasCharge OnVerifySeal(info abi.SealVerifyInfo) GasCharge OnVerifyPost(info abi.WindowPoStVerifyInfo) GasCharge OnVerifyConsensusFault() GasCharge }
Pricelist provides prices for operations in the VM.
Note: this interface should be APPEND ONLY since last chain checkpoint
func PricelistByEpoch ¶ added in v0.3.0
func PricelistByEpoch(epoch abi.ChainEpoch) Pricelist
PricelistByEpoch finds the latest prices for the given epoch
type Rand ¶
type Rand interface {
GetRandomness(ctx context.Context, pers crypto.DomainSeparationTag, round abi.ChainEpoch, entropy []byte) ([]byte, error)
}
type Runtime ¶ added in v0.3.0
type Runtime struct {
// contains filtered or unexported fields
}
func (*Runtime) AbortStateMsg ¶ added in v0.3.0
func (*Runtime) CreateActor ¶ added in v0.3.0
func (rt *Runtime) CreateActor(codeID cid.Cid, address address.Address)
func (*Runtime) CurrEpoch ¶ added in v0.3.0
func (rt *Runtime) CurrEpoch() abi.ChainEpoch
func (*Runtime) CurrentBalance ¶ added in v0.3.0
func (rt *Runtime) CurrentBalance() abi.TokenAmount
func (*Runtime) DeleteActor ¶ added in v0.3.0
func (rt *Runtime) DeleteActor(addr address.Address)
func (*Runtime) GetActorCodeCID ¶ added in v0.3.0
func (*Runtime) GetBalance ¶ added in v0.3.0
func (rt *Runtime) GetBalance(a address.Address) (types.BigInt, aerrors.ActorError)
func (*Runtime) GetRandomness ¶ added in v0.3.0
func (rt *Runtime) GetRandomness(personalization crypto.DomainSeparationTag, randEpoch abi.ChainEpoch, entropy []byte) abi.Randomness
func (*Runtime) NewActorAddress ¶ added in v0.3.0
func (rt *Runtime) NewActorAddress() address.Address
func (*Runtime) Put ¶ added in v0.3.0
func (rt *Runtime) Put(x vmr.CBORMarshaler) cid.Cid
func (*Runtime) ResolveAddress ¶ added in v0.3.0
func (*Runtime) Send ¶ added in v0.3.0
func (rt *Runtime) Send(to address.Address, method abi.MethodNum, m vmr.CBORMarshaler, value abi.TokenAmount) (vmr.SendReturn, exitcode.ExitCode)
func (*Runtime) State ¶ added in v0.3.0
func (rt *Runtime) State() vmr.StateHandle
func (*Runtime) TotalFilCircSupply ¶ added in v0.3.0
func (rt *Runtime) TotalFilCircSupply() abi.TokenAmount
func (*Runtime) ValidateImmediateCallerAcceptAny ¶ added in v0.3.0
func (rt *Runtime) ValidateImmediateCallerAcceptAny()
func (*Runtime) ValidateImmediateCallerIs ¶ added in v0.3.0
func (rt *Runtime) ValidateImmediateCallerIs(as ...address.Address)
func (*Runtime) ValidateImmediateCallerType ¶ added in v0.3.0
func (rt *Runtime) ValidateImmediateCallerType(ts ...cid.Cid)
type VM ¶
func NewVM ¶
func NewVM(base cid.Cid, height abi.ChainEpoch, r Rand, cbs blockstore.Blockstore, syscalls runtime.Syscalls) (*VM, error)
func (*VM) ActorBalance ¶
func (vm *VM) ActorBalance(addr address.Address) (types.BigInt, aerrors.ActorError)
func (*VM) ApplyImplicitMessage ¶ added in v0.3.0
func (*VM) ApplyMessage ¶
func (*VM) MutateState ¶ added in v0.3.0
MutateState usage: MutateState(ctx, idAddr, func(cst cbor.IpldStore, st *ActorStateType) error {...})
func (*VM) SetBlockHeight ¶
func (vm *VM) SetBlockHeight(h abi.ChainEpoch)
func (*VM) SetInvoker ¶ added in v0.2.8
Source Files ¶
Click to show internal directories.
Click to hide internal directories.