Evm_node_lib_dev.Evm_statetype t = Pvm.State.tDirectory where the kernel logs are stored. The function execute below expect the directory to exist.
val execute :
pool:Lwt_domain.pool ->
?execution_timestamp:Tezos_base.TzPervasives.Time.Protocol.t ->
?wasm_pvm_fallback:bool ->
?profile:Evm_node_config.Configuration.profile_mode ->
?kind:Events.kernel_log_kind ->
data_dir:string ->
?log_file:string ->
?wasm_entrypoint:string ->
config:Pvm_types.config ->
native_execution:bool ->
t ->
Wasm_runtime.kernel_input ->
t Tezos_base.TzPervasives.tzresult Lwt.texecute ?execution_timestamp ?simulation ~data_dir ?log_file ~wasm_entrypoint ~config evm_state messages executes the wasm_entrypoint function (default to kernel_run) with messages within the inbox of evm_state.
Kernel logs are stored under the kernel_logs_directory in log_file. simulation adds a prefix to the event to differenciate the logs.
When execution_timestamp is provided it's used as the l1 timestamp of in the Info_per_level message of the inbox, default value is `epoch`.
The execution is performed within a domain managed by pool.
val init : kernel:Pvm_types.kernel -> t Tezos_base.TzPervasives.tzresult Lwt.tinit ~kernel initializes the local evm_state with kernel.
val execute_and_inspect :
pool:Lwt_domain.pool ->
?wasm_pvm_fallback:bool ->
data_dir:string ->
?wasm_entrypoint:string ->
config:Pvm_types.config ->
native_execution_policy:Evm_node_config.Configuration.native_execution_policy ->
input:Simulation.Encodings.simulate_input ->
t ->
bytes option list Tezos_base.TzPervasives.tzresult Lwt.texecute_and_inspect ~pool ~data_dir ?wasm_entrypoint ~config ~input evm_state executes the wasm_entrypoint function (default to kernel_run) with input within the inbox of evm_state, and returns input.insights_requests.
The execution is performed within a domain managed by pool.
val current_block_height :
chain_family:_ Evm_node_lib_dev_encoding.L2_types.chain_family ->
t ->
Evm_node_lib_dev_encoding.Ethereum_types.quantity
Tezos_base.TzPervasives.tzresult
Lwt.tcurrent_block_height ~chain_family evm_state returns the height of the latest block produced by the kernel for chain_family.
val current_block_hash :
chain_family:_ Evm_node_lib_dev_encoding.L2_types.chain_family ->
t ->
Evm_node_lib_dev_encoding.Ethereum_types.block_hash
Tezos_base.TzPervasives.tzresult
Lwt.tSame as current_block_height for the block hash.
val retrieve_block_at_root :
chain_family:_ Evm_node_lib_dev_encoding.L2_types.chain_family ->
root:Durable_storage_path.path ->
t ->
Evm_node_lib_dev_encoding.Ethereum_types.legacy_transaction_object
Evm_node_lib_dev_encoding.L2_types.block
option
Tezos_base.TzPervasives.tzresult
Lwt.tretrieve_block_at_root ~chain_family ~root evm_state reads the current block from durable storage at the given root path, decoding it using chain_family.
type apply_result = | Apply_success of {evm_state : t;block : Evm_node_lib_dev_encoding.Ethereum_types.legacy_transaction_object
Evm_node_lib_dev_encoding.L2_types.block;tezos_block : Evm_node_lib_dev_encoding.L2_types.Tezos_block.t option;}| Apply_failureval apply_unsigned_chunks :
pool:Lwt_domain.pool ->
?wasm_pvm_fallback:bool ->
?log_file:string ->
?profile:Evm_node_config.Configuration.profile_mode ->
data_dir:string ->
chain_family:_ Evm_node_lib_dev_encoding.L2_types.chain_family ->
config:Pvm_types.config ->
native_execution_policy:Evm_node_config.Configuration.native_execution_policy ->
t ->
Sequencer_blueprint.unsigned_chunked_blueprint ->
apply_result Tezos_base.TzPervasives.tzresult Lwt.tapply_unsigned_chunks ~data-dir ~config state chunks applies the blueprint chunks on top of evm_state. If the operation results in the production of a block, the new updated EVM state is returned along with the new block’s height. It is the responsibility of the caller to ensure the correctness of the chunks.
The data-dir is used to store the kernel logs in the kernel_logs_directory.
type block_in_progress = {timestamp : Tezos_base.TzPervasives.Time.Protocol.t;number : Evm_node_lib_dev_encoding.Ethereum_types.quantity;transactions_count : int32;}val execute_single_transaction :
storage_version:int ->
data_dir:string ->
pool:Lwt_domain.pool ->
native_execution:bool ->
config:Pvm_types.config ->
t ->
block_in_progress ->
Evm_node_lib_dev_encoding.Ethereum_types.hash ->
Broadcast.transaction ->
(Evm_node_lib_dev_encoding.L2_types.single_tx_receipt * t)
Tezos_base.TzPervasives.tzresult
Lwt.texecute_single_transaction ~data_dir ~pool ~native_execution ~config evm_state block_in_progress hash txn calls the kernel entrypoint allowing to execute txn on top of evm_state, where txn is the block_in_progress.transactions_countth transaction of the next block.
val execute_entrypoint :
data_dir:string ->
pool:Lwt_domain.pool ->
native_execution_policy:Evm_node_config.Configuration.native_execution_policy ->
config:Pvm_types.config ->
t ->
input_path:string ->
input:bytes ->
output_path:string ->
entrypoint:string ->
bytes Tezos_base.TzPervasives.tzresult Lwt.texecute_entrypoint ~data_dir ~pool ~native_execution ~config evm_state ~input_path ~input ~output_path ~entrypoint writes input to input_path in durable storage, calls the kernel entrypoint, and reads the result bytes from output_path.
val assemble_block :
storage_version:int ->
pool:Lwt_domain.pool ->
data_dir:string ->
chain_family:'a Evm_node_lib_dev_encoding.L2_types.chain_family ->
config:Pvm_types.config ->
timestamp:Tezos_base.TzPervasives.Time.Protocol.t ->
number:Evm_node_lib_dev_encoding.Ethereum_types.quantity ->
native_execution:bool ->
t ->
apply_result Tezos_base.TzPervasives.tzresult Lwt.tassemble_block ~pool ~data_dir ~chain_family ~config ~timestamp ~number ~native_execution t builds an L2 block at height number and timestamp from the transactions previously accumulated in durable storage by the kernel instant-confirmation execution. No blueprint application is (re)performed; the function only assembles the block from already recorded effects and returns the result of this operation.
val flag_local_exec :
t ->
storage_version:int ->
t Tezos_base.TzPervasives.tzresult Lwt.tflag_local_exec evm_state adds a flag telling the kernel it is executed by an EVM node, not a rollup node.
val clear_delayed_inbox : t -> t Tezos_base.TzPervasives.tzresult Lwt.tclear_delayed_inbox evm_state removes the delayed inbox from the current EVM state.
val wasm_pvm_version : t -> Tezos_scoru_wasm.Wasm_pvm_state.version Lwt.tirmin_store_path ~data_dir returns the path wherein the Irmin store is expected to be located, relatively to the data directory.
val preload_kernel : pool:Lwt_domain.pool -> t -> unit Lwt.tpreload_kernel ~pool evm_state ensures the kernel of evm_state is added to the kernel cache of the execution runtime in use. This will speed-up the execution time for the first call of this kernel (typically in the context of a RPC call).
The execution of this command is performed within one of the domain managed by pool.
val get_delayed_inbox_item :
t ->
Evm_node_lib_dev_encoding.Ethereum_types.hash ->
Evm_node_lib_dev_encoding.Evm_events.Delayed_transaction.t
Tezos_base.TzPervasives.tzresult
Lwt.tget_delayed_inbox_item state hash returns the delayed inbox content behind the hash hash. It fails if the hash does not exist or if the value cannot be decoded.
val clear_block_storage :
_ Evm_node_lib_dev_encoding.L2_types.chain_family ->
'transaction_object Evm_node_lib_dev_encoding.L2_types.block ->
t ->
t Tezos_base.TzPervasives.tzresult Lwt.tclear_block_storage chain_family block state removes the parent of block, and all durable storage information stored for block, if this function is called they need to be store elsewhere, mainly it consists in transactions.
val clear_events : t -> t Tezos_base.TzPervasives.tzresult Lwt.tclear_events state will remove events generated by the kernel from the durable storage of state.
val delayed_inbox_hashes :
t ->
Evm_node_lib_dev_encoding.Ethereum_types.hash list
Tezos_base.TzPervasives.tzresult
Lwt.tdelayed_inbox_hashes tree returns a list of hashes—each hash identifying an item of the delayed inbox.
This function will raise an exception if the delayed inbox is nowhere to be found.