Last updated: 2026-03-23
Path: shared/
Foundation types and storage abstractions used by every other crate.
pub type ByteVector = Vec<u8>;
pub type ByteBuffer = Vec<u8>;
pub type Byte = u8;
pub type ByteString = Vec<u8>;
pub type BitSet = Vec<u8>;
pub type BitVector = Vec<u8>;The KV store layer is the persistence backbone of the entire system.
KeyValueStore trait -- Low-level byte-oriented interface:
get(keys: Vec<Vec<u8>>) -> Vec<Option<Vec<u8>>>put(kv_pairs: Vec<(Vec<u8>, Vec<u8>)>)delete(keys: Vec<Vec<u8>>) -> usizeiterate(fn(key, value))to_map() -> BTreeMap- Convenience:
get_one,put_one,put_if_absent,contains
KeyValueTypedStore<K, V> trait -- Generic typed interface:
get,put,delete,collect,to_map- Impl:
KeyValueTypedStoreImpl<K, V>wrapsKeyValueStorewithbincodeserialization
LmdbKeyValueStore -- LMDB backend via heed crate:
- Memory-mapped B+ tree
SerdeBincode<Vec<u8>>encoding
Error type: KvStoreError (KeyNotFound, IoError, SerializationError, InvalidArgument, LockError)
compression.rs-- LZ4 compression/decompressionf1r3fly_event.rs-- 9 event types for WebSocket streaming (block lifecycle, genesis ceremony, node lifecycle)f1r3fly_events.rs-- Event bus with broadcast channel and startup replay buffer (see WebSocket Events)grpc_server.rs-- gRPC server utilitiesmetrics_constants.rs/metrics_semaphore.rs-- Observabilityenv.rs-- Environment variable parsing utilities (var_parsed,var_or,var_bool)dag/dag_ops.rs-- DAG utility operationshashable_set.rs-- HashSet utilities- Serde helpers:
serde_bytes,serde_vec_bytes,serde_btreemap_bytes_i64,serde_hex_bytes,serde_hex_vec_u8,serde_always_equal_bitset
Unit tests in: compression.rs, f1r3fly_events.rs, metrics_semaphore.rs, list_ops.rs, recent_hash_filter.rs, dag_ops.rs, grpc_server.rs.
See also: shared/ crate