1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
use *;
/// Frequency to flush record stores to disk
pub const FLUSH_RECORD_STORES_INTERVAL_SECS: u32 = 1;
/// Frequency to save metadata to disk
pub const SAVE_METADATA_INTERVAL_SECS: u32 = 30;
/// Frequency to check for offline subkeys writes to send to the network
pub const OFFLINE_SUBKEY_WRITES_INTERVAL_SECS: u32 = 1;
/// Total number of offline subkey write requests to process in parallel
pub const OFFLINE_SUBKEY_WRITES_BATCH_SIZE: usize = 16;
/// Number of subkeys per offline subkey write keys to process in a chunk
pub const OFFLINE_SUBKEY_WRITES_SUBKEY_CHUNK_SIZE: u64 = 4;
/// Frequency to send ValueChanged notifications to the network
pub const SEND_VALUE_CHANGES_INTERVAL_SECS: u32 = 1;
/// Frequency to check for dead nodes and routes for client-side outbound watches
pub const CHECK_OUTBOUND_WATCHES_INTERVAL_SECS: u32 = 1;
/// Frequency to retry reconciliation of watches that are not at consensus
pub const RECONCILE_OUTBOUND_WATCHES_INTERVAL: TimestampDuration = new_secs;
/// How long before expiration to try to renew per-node watches
pub const RENEW_OUTBOUND_WATCHES_DURATION: TimestampDuration = new_secs;
/// Frequency to check for expired server-side watched records
pub const CHECK_INBOUND_WATCHES_INTERVAL_SECS: u32 = 1;
/// Frequency to check for expired client-side transactions
pub const CHECK_OUTBOUND_TRANSACTIONS_INTERVAL_SECS: u32 = 1;
/// Multiplier applied to rpc_timeout_ms to derive the server-side transaction TTL
pub const TRANSACTION_TIMEOUT_RPC_MULTIPLIER: u64 = 2;
/// Multiplier applied to a node's RTT to derive a post-consensus deadline (capped at `rpc.timeout_ms`)
pub const POST_CONSENSUS_RTT_FACTOR: u64 = 3;
/// Headroom beyond `consensus_count` (= `set_value_count`) that Begin aims for, as a percentage rounded up
pub const CONSENSUS_TRIM_PERCENT: usize = 50;
/// Frequency to check for expired server-side transactions
pub const CHECK_INBOUND_TRANSACTIONS_INTERVAL_SECS: u32 = 1;
/// Frequency to process record rehydration requests
pub const REHYDRATE_RECORDS_INTERVAL_SECS: u32 = 1;
/// Number of rehydration requests to process in parallel
pub const REHYDRATE_BATCH_SIZE: usize = 16;
/// Maximum 'offline lag' before we decide to poll for changed watches
pub const CHANGE_INSPECT_LAG: TimestampDuration = new_secs;
/// Length of descriptor cache (512 records and 5 nodes per record, roughly 184320 bytes)
pub const DESCRIPTOR_CACHE_SIZE: usize = 2560;
/// Table store table for storage manager metadata
pub const STORAGE_MANAGER_METADATA: &str = "storage_manager_metadata";
/// Storage manager metadata key name for offline subkey write persistence
pub const OFFLINE_SUBKEY_WRITES: & = b"offline_subkey_writes";
/// Outbound watch manager metadata key name for watch persistence
pub const OUTBOUND_WATCH_MANAGER: & = b"outbound_watch_manager";
/// Rehydration requests metadata key name for rehydration persistence
pub const REHYDRATION_REQUESTS: & = b"rehydration_requests";
/// Descriptor cache metadata key name for persistence
pub const DESCRIPTOR_CACHE: & = b"descriptor_cache";
/// Remote store connection pool divisor
pub const REMOTE_POOL_CONCURRENCY_DIVISOR: usize = 4;
// --- Outbound Transaction Manager Constants ---
/// Upload budget floor in bytes. Effectively-unlimited for now: bandwidth gating
/// awaits the AIMD controller, so the operation_concurrency count cap is the only
/// active throttle. (raise-only; reset on network change)
pub const GLOBAL_OPERATION_UPLOAD_BANDWIDTH_DEFAULT_BYTES: u64 = u64MAX;
/// Download budget floor in bytes. Effectively-unlimited (see upload).
pub const GLOBAL_OPERATION_DOWNLOAD_BANDWIDTH_DEFAULT_BYTES: u64 = u64MAX;
/// Fraction (1/N) of rpc.timeout_ms that in-flight operation bytes should drain within
pub const OPERATION_BANDWIDTH_QUEUE_TIME_FRACTION: u64 = 3;
/// Floor of the keepalive interval as a fraction (1/N) of the server-side TTL.
pub const KEEPALIVE_INTERVAL_FLOOR_TTL_FRACTION: u64 = 10;
/// Ceiling of the keepalive interval as a fraction (1/N) of the server-side TTL.
pub const KEEPALIVE_INTERVAL_CEILING_TTL_FRACTION: u64 = 3;
/// Number of RTTs of safety the next reply should land before server expiration.
pub const KEEPALIVE_SAFETY_RTT_FACTOR: u64 = 3;