Expand description
The node’s DB interface and sqlite implementation.
The core capability of the node is to:
- Receive blocks from an L1 relayer and validate them.
- Receive contracts from the p2p network so that they’re available for validation.
As a part of satisfying these requirements, this crate provides the basic functions required for safely creating the necessary tables and inserting/ querying/updating them as necessary.
Re-exports§
pub use pool::ConnectionPool;
Modules§
- address
- Addressed queries query for the most recent version of a key less than or equal to a given block address or solution set index. This is useful for querying un-finalized blocks where forks may exist. These queries fall back to finalized queries if the value is not found.
- finalized
- Finalized queries query for the most recent version of a key less than or equal to a given block number or solution set index for blocks that have been finalized.
- pool
- Provides the node’s
ConnectionPool
implementation and related items. - sql
- Provides the SQL statements used by
essential-node-db
viaconst
str
s.
Enums§
- Query
Error - A database or decoding error returned by a query.
Traits§
- Acquire
Connection - Types that may be provided to
subscribe_blocks
to provide access toConnection
s while streaming. - Await
NewBlock - Types that may be provided to
subscribe_blocks
to asynchronously await the availability of a new block.
Functions§
- blob_
from_ words - Convert a slice of
Word
s into a blob. - create_
tables - Create all tables.
- delete_
state - Deletes the state for a given contract content address and key.
- finalize_
block - Finalizes the block with the given hash. This sets the block to be the only block at a particular block number.
- get_
block - Returns the block with given address.
- get_
block_ header - Given a block address, returns the header for that block.
- get_
latest_ finalized_ block_ address - Fetches the latest finalized block hash.
- get_
next_ block_ addresses - Given a block address, returns the addresses of blocks that have the next block number.
- get_
parent_ block_ address - Fetches the parent block address.
- get_
solution_ set - Fetches a solution set by its content address.
- get_
validation_ progress - Fetches the last progress on validation.
- insert_
block - For the given block:
- insert_
failed_ block - Inserts a failed block.
- list_
blocks - Lists all blocks in the given range.
- list_
blocks_ by_ time - Lists blocks and their solution sets within a specific time range with pagination.
- list_
failed_ blocks - List failed blocks as (block number, solution set hash) within a given range.
- list_
unchecked_ blocks - Lists all unchecked blocks in the given range.
- query_
state - Fetches the state value for the given contract content address and key pair.
- subscribe_
blocks - Subscribe to all blocks from the given starting block number.
- update_
state - Updates the state for a given contract content address and key.
- update_
validation_ progress - Updates the progress on validation.
- with_tx
- Short-hand for constructing a transaction, providing it as an argument to the given function, then committing the transaction before returning.
- with_
tx_ dropped - Short-hand for constructing a transaction, providing it as an argument to the given function, then dropping the transaction before returning.
- words_
from_ blob - Convert a blob into a vector of
Word
s.