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 derive state from their solutions.
- 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.
Modules§
- 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 SQL statements used by
essential-node-db
viaconst
str
s.
Structs§
- Any error that might occur during decoding of a type returned by the DB.
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§
- Create all tables.
- Decodes the given blob into a value of type
T
. - Deletes the state for a given contract content address and key.
- Encodes the given value into a blob.
- Finalizes the block with the given hash. This sets the block to be the only block at a particular block number.
- Fetches the block number for a given block.
- Fetches a contract by its content address.
- Fetches the predicates of the contract with the given content address.
- Fetches the contract progress.
- Fetches the salt of the contract with the given content address.
- Fetches the latest finalized block hash.
- Fetches a predicate by its predicate content address.
- Fetches a solution by its content address.
- Fetches the last progress on state derivation.
- Fetches the last progress on validation.
- For the given block:
- For the given contract:
- Inserts the new progress for syncing contracts.
- Inserts a failed block.
- Lists all blocks in the given range.
- Lists blocks and their solutions within a specific time range with pagination.
- Lists contracts and their predicates within a given DA block range.
- 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 state derivation.
- Updates the progress on validation.