Module Evm_node_lib_dev.Evm_ro_context

type t = {
  1. preimages : string;
  2. preimages_endpoint : Uri.t option;
  3. native_execution_policy : Evm_node_config.Configuration.native_execution_policy;
  4. data_dir : string;
  5. store : Evm_store.t;
  6. smart_rollup_address : Tezos_crypto.Hashed.Smart_rollup_address.t;
  7. index : Pvm.Context.ro_index;
  8. finalized_view : bool;
  9. execution_pool : Lwt_domain.pool;
  10. trace_host_funs : bool;
}

load configuration creates a new read-only handler on the node’s context. You can have as many read-only handlers as you want split over as many processes.

If smart_rollup_address is omitted, the argument is fetched from the store.

If network is set, the function performs additional sanity checks to ensure its local context is consistent with the expected network.

read_chain_family chain_id returns the chain_family associated to the chain_id passed on parameter.

val read_enable_multichain_flag : t -> bool Tezos_base.TzPervasives.tzresult Lwt.t

read_enable_multichain_flag reads the value of the `enable_multichain` feature_flag that enables multichain and tezos compatibility on the l2_node.

val preload_known_kernels : t -> unit Tezos_base.TzPervasives.tzresult Lwt.t

preload_known_kernels ctxt uses ctxt to preload every kernel known to the node in the Fast Execution kernel cache.

preload_kernel_from_level ctxt level uses ctxt to preload the kernel used to apply the block at level level.

chain_id ctxt returns the chain id defined by the rollup.

michelson_runtime_chain_id ctxt returns the chain id of the Michelson runtime defined by the rollup.

val michelson_activation_level : t -> int64 option Tezos_base.TzPervasives.tzresult Lwt.t

michelson_activation_level ctxt returns the EVM block level at which the Michelson runtime was activated, or None if it has not been activated.

current_block_number_durable ctxt ~chain_family returns the current block number of the L2 chain for the given chain_family from durable storage.

val storage_version : t -> int Tezos_base.TzPervasives.tzresult Lwt.t

storage_version ctxt returns the latest storage version known to the current kernel.

val kernel_version : t -> string Tezos_base.TzPervasives.tzresult Lwt.t

kernel_version ctxt returns the internal kernel version.

kernel_root_hash ctxt returns the internal kernel root hash.

val list_runtimes : t -> Tezosx.runtime list Tezos_base.TzPervasives.tzresult Lwt.t

list_runtimes ctxt returns the list of runtimes activated in the kernel.

val list_l1_l2_levels : t -> from_l1_level:int32 -> (int32 * Evm_store.L1_l2_finalized_levels.t) list Tezos_base.TzPervasives.tzresult Lwt.t
val l2_levels_of_l1_level : t -> int32 -> Evm_store.L1_l2_finalized_levels.t option Tezos_base.TzPervasives.tzresult Lwt.t

block_param_to_block_number ctxt ~chain_family block_param returns the block number of the block identified by block_param. Uses the store for hash lookups.

single_chain_id_and_family ctxt ~config ~enable_multichain should only be called if the node is expected to follow a single chain.

Block storage operations (store-backed)

current_block_number ctxt returns the most recent stored block number.

val nth_block : t -> full_transaction_object:bool -> Z.t -> Transaction_object.t Evm_node_lib_dev_encoding.Ethereum_types.block Tezos_base.TzPervasives.tzresult Lwt.t
val block_range_receipts : t -> ?mask:Ethbloom.t -> Z.t -> int -> Evm_node_lib_dev_encoding.Transaction_receipt.t list Tezos_base.TzPervasives.tzresult Lwt.t

get_state ctxt ?block () returns the EVM state at the given block parameter. Defaults to Latest.

read_state state path reads a value from the durable storage at path in the given state. Uses Durable_storageV2.read_opt internally.

subkeys state path returns the list of subkeys under path in the durable storage of state.

val execute_entrypoint : t -> Evm_state.t -> input_path:string -> input:bytes -> output_path:string -> entrypoint:string -> bytes Tezos_base.TzPervasives.tzresult Lwt.t

execute_entrypoint ctxt 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 execute_entrypoint_with_insights : t -> Evm_state.t -> input_path:string -> input:bytes -> insight_requests:Simulation.Encodings.insight_request list -> entrypoint:string -> bytes option list Tezos_base.TzPervasives.tzresult Lwt.t

Like execute_entrypoint but reads multiple insight paths from durable storage after calling the kernel entrypoint.

Tracer operations

type replay_strategy =
  1. | Blueprint
  2. | Assemble
type replay_result =
  1. | Replay_success of {
    1. block : Evm_node_lib_dev_encoding.Ethereum_types.legacy_transaction_object Evm_node_lib_dev_encoding.L2_types.block;
    2. evm_state : Evm_state.t;
    3. diverged : bool;
    4. process_time : Ptime.span;
    5. execution_gas : Evm_node_lib_dev_encoding.Ethereum_types.quantity;
    6. tezos_block : Evm_node_lib_dev_encoding.L2_types.Tezos_block.t option;
    }
  2. | Replay_failure
val blueprints_range : t -> Blueprints_publisher.blueprints_range