package octez-l2-libs
Install
Dune Dependency
Authors
Maintainers
Sources
sha256=c6df840ebbf115e454db949028c595bec558a59a66cade73b52a6d099d6fa4d4
sha512=d8aee903b9fe130d73176bc8ec38b78c9ff65317da3cb4f3415f09af0c625b4384e7498201fdb61aa39086a7d5d409d0ab3423f9bc3ab989a680cf444a79bc13
doc/octez-l2-libs.scoru-wasm-fast/Tezos_scoru_wasm_fast/Vm/index.html
Module Tezos_scoru_wasm_fast.Vm
Source
include Tezos_scoru_wasm.Wasm_vm_sig.S
include Tezos_scoru_wasm.Wasm_vm_sig.Generic
with type state := Tezos_scoru_wasm.Wasm_pvm_state.Internal_state.pvm_state
val compute_step_many :
?reveal_builtins:Tezos_scoru_wasm.Builtins.reveals ->
?write_debug:Tezos_scoru_wasm.Builtins.write_debug ->
?stop_at_snapshot:bool ->
max_steps:int64 ->
Tezos_scoru_wasm.Wasm_pvm_state.Internal_state.pvm_state ->
(Tezos_scoru_wasm.Wasm_pvm_state.Internal_state.pvm_state * int64) Lwt.t
compute_step_many ~max_steps pvm_state
forwards the VM by at most max_step
compute tick, yielding if it reaches the maximum number of ticks for a toplevel kernel call. If the VM is expecting input, it gets stuck. If the VM is already stuck, this function may raise an exception. It is more efficient than compute_step
if it has to be called for more than one tick, but its resulting pvm_state will be stricly equivalent. Returns a tuple containing the number of executed ticks and the new pvm_state.
val compute_step :
Tezos_scoru_wasm.Wasm_pvm_state.Internal_state.pvm_state ->
Tezos_scoru_wasm.Wasm_pvm_state.Internal_state.pvm_state Lwt.t
compute_step pvm_state
forwards the VM by one compute tick. If the VM is expecting input, it gets stuck. If the VM is already stuck, this function may raise an exception. It is strictly equivalent to compute_step_many ~max_step=1 pvm_state
.
val compute_step_with_debug :
write_debug:Tezos_scoru_wasm.Builtins.write_debug ->
Tezos_scoru_wasm.Wasm_pvm_state.Internal_state.pvm_state ->
Tezos_scoru_wasm.Wasm_pvm_state.Internal_state.pvm_state Lwt.t
compute_step_with_debug ~debug_flag pvm_state
is exactly compute_step
but it has the ability to enable the debugging host functions.
val set_input_step :
Tezos_scoru_wasm.Wasm_pvm_state.input_info ->
string ->
Tezos_scoru_wasm.Wasm_pvm_state.Internal_state.pvm_state ->
Tezos_scoru_wasm.Wasm_pvm_state.Internal_state.pvm_state Lwt.t
set_input_step input_info message pvm_state
forwards the VM by one input tick. If the VM is not expecting input, it gets stuck. If the VM is already stuck, this function may raise an exception. Note at this point the function raises an exception if the VM is not expecting input.
val reveal_step :
bytes ->
Tezos_scoru_wasm.Wasm_pvm_state.Internal_state.pvm_state ->
Tezos_scoru_wasm.Wasm_pvm_state.Internal_state.pvm_state Lwt.t
reveal_step reveal_data pvm_state
loads the reveal_data
in the memory of module of the currently executed function.
If the VM does not expect any reveal data, this function raises an exception.
val get_info :
Tezos_scoru_wasm.Wasm_pvm_state.Internal_state.pvm_state ->
Tezos_scoru_wasm.Wasm_pvm_state.info Lwt.t
get_info pvm_state
provides a typed view of the current machine state. Should not raise.
val get_wasm_version :
Tezos_scoru_wasm.Wasm_pvm_state.Internal_state.pvm_state ->
Tezos_scoru_wasm.Wasm_pvm_state.version Lwt.t
get_wasm_version pvm_state
returns the current version at which the WASM PVM operates.
val compute_step_many_until :
?max_steps:int64 ->
?reveal_builtins:Tezos_scoru_wasm.Builtins.reveals ->
?write_debug:Tezos_scoru_wasm.Builtins.write_debug ->
(Tezos_scoru_wasm.Wasm_pvm_state.Internal_state.pvm_state -> bool Lwt.t) ->
Tezos_scoru_wasm.Wasm_pvm_state.Internal_state.pvm_state ->
(Tezos_scoru_wasm.Wasm_pvm_state.Internal_state.pvm_state * int64) Lwt.t
compute_step_many_until max_steps reveal_builtins write_debug should_continue pvm_state
advances forwards the VM in the same manners as compute_step_many
as long as should_continue
returns true.
Returns the new state and number of the executed ticks.
IS applied on pvm_state
rather than a tree.
/!\ as it allows to redefine the stop condition, this function should not be used in unit test: the test could hide regression if the condition change in the code, but not in the test.
val get_output :
Tezos_scoru_wasm.Wasm_pvm_state.output_info ->
Tezos_webassembly_interpreter.Output_buffer.t ->
string Lwt.t
get_output output buffer
returns the payload associated with the given output. The result is meant to be deserialized using Sc_rollup_PVM_sem.output_encoding
. Raises an exception if the output is not present.