Expand description
Constants used throughout the offline-protocol crate.
Constants§
- ACK_
FOR_ KEY - Metadata key for ACK messages indicating which message ID the ACK is for.
- ACK_
HOP_ COUNT_ KEY - Metadata key for ACK messages indicating the hop count.
- ACK_
TRANSPORT_ KEY - Metadata key for ACK messages indicating the transport used.
- CHUNK_
SIZE_ BLE - Chunk size for BLE file transfers (4 KB). Reduces BLE double-fragmentation: ~22 BLE fragments per chunk instead of ~240.
- CHUNK_
SIZE_ INTERNET - Chunk size for Internet file transfers (256 KB). Fewer round-trips over WebSocket where bandwidth is plentiful.
- DEFAULT_
CHUNK_ SIZE - Default chunk size for file transfers (32 KB).
- DEFAULT_
INITIAL_ TTL - Default time-to-live for messages.
- DEFAULT_
MEDIA_ WINDOW_ SIZE - Default maximum chunks in flight for media transfers.
- FLUSH_
BATCH_ LIMIT - Maximum messages to send in a single flush operation. Prevents blocking the process loop when many messages are pending.
- HISTORY_
CLEANUP_ BATCH_ SIZE - Number of messages to remove when history exceeds the maximum. This provides a buffer to avoid frequent cleanup operations.
- HOP_
COUNT_ EMA_ ALPHA - EMA alpha for hop count tracking.
- LATENCY_
EMA_ ALPHA - EMA (Exponential Moving Average) alpha for latency tracking.
- MAX_
CONCURRENT_ MEDIA_ TRANSFERS_ PER_ PEER - Maximum concurrent outbound media transfers per recipient when chunks are MLS-encrypted.
- MAX_
FORWARD_ COUNT - Maximum number of times a message may be forwarded. Prevents unbounded forwarding chains from malicious or buggy clients.
- MAX_
MEDIA_ DESCRIPTORS - Maximum persisted outbound media transfer descriptors restored after a
restart (newest-first). Small on purpose: each maps to a
MediaResendRequiredthe app is expected to act on, and concurrent transfers are already capped per peer. - MAX_
MEDIA_ OUTBOX_ ENTRIES - Maximum entries in the dedicated media outbox. Smaller than the main outbox since the sliding window limits in-flight chunks.
- MAX_
MESSAGE_ HISTORY - Maximum number of messages to keep in history for topology visualization. This prevents unbounded memory growth while maintaining enough history for accurate network statistics.
- MAX_
OUTBOX_ ENTRIES - Maximum number of entries in the outbox before evicting oldest entries. This prevents unbounded memory growth when messages cannot be delivered.
- MEDIA_
WINDOW_ SIZE_ BLE - Maximum chunks in flight for BLE media transfers. BLE’s low bandwidth means fewer concurrent chunks to avoid congestion.
- MEDIA_
WINDOW_ SIZE_ INTERNET - Maximum chunks in flight for Internet media transfers.
- OBSERVED_
STATS_ COMPACT_ THRESHOLD - Threshold for compacting observed stats to prevent unbounded growth.
- ORIGINAL_
CONTENT_ TYPE_ KEY - Metadata key carrying the original content type on file-chunk messages.
- OUTBOX_
ABSOLUTE_ LIFETIME_ FACTOR - Absolute cap on a restored outbox entry’s total lifetime, as a multiple
of
outbox_max_lifetime_ms, measured fromfirst_sent_at. - RELAY_
LEARNED_ ROUTE_ QUALITY - Default route quality assigned when learning a route from a relayed message. Conservative (0.5) because the transport layer doesn’t expose the immediate peer identity, so the route may be sub-optimal for multi-hop return paths.
- TRANSPORT_
PREFERENCE_ INTERNET - Transport preference value: prefer internet transport.
- TRANSPORT_
PREFERENCE_ KEY - Metadata key indicating preferred transport for a message.