Determine whether a given nullifier exists.
The nullifier value to look up.
Tree number of the nullifier.
true if the nullifier is present, otherwise false.
Insert a batch of nullifiers, updating existing records on conflict. An
empty batch is a no-op and returns 0.
Array of nullifiers to upsert.
Normalized count of affected rows.
Retrieve nullifiers whose block numbers fall within an inclusive range, ordered ascending by block number.
Starting block height (inclusive).
Ending block height (inclusive).
Nullifiers ordered by block number.
Retrieve all nullifiers, ordered ascending by block number.
All nullifier records.
Retrieve nullifiers at or after a block number, ordered ascending by block.
Starting block height (inclusive).
Nullifier records from the block onward.
Insert or update a batch of commitments. An empty batch is a no-op and
returns 0.
Array of commitment records to upsert.
Normalized count of affected rows.
Get commitments within an inclusive leaf range of a Merkle tree, ordered ascending by tree position.
Tree identifier.
Starting leaf index (inclusive).
Ending leaf index (inclusive).
Commitments ordered by leaf index.
Retrieve commitments within an inclusive block range, ordered ascending by block number.
Start block height (inclusive).
End block height (inclusive).
Commitments ordered by block number.
Fetch the serialized Merkle tree for a given tree number.
Identifier of the Merkle tree.
The Merkle tree record, or undefined when absent.
Fetch all Merkle trees, ordered ascending by tree number.
All Merkle tree records.
Insert or update a Merkle tree record.
Merkle tree data to persist.
Normalized count of affected rows.
Retrieve the synchronization state for a chain.
Identifier of the chain.
The sync state, or undefined when absent.
Insert or update the commitment synchronization cursor for a chain.
Identifier of the chain.
Last synced block height.
Normalized count of affected rows.
Read the validated snapshot checkpoint of a chain.
Identifier of the chain.
The checkpoint, or undefined when the chain has no checkpoint.
Read the pending snapshot checkpoint of a chain. A pending checkpoint marks the chain rows as snapshot data that no validation has confirmed.
Identifier of the chain.
The pending checkpoint, or undefined when the chain has none.
Return the chain database to its validated snapshot checkpoint, or to the
empty chain when it has none, atomically. With a checkpoint: delete the rows
above its height, write merkleTrees, delete the trees the checkpoint
does not hold, delete the TXID trees, set last_block_height to the
checkpoint height and lower the TXID sync cursor to it. Every stored tree must match the checkpoint leaf count
and root. Without a checkpoint: delete every chain row, the sync state and
the pending checkpoint of the chain. A rollback with a checkpoint keeps the
stored reorg epoch.
The caller stops the scan and the TXID sync of the chain first.
Identifier of the chain.
UTXO trees cut back to the checkpoint leaf counts. Empty when the chain has no checkpoint.
Read the independent Railgun TXID sync cursor for a chain.
Identifier of the chain.
Last block height whose Railgun TXID rows were persisted, or 0n.
Update the Railgun TXID sync cursor without changing the commitment cursor.
Identifier of the chain.
Last PPOI-complete block persisted for TXID state.
Normalized count of affected rows.
Read the persisted RAILGUN TXID Merkle tree. TXID trees live apart from the
UTXO trees of getAllMerkleTrees.
Identifier of the chain.
All TXID trees ordered by tree number with the stored position, or
undefined when no TXID tree was persisted.
Persist the given RAILGUN TXID trees and the sync position atomically.
Trees not in state.trees stay unchanged.
Identifier of the chain.
Changed trees and the position they cover.
Count the Railgun transactions at or below a block.
End block height, inclusive.
Number of stored Railgun transactions through toBlock.
Insert Railgun transactions, ignoring already-seen Railgun TXIDs. An empty
batch is a no-op and returns 0.
Railgun transaction rows to insert.
Normalized count of inserted rows.
Fetch one Railgun transaction by its canonical Railgun TXID.
Canonical Railgun transaction ID.
The matching transaction, or undefined.
Fetch Railgun transactions within an inclusive block range, ordered ascending by block number, then by graphID.
Start block height (inclusive).
End block height (inclusive).
Transactions ordered by block number and graphID.
Fetch Railgun transactions whose output batch starts in a tree range, ordered ascending by output batch start position, then by graphID.
Output UTXO tree number.
Inclusive output start position.
Inclusive output end position.
Transactions ordered by output batch start position and graphID.
Find the Railgun transaction whose output leaves contain a commitment. The lookup matches the commitment hash inside its chain transaction.
Stored commitment row to locate.
The transaction that produced the commitment, or undefined.
Insert or update a batch of unshield events. An empty batch is a no-op and
returns 0.
Array of unshield records to upsert.
Normalized count of affected rows.
Retrieve the unshield records of one EVM transaction, ordered ascending by event log index.
Hash of the EVM transaction.
Unshield records ordered by event log index.
Persist one scan batch atomically: nullifiers, commitments, unshields, Railgun transactions, serialized Merkle trees, and the sync cursors either all commit or all roll back together. The Railgun TXID cursor advances only when at least one new Railgun transaction row was inserted; the commitment sync cursor always advances. Absent or empty members are skipped.
Scan batch to persist.
Chain-wide storage operations.