Skip to main content

Crate inferadb_ledger_state

Crate inferadb_ledger_state 

Source
Expand description

State management for InferaDB Ledger.

This crate sits between the raw B+ tree storage engine (inferadb-ledger-store) and the Raft consensus layer (inferadb-ledger-raft), providing:

  • State layer with bucket-based incremental hashing (256 buckets per vault)
  • Entity and relationship CRUD with conditional writes
  • Snapshot creation and restoration
  • Dual indexes for relationship queries (object-centric and subject-centric)
  • System types for routing and cluster membership
  • Time-travel index for historical queries
  • Block archive for committed block storage

Modules§

system
System organization (_system) for global cluster data.

Structs§

BlockArchive
Block archive for a region.
EntityStore
Low-level entity storage operations on raw transactions.
EventIndex
Secondary index for O(log n) event lookups by ID.
EventStore
Low-level event storage operations on raw transactions.
Events
Events table: stores audit event entries in a dedicated events.db database.
EventsDatabase
Managed wrapper around the dedicated events.db database.
InMemoryStorageEngine
In-memory storage engine wrapping Database<InMemoryBackend>.
IndexManager
Dual index manager for relationship queries.
LocalBackend
Local filesystem storage backend (Hot tier).
ObjectStorageBackend
Object storage backend using object_store crate (Warm tier).
RelationshipStore
Low-level relationship storage operations on raw transactions.
ShardManager
Shard manager coordinating multiple vaults.
Snapshot
In-memory snapshot containing header metadata and decompressed state data.
SnapshotChainParams
Parameters for creating a snapshot with chain verification.
SnapshotManager
Snapshot manager for a region.
SnapshotStateData
Snapshot state data (serialized and compressed).
StateLayer
State layer managing per-vault materialized state.
StorageEngine
File-backed storage engine wrapping Database<FileBackend>.
StorageKey
Decoded storage key components.
TieredSnapshotManager
Tiered snapshot manager.
TieredStorageConfig
Tiered snapshot storage configuration.
VaultCommitment
Per-vault bucket commitment tracking.
VaultSnapshotMeta
Metadata for a single vault within a snapshot.

Enums§

BlockArchiveError
Errors returned by BlockArchive operations.
EventStoreError
Errors returned by EventStore operations.
EventsDatabaseError
Errors returned by EventsDatabase operations.
SnapshotError
Errors returned by snapshot creation, reading, and management operations.
StateError
Errors returned by StateLayer operations.
StorageTier
Storage tier for snapshots.
TieredStorageError
Errors returned by tiered snapshot storage operations.

Constants§

NUM_BUCKETS
Number of buckets per vault.

Traits§

StorageBackend
Trait for snapshot storage backends (distinct from inferadb_ledger_store::StorageBackend).

Functions§

decode_storage_key
Decodes a storage key into its components.
encode_event_key
Encodes an event key from its components.
encode_storage_key
Encodes a storage key with vault and bucket prefixes.