Evm_node_lib_dev.Evm_storeThe EVM node’s store is built around and SQLite database.
include module type of Octez_sqlite.SqlitePermission mode for database access.
Note that SQLite uses file-level locking for write operations. When using Read_write mode, write operations will acquire an exclusive lock on the database file, preventing other processes from writing to it simultaneously. In this case the pool size is always 1. In Read_only mode, multiple processes can read concurrently.
val close : t -> unit Lwt.tval vacuum :
conn:conn ->
output_db_file:string ->
unit Tezos_error_monad.Error_monad.tzresult Lwt.tRebuild the database in output_db_file using the VACUUM sqlite command. This function is useful to backup the database.
val vacuum_self :
conn:conn ->
unit Tezos_error_monad.Error_monad.tzresult Lwt.tVacuums the database itself after removing lot of data VACUUM sqlite command.
val use :
t ->
(conn -> 'a Tezos_error_monad.Error_monad.tzresult Lwt.t) ->
'a Tezos_error_monad.Error_monad.tzresult Lwt.tuse db k executes k with a fresh connection to db.
val with_transaction :
conn ->
(conn -> 'a Tezos_error_monad.Error_monad.tzresult Lwt.t) ->
'a Tezos_error_monad.Error_monad.tzresult Lwt.twith_transaction conn k wraps the accesses to the database from conn made in the continuation k within a SQL transaction. If k fails, the transaction is rollbacked. Otherwise, the transaction is committed.
val assert_in_transaction : conn -> unitassert_in_transaction conn raises an exception if a transaction has not been started with conn.
module Request : sig ... endModule for creating SQL requests with metadata for tracing and debugging. This is a wrapper around Caqti's request system with additional metadata.
module Db : sig ... endCaqti convenience functions wrapped in the Tezos error monad. See Caqti_connection_sig.Convenience.
with_connection conn k allows to wraps atomic low level accesses to the database from conn. with_connection can be used in the continuation of with_transaction.
val init :
?max_conn_reuse_count:int ->
data_dir:string ->
perm:perm ->
unit ->
t Tezos_base.TzPervasives.tzresult Lwt.tinit ?max_conn_reuse_count ~data_dir ~perm () returns a handler to the EVM node store located under data_dir. If no store is located in data_dir, an empty store is created. Also returns if the store was created (true) or was already existing (false).
If perm is Read_only, then SQL requests requiring write access will fail. With Read_write, they will succeed as expected.
module Schemas : sig ... endmodule Blueprints : sig ... endmodule Context_hashes : sig ... endtype pending_kernel_upgrade = {kernel_upgrade : Evm_node_lib_dev_encoding.Evm_events.Upgrade.t;injected_before : Evm_node_lib_dev_encoding.Ethereum_types.quantity;}type pending_sequencer_upgrade = {sequencer_upgrade : Evm_node_lib_dev_encoding.Evm_events.Sequencer_upgrade.t;injected_before : Evm_node_lib_dev_encoding.Ethereum_types.quantity;}module Kernel_upgrades : sig ... endmodule Sequencer_upgrades : sig ... endmodule Delayed_transactions : sig ... endmodule Blocks : sig ... endmodule Block_storage_mode : sig ... endval context_hash_of_block_hash :
conn ->
Evm_node_lib_dev_encoding.Ethereum_types.block_hash ->
Pvm.Context.hash option Tezos_base.TzPervasives.tzresult Lwt.tmodule Transactions : sig ... endmodule Irmin_chunks : sig ... endmodule Pending_confirmations : sig ... endmodule L1_l2_levels_relationships : sig ... endmodule L1_l2_finalized_levels : sig ... endtype metadata = {smart_rollup_address : Octez_smart_rollup.Address.t;history_mode : Evm_node_config.Configuration.history_mode;}module Metadata : sig ... endval reset_after :
conn ->
l2_level:Evm_node_lib_dev_encoding.Ethereum_types.quantity ->
unit Tezos_base.TzPervasives.tzresult Lwt.treset_after conn ~l2_level clear the table that has information related to l2 level after l2_level
val reset_before :
conn ->
l2_level:Evm_node_lib_dev_encoding.Ethereum_types.quantity ->
history_mode:Evm_node_config.Configuration.history_mode ->
unit Tezos_base.TzPervasives.tzresult Lwt.treset_before conn ~l2_level clear the table that has information related to l2 level before l2_level, if history_mode is set to Full keep block-related information and clear the rest