Documentation ¶
Index ¶
- Constants
- Variables
- func ComputeGasOverestimationBurn(gasUsed, gasLimit int64) (int64, int64)
- func Copy(ctx context.Context, from, to blockstore.Blockstore, root cid.Cid) error
- func DecodeParams(b []byte, out interface{}) error
- func DumpActorState(i *ActorRegistry, act *types.Actor, b []byte) (interface{}, error)
- func ResolveToKeyAddr(state types.StateTree, cst cbor.IpldStore, addr address.Address) (address.Address, error)
- func TryCreateAccountActor(rt *Runtime, addr address.Address) (*types.Actor, address.Address, aerrors.ActorError)
- type ActorPredicate
- type ActorRegistry
- func (ar *ActorRegistry) Create(codeCid cid.Cid, rt vmr.Runtime) (*types.Actor, aerrors.ActorError)
- func (ar *ActorRegistry) Invoke(codeCid cid.Cid, rt vmr.Runtime, method abi.MethodNum, params []byte) ([]byte, aerrors.ActorError)
- func (ar *ActorRegistry) Register(pred ActorPredicate, actors ...rtt.VMActor)
- type ApplyRet
- type CircSupplyCalculator
- type FVM
- type FvmExecutionTrace
- type FvmExtern
- type GasCharge
- type GasOutputs
- type Interface
- type LegacyVM
- func (vm *LegacyVM) ActorStore(ctx context.Context) adt.Store
- func (vm *LegacyVM) ApplyImplicitMessage(ctx context.Context, msg *types.Message) (*ApplyRet, error)
- func (vm *LegacyVM) ApplyMessage(ctx context.Context, cmsg types.ChainMsg) (*ApplyRet, error)
- func (vm *LegacyVM) Flush(ctx context.Context) (cid.Cid, error)
- func (vm *LegacyVM) GetCircSupply(ctx context.Context) (abi.TokenAmount, error)
- func (vm *LegacyVM) Invoke(act *types.Actor, rt *Runtime, method abi.MethodNum, params []byte) ([]byte, aerrors.ActorError)
- func (vm *LegacyVM) SetInvoker(i *ActorRegistry)
- func (vm *LegacyVM) ShouldBurn(ctx context.Context, st *state.StateTree, msg *types.Message, ...) (bool, error)
- func (vm *LegacyVM) StateTree() types.StateTree
- type LookbackStateGetter
- type Message
- type MethodMeta
- type NtwkVersionGetter
- 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) BaseFee() abi.TokenAmount
- func (rt *Runtime) ChargeGas(name string, compute int64, virtual int64)
- func (rt *Runtime) Context() context.Context
- func (rt *Runtime) CreateActor(codeID cid.Cid, addr address.Address)
- func (rt *Runtime) CurrEpoch() abi.ChainEpoch
- func (rt *Runtime) CurrentBalance() abi.TokenAmount
- func (rt *Runtime) DeleteActor(beneficiary address.Address)
- 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) GetRandomnessFromBeacon(personalization crypto.DomainSeparationTag, randEpoch abi.ChainEpoch, ...) abi.Randomness
- func (rt *Runtime) GetRandomnessFromTickets(personalization crypto.DomainSeparationTag, randEpoch abi.ChainEpoch, ...) abi.Randomness
- func (rt *Runtime) Log(level rtt.LogLevel, msg string, args ...interface{})
- func (rt *Runtime) NetworkVersion() network.Version
- func (rt *Runtime) NewActorAddress() address.Address
- func (rt *Runtime) Pricelist() Pricelist
- func (rt *Runtime) ResolveAddress(addr address.Address) (ret address.Address, ok bool)
- func (rt *Runtime) Send(to address.Address, method abi.MethodNum, m cbor.Marshaler, ...) exitcode.ExitCode
- func (rt *Runtime) StartSpan(name string) func()
- func (rt *Runtime) StateCreate(obj cbor.Marshaler)
- func (rt *Runtime) StateReadonly(obj cbor.Unmarshaler)
- func (rt *Runtime) StateTransaction(obj cbor.Er, f func())
- func (rt *Runtime) StoreGet(c cid.Cid, o cbor.Unmarshaler) bool
- func (rt *Runtime) StorePut(x cbor.Marshaler) cid.Cid
- 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 SyscallBuilder
- type UnsafeVM
- type VMOpts
Constants ¶
const MaxCallDepth = 4096
Variables ¶
var ( StatSends uint64 StatApplied uint64 )
stat counters
var BatchSealVerifyParallelism = goruntime.NumCPU()
var EmptyObjectCid cid.Cid
var EnableDetailedTracing = os.Getenv("LOTUS_VM_ENABLE_GAS_TRACING_VERY_SLOW") == "1"
EnableDetailedTracing, if true, outputs gas tracing in execution traces.
Functions ¶
func ComputeGasOverestimationBurn ¶ added in v0.5.0
ComputeGasOverestimationBurn computes amount of gas to be refunded and amount of gas to be burned Result is (refund, burn)
func Copy ¶
func Copy(ctx context.Context, from, to blockstore.Blockstore, root cid.Cid) error
func DecodeParams ¶
func DumpActorState ¶
func DumpActorState(i *ActorRegistry, act *types.Actor, b []byte) (interface{}, error)
func ResolveToKeyAddr ¶
func ResolveToKeyAddr(state types.StateTree, cst cbor.IpldStore, addr address.Address) (address.Address, error)
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, address.Address, aerrors.ActorError)
TryCreateAccountActor creates account actors from only BLS/SECP256K1 addresses.
Types ¶
type ActorPredicate ¶ added in v0.9.0
An ActorPredicate returns an error if the given actor is not valid for the given runtime environment (e.g., chain height, version, etc.).
func ActorsVersionPredicate ¶ added in v0.9.0
func ActorsVersionPredicate(ver actors.Version) ActorPredicate
type ActorRegistry ¶ added in v0.9.0
type ActorRegistry struct { Methods map[cid.Cid]map[abi.MethodNum]MethodMeta // contains filtered or unexported fields }
func NewActorRegistry ¶ added in v0.9.0
func NewActorRegistry() *ActorRegistry
func (*ActorRegistry) Create ¶ added in v0.9.0
func (ar *ActorRegistry) Create(codeCid cid.Cid, rt vmr.Runtime) (*types.Actor, aerrors.ActorError)
func (*ActorRegistry) Invoke ¶ added in v0.9.0
func (ar *ActorRegistry) Invoke(codeCid cid.Cid, rt vmr.Runtime, method abi.MethodNum, params []byte) ([]byte, aerrors.ActorError)
func (*ActorRegistry) Register ¶ added in v0.9.0
func (ar *ActorRegistry) Register(pred ActorPredicate, actors ...rtt.VMActor)
type ApplyRet ¶
type ApplyRet struct { types.MessageReceipt ActorErr aerrors.ActorError ExecutionTrace types.ExecutionTrace Duration time.Duration GasCosts *GasOutputs }
type CircSupplyCalculator ¶ added in v0.5.0
type CircSupplyCalculator func(context.Context, abi.ChainEpoch, *state.StateTree) (abi.TokenAmount, error)
type FVM ¶ added in v1.15.1
type FVM struct {
// contains filtered or unexported fields
}
func (*FVM) ApplyImplicitMessage ¶ added in v1.15.1
func (*FVM) ApplyMessage ¶ added in v1.15.1
type FvmExecutionTrace ¶ added in v1.15.3
type FvmExecutionTrace struct { Msg *types.Message MsgRct *types.MessageReceipt Error string Subcalls []FvmExecutionTrace }
This may eventually become identical to ExecutionTrace, but we can make incremental progress towards that
func (*FvmExecutionTrace) MarshalCBOR ¶ added in v1.15.3
func (t *FvmExecutionTrace) MarshalCBOR(w io.Writer) error
func (*FvmExecutionTrace) ToExecutionTrace ¶ added in v1.15.3
func (t *FvmExecutionTrace) ToExecutionTrace() types.ExecutionTrace
func (*FvmExecutionTrace) UnmarshalCBOR ¶ added in v1.15.3
func (t *FvmExecutionTrace) UnmarshalCBOR(r io.Reader) error
type FvmExtern ¶ added in v1.15.1
type FvmExtern struct { Rand blockstore.Blockstore // contains filtered or unexported fields }
func (*FvmExtern) VerifyBlockSig ¶ added in v1.15.1
func (*FvmExtern) VerifyConsensusFault ¶ added in v1.15.1
func (x *FvmExtern) VerifyConsensusFault(ctx context.Context, a, b, extra []byte) (*ffi_cgo.ConsensusFault, int64)
VerifyConsensusFault is similar to the one in syscalls.go used by the Lotus VM, except it never errors Errors are logged and "no fault" is returned, which is functionally what go-actors does anyway
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 GasOutputs ¶ added in v0.5.0
type GasOutputs struct { BaseFeeBurn abi.TokenAmount OverEstimationBurn abi.TokenAmount MinerPenalty abi.TokenAmount MinerTip abi.TokenAmount Refund abi.TokenAmount GasRefund int64 GasBurned int64 }
func ComputeGasOutputs ¶ added in v0.5.0
func ComputeGasOutputs(gasUsed, gasLimit int64, baseFee, feeCap, gasPremium abi.TokenAmount, chargeNetworkFee bool) GasOutputs
func ZeroGasOutputs ¶ added in v0.7.1
func ZeroGasOutputs() GasOutputs
ZeroGasOutputs returns a logically zeroed GasOutputs.
type Interface ¶ added in v1.15.1
type Interface interface { // Applies the given message onto the VM's current state, returning the result of the execution ApplyMessage(ctx context.Context, cmsg types.ChainMsg) (*ApplyRet, error) // Same as above but for system messages (the Cron invocation and block reward payments). // Must NEVER fail. ApplyImplicitMessage(ctx context.Context, msg *types.Message) (*ApplyRet, error) // Flush all buffered objects into the state store provided to the VM at construction. Flush(ctx context.Context) (cid.Cid, error) }
type LegacyVM ¶ added in v1.15.1
type LegacyVM struct { Syscalls SyscallBuilder // contains filtered or unexported fields }
func NewLegacyVM ¶ added in v1.15.1
func (*LegacyVM) ActorStore ¶ added in v1.15.1
Get the buffered blockstore associated with the LegacyVM. This includes any temporary blocks produced during this LegacyVM's execution.
func (*LegacyVM) ApplyImplicitMessage ¶ added in v1.15.1
func (*LegacyVM) ApplyMessage ¶ added in v1.15.1
func (*LegacyVM) GetCircSupply ¶ added in v1.15.1
func (*LegacyVM) SetInvoker ¶ added in v1.15.1
func (vm *LegacyVM) SetInvoker(i *ActorRegistry)
func (*LegacyVM) ShouldBurn ¶ added in v1.15.1
type LookbackStateGetter ¶ added in v1.1.2
type Message ¶ added in v0.9.0
type Message struct {
// contains filtered or unexported fields
}
func (*Message) ValueReceived ¶ added in v0.9.0
func (m *Message) ValueReceived() abi.TokenAmount
type MethodMeta ¶ added in v1.11.3
type NtwkVersionGetter ¶ added in v0.6.0
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() 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 proof7.SealVerifyInfo) GasCharge OnVerifyAggregateSeals(aggregate proof7.AggregateSealVerifyProofAndInfos) GasCharge OnVerifyReplicaUpdate(update proof7.ReplicaUpdateInfo) GasCharge OnVerifyPost(info proof7.WindowPoStVerifyInfo) GasCharge OnVerifyConsensusFault() GasCharge }
Pricelist provides prices for operations in the LegacyVM.
Note: this interface should be APPEND ONLY since last chain checkpoint
func PricelistByEpochAndNetworkVersion ¶ added in v1.15.2
func PricelistByEpochAndNetworkVersion(epoch abi.ChainEpoch, nv network.Version) Pricelist
PricelistByEpochAndNetworkVersion finds the latest prices for the given epoch
type Rand ¶
type Rand interface { GetChainRandomness(ctx context.Context, pers crypto.DomainSeparationTag, round abi.ChainEpoch, entropy []byte) ([]byte, error) GetBeaconRandomness(ctx context.Context, pers crypto.DomainSeparationTag, round abi.ChainEpoch, entropy []byte) ([]byte, error) }
type Runtime ¶ added in v0.3.0
func (*Runtime) AbortStateMsg ¶ added in v0.3.0
func (*Runtime) BaseFee ¶ added in v1.10.0
func (rt *Runtime) BaseFee() abi.TokenAmount
func (*Runtime) CreateActor ¶ added in v0.3.0
func (rt *Runtime) CreateActor(codeID cid.Cid, addr 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(beneficiary address.Address)
DeleteActor deletes the executing actor from the state tree, transferring any balance to beneficiary. Aborts if the beneficiary does not exist or is the calling actor. May only be called by the actor itself.
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) GetRandomnessFromBeacon ¶ added in v0.5.0
func (rt *Runtime) GetRandomnessFromBeacon(personalization crypto.DomainSeparationTag, randEpoch abi.ChainEpoch, entropy []byte) abi.Randomness
func (*Runtime) GetRandomnessFromTickets ¶ added in v0.5.0
func (rt *Runtime) GetRandomnessFromTickets(personalization crypto.DomainSeparationTag, randEpoch abi.ChainEpoch, entropy []byte) abi.Randomness
func (*Runtime) NetworkVersion ¶ added in v0.6.0
func (*Runtime) NewActorAddress ¶ added in v0.3.0
func (rt *Runtime) NewActorAddress() address.Address
func (*Runtime) ResolveAddress ¶ added in v0.3.0
func (*Runtime) StateCreate ¶ added in v0.7.1
func (*Runtime) StateReadonly ¶ added in v0.7.1
func (rt *Runtime) StateReadonly(obj cbor.Unmarshaler)
func (*Runtime) StateTransaction ¶ added in v0.7.1
func (*Runtime) StoreGet ¶ added in v0.7.1
func (rt *Runtime) StoreGet(c cid.Cid, o cbor.Unmarshaler) bool
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 SyscallBuilder ¶ added in v0.5.0
func Syscalls ¶ added in v0.2.1
func Syscalls(verifier ffiwrapper.Verifier) SyscallBuilder
type VMOpts ¶ added in v0.5.0
type VMOpts struct { StateBase cid.Cid Epoch abi.ChainEpoch Rand Rand Bstore blockstore.Blockstore Actors *ActorRegistry Syscalls SyscallBuilder CircSupplyCalc CircSupplyCalculator // Amount of FIL vested from genesis actors. FilVested abi.TokenAmount NetworkVersion network.Version BaseFee abi.TokenAmount LookbackState LookbackStateGetter }