Evm_node_lib_dev.Durable_storageTyped access layer for the EVM node durable storage.
All durable storage access MUST go through this module. The path GADT ensures type-safe read/write/delete operations. Raw_path is provided as an escape hatch for paths not yet modeled in the GADT. New code should add typed constructors instead of using Raw_path.
module EVM_account_info : sig ... endDecoded form of the /evm/world_state/accounts/<addr>/info record: balance, nonce, and code hash for an EVM account.
A path carries two phantom parameters: the decoded value type 'a and a capability row 'cap made of the polymorphic-variant tags `Read and `Write. The aliases rw (read+write) and ro (read-only) name the two closed rows. Raw_path is the escape hatch that decodes to raw bytes; new code should add typed constructors with the precise capability row instead.
Phantom capability markers for path: rw is read+write+delete, ro is read-only.
type ('a, 'cap) path = | Raw_path : string -> (bytes, rw) path| Chain_id : (Evm_node_lib_dev_encoding.L2_types.chain_id, ro) path| Michelson_runtime_chain_id : (Evm_node_lib_dev_encoding.L2_types.chain_id, ro)
path| Kernel_version : (string, ro) path| Kernel_root_hash : (Evm_node_lib_dev_encoding.Ethereum_types.hex, ro) path| Multichain_flag : (unit, ro) path| Sequencer_key : (Tezos_base.TzPervasives.Signature.Public_key.t, ro) path| Chain_config_family : Evm_node_lib_dev_encoding.L2_types.chain_id ->
(Evm_node_lib_dev_encoding.L2_types.ex_chain_family, ro)
path| Tezosx_feature_flag : Tezosx.runtime -> (unit, ro) path| Michelson_runtime_sunrise_level : (Evm_node_lib_dev_encoding.Ethereum_types.quantity,
ro)
path| Current_block_number : _ Evm_node_lib_dev_encoding.L2_types.chain_family ->
(Evm_node_lib_dev_encoding.Ethereum_types.quantity, ro)
path| Current_block_hash : _ Evm_node_lib_dev_encoding.L2_types.chain_family ->
(Evm_node_lib_dev_encoding.Ethereum_types.block_hash, ro)
path| Evm_node_flag : (unit, rw) path| Blueprint_chunk : {} -> (bytes, rw) path| Blueprint_nb_chunks : Z.t -> (int, rw) path| Blueprint_generation : Z.t -> (Evm_node_lib_dev_encoding.Ethereum_types.quantity,
rw)
path| Single_tx_input : (Evm_node_lib_dev_encoding.Rlp.item, rw) path| Assemble_block_input : (Evm_node_lib_dev_encoding.Rlp.item, rw) path| Current_block : _ Evm_node_lib_dev_encoding.L2_types.chain_family ->
(Evm_node_lib_dev_encoding.Ethereum_types.legacy_transaction_object
Evm_node_lib_dev_encoding.L2_types.block,
ro)
path| Block_by_hash : _ Evm_node_lib_dev_encoding.L2_types.chain_family
* Evm_node_lib_dev_encoding.Ethereum_types.block_hash -> (Evm_node_lib_dev_encoding.Ethereum_types.legacy_transaction_object
Evm_node_lib_dev_encoding.L2_types.block,
read_delete)
path| Block_index : _ Evm_node_lib_dev_encoding.L2_types.chain_family
* Durable_storage_path.Block.number -> (unit, [ `Delete ]) path| Tezosx_tezos_current_block : (Evm_node_lib_dev_encoding.Ethereum_types.legacy_transaction_object
Evm_node_lib_dev_encoding.L2_types.block,
ro)
path| Current_receipts : (Evm_node_lib_dev_encoding.Transaction_receipt.t, ro) path| Backlog : (int64, ro) path| Minimum_base_fee_per_gas : (Z.t, ro) path| Da_fee_per_byte : (Evm_node_lib_dev_encoding.Ethereum_types.quantity, ro) path| Maximum_gas_per_transaction : (Evm_node_lib_dev_encoding.Ethereum_types.quantity,
ro)
path| Michelson_to_evm_gas_multiplier : (int64, ro) path| Sequencer_pool_address : (Evm_node_lib_dev_encoding.Ethereum_types.address, ro)
path| Evm_legacy_account_balance : Evm_node_lib_dev_encoding.Ethereum_types.address ->
(Evm_node_lib_dev_encoding.Ethereum_types.quantity, rw)
path| Evm_legacy_account_nonce : Evm_node_lib_dev_encoding.Ethereum_types.address ->
(Evm_node_lib_dev_encoding.Ethereum_types.quantity, rw)
path| Evm_legacy_account_code : Evm_node_lib_dev_encoding.Ethereum_types.address ->
(Evm_node_lib_dev_encoding.Ethereum_types.hex, rw)
path| Evm_legacy_account_code_hash : Evm_node_lib_dev_encoding.Ethereum_types.address ->
(Evm_node_lib_dev_encoding.Ethereum_types.hash, ro)
path| Evm_legacy_block_by_hash : Evm_node_lib_dev_encoding.Ethereum_types.block_hash ->
(Evm_node_lib_dev_encoding.Ethereum_types.legacy_transaction_object
Evm_node_lib_dev_encoding.Ethereum_types.block,
ro)
path| Evm_legacy_current_block : (Evm_node_lib_dev_encoding.Ethereum_types.legacy_transaction_object
Evm_node_lib_dev_encoding.Ethereum_types.block,
ro)
path| Evm_code_by_hash : Evm_node_lib_dev_encoding.Ethereum_types.hash -> (Evm_node_lib_dev_encoding.Ethereum_types.hex,
rw)
path| Evm_account_storage : Durable_storage_path.Accounts.fixed_address
* Durable_storage_path.Accounts.fixed_index -> (Evm_node_lib_dev_encoding.Ethereum_types.hex,
rw)
path| Evm_account_info : Evm_node_lib_dev_encoding.Ethereum_types.address ->
(EVM_account_info.t, rw)
path| Tezos_account_info : Tezosx.Tezos_runtime.address -> (Tezosx.Tezos_runtime.account_info,
ro)
path| Evm_block_hash_by_number : Durable_storage_path.Block.number -> (Evm_node_lib_dev_encoding.Ethereum_types.block_hash,
ro)
path| Evm_transaction_receipt_by_hash : Evm_node_lib_dev_encoding.Ethereum_types.hash
* Evm_node_lib_dev_encoding.Ethereum_types.block_hash -> (Evm_node_lib_dev_encoding.Transaction_receipt.t,
ro)
path| Evm_transaction_object_by_hash : Evm_node_lib_dev_encoding.Ethereum_types.hash
* Evm_node_lib_dev_encoding.Ethereum_types.block_hash option -> (Evm_node_lib_dev_encoding.Ethereum_types.legacy_transaction_object,
ro)
path| Evm_current_block_receipts : Evm_node_lib_dev_encoding.Ethereum_types.block_hash ->
(Evm_node_lib_dev_encoding.Transaction_receipt.t list, ro)
path| Evm_current_block_transactions_objects : Evm_node_lib_dev_encoding.Ethereum_types.block_hash ->
(Evm_node_lib_dev_encoding.Ethereum_types.legacy_transaction_object list, ro)
path| Tezos_contract_storage : Evm_node_lib_dev_tezlink.Tezos_types.Contract.t ->
(Evm_node_lib_dev_tezlink.Tezlink_imports.Imported_context.Script.expr, ro)
path| Tezos_contract_code : Evm_node_lib_dev_tezlink.Tezos_types.Contract.t ->
(Evm_node_lib_dev_tezlink.Tezlink_imports.Imported_context.Script.expr, ro)
path| Tezos_big_map_value : Evm_node_lib_dev_tezlink.Tezlink_imports.Imported_context.Big_map.Id.t
* Evm_node_lib_dev_tezlink.Tezlink_imports.Imported_protocol.Script_expr_hash.t ->
(Evm_node_lib_dev_tezlink.Tezlink_imports.Imported_context.Script.expr, ro)
path| Tezos_big_map_key_type : Evm_node_lib_dev_tezlink.Tezlink_imports.Imported_context.Big_map.Id.t ->
(Evm_node_lib_dev_tezlink.Tezlink_imports.Imported_context.Script.expr, ro)
path| Tezos_big_map_value_type : Evm_node_lib_dev_tezlink.Tezlink_imports.Imported_context.Big_map.Id.t ->
(Evm_node_lib_dev_tezlink.Tezlink_imports.Imported_context.Script.expr, ro)
path| Tezos_big_map_total_bytes : Evm_node_lib_dev_tezlink.Tezlink_imports.Imported_context.Big_map.Id.t ->
(Z.t, ro)
path| Tezlink_balance : Evm_node_lib_dev_tezlink.Tezos_types.Contract.t ->
(Evm_node_lib_dev_tezlink.Tezos_types.Tez.t, ro)
path| Tezlink_manager : Evm_node_lib_dev_tezlink.Tezos_types.Contract.implicit ->
(Evm_node_lib_dev_tezlink.Tezos_types.Manager.t option, ro)
path| Tezlink_counter : Evm_node_lib_dev_tezlink.Tezos_types.Contract.implicit ->
(Z.t option, ro)
path| Blueprint_current_generation : (Evm_node_lib_dev_encoding.Ethereum_types.quantity,
ro)
path| Kernel_boot_wasm : (bytes, rw) path| Kernel_verbosity : (string, rw) pathval storage_version : Pvm.State.t -> int Tezos_base.TzPervasives.tzresult Lwt.tstorage_version state reads the kernel storage-version integer from state, or 0 if no version marker is present.
val read :
('a, [> `Read ]) path ->
Pvm.State.t ->
'a Tezos_base.TzPervasives.tzresult Lwt.tread p state decodes the value at path p from state and fails if no value is present.
val read_opt :
('a, [> `Read ]) path ->
Pvm.State.t ->
'a option Tezos_base.TzPervasives.tzresult Lwt.tread_opt p state is Some v when a value is present at p, and None otherwise.
val read_or_default :
default:'a ->
('a, [> `Read ]) path ->
Pvm.State.t ->
'a Tezos_base.TzPervasives.tzresult Lwt.tread_or_default ~default p state is the value at p, or default if none is present. Equivalent to Option.value ~default composed with read_opt.
val write :
('a, rw) path ->
'a ->
Pvm.State.t ->
Pvm.State.t Tezos_base.TzPervasives.tzresult Lwt.twrite p value state encodes value and stores it at p.
val delete :
('a, [> `Delete ]) path ->
Pvm.State.t ->
Pvm.State.t Tezos_base.TzPervasives.tzresult Lwt.tdelete p state removes the value stored at p.
val exists :
('a, 'cap) path ->
Pvm.State.t ->
bool Tezos_base.TzPervasives.tzresult Lwt.texists p state is true iff a value is stored at the exact leaf path p. For directory checks, use exists_dir on a dir.
val write_all :
(('a, rw) path * 'a) list ->
Pvm.State.t ->
Pvm.State.t Tezos_base.TzPervasives.tzresult Lwt.twrite_all pairs state writes each (path, value) pair in order. The storage version is read at most once across the whole batch — lazily on the first Versioned path. Equivalent to folding write over the list, but without redundant version reads.
val list_runtimes :
Pvm.State.t ->
Tezosx.runtime list Tezos_base.TzPervasives.tzresult Lwt.tlist_runtimes state enumerates the TezosX runtimes whose feature flag is set in state.
type dir = | Raw_dir of string| Delayed_inbox| Delayed_transactions| Evm_events| Transaction_receipts| Transaction_objects| Michelson_runtime_contracts_index| Michelson_runtime_ledger| Evm_account_storage_dir of Durable_storage_path.Accounts.fixed_addressDirectory paths in the durable storage. Unlike path, a dir does not carry a decoded value type — directory operations work on the subtree as a whole (existence, listing of subkeys, recursive delete). Raw_dir is the escape hatch for paths not yet modeled; new code should add a typed constructor instead.
val delete_dir :
dir ->
Pvm.State.t ->
Pvm.State.t Tezos_base.TzPervasives.tzresult Lwt.tdelete_dir d state recursively removes the subtree rooted at d.
val exists_dir :
dir ->
Pvm.State.t ->
bool Tezos_base.TzPervasives.tzresult Lwt.texists_dir d state is true iff the subtree rooted at d is non-empty (i.e. has at least one descendant).
val subkeys :
dir ->
Pvm.State.t ->
string Tezos_base.TzPervasives.trace Tezos_base.TzPervasives.tzresult Lwt.tsubkeys d state lists the immediate subkeys directly under d.