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§
- Addressed queries query for the most recent version of a key less than or equal to a given block address or solution 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 queries query for the most recent version of a key less than or equal to a given block number or solution index for blocks that have been finalized.
- Provides the node’s
ConnectionPool
implementation and related items. - Provides the SQL statements used by
essential-node-db
viaconst
str
s.
Enums§
- A database or decoding error returned by a query.
Traits§
- Types that may be provided to
subscribe_blocks
to provide access toConnection
s while streaming. - Types that may be provided to
subscribe_blocks
to asynchronously await the availability of a new block.
Functions§
- Convert a slice of
Word
s into a blob. - Create all tables.
- Deletes the state for a given contract content address and key.
- Finalizes the block with the given hash. This sets the block to be the only block at a particular block number.
- Returns the block with given address.
- Given a block address, returns the header for that block.
- Fetches the latest finalized block hash.
- Given a block address, returns the addresses of blocks that have the next block number.
- Fetches the parent block address.
- Fetches a solution by its content address.
- Fetches the last progress on validation.
- For the given block:
- Inserts a failed block.
- Lists all blocks in the given range.
- Lists blocks and their solutions within a specific time range with pagination.
- List failed blocks as (block number, solution hash) within a given range.
- Lists all unchecked blocks in the given range.
- Fetches the state value for the given contract content address and key pair.
- Subscribe to all blocks from the given starting block number.
- Updates the state for a given contract content address and key.
- Updates the progress on validation.
- Short-hand for constructing a transaction, providing it as an argument to the given function, then committing the transaction before returning.
- Convert a blob into a vector of
Word
s.