rings_node/consts.rs
1/// Redundant setting of entry data storage
2pub const DATA_REDUNDANT: u16 = 6;
3/// Connect Behaviour
4pub const CONNECT_FAILED_LIMIT: u64 = 3;
5/// Message Send Behaviour
6pub const MSG_SEND_FAILED_LIMIT: u64 = 10;
7/// Message Received Behaviour
8pub const MSG_RECV_FAILED_LIMIT: u64 = 10;
9
10/// Default storage capacity in bytes for node storage backends (DHT entries, measurements, and
11/// provisional evidence).
12pub const DEFAULT_STORAGE_CAPACITY: u32 = 200_000_000;
13/// Byte budget of the onion entry-guard store.
14pub const ONION_ENTRY_GUARD_STORAGE_CAPACITY: u32 = 64 * 1024;
15/// Byte budget of the replay store: at least every record of a full store
16/// (`rings_core::message::TRANSACTION_REPLAY_STORE_MAX_BYTES`, about 27 MiB). The store is
17/// authoritative and evicts nothing: a write beyond the budget fails, which fails that
18/// transition closed, so the budget must never be reached.
19pub const TRANSACTION_REPLAY_STORAGE_CAPACITY: u32 = 40 * 1024 * 1024;
20/// Byte budget of the relay-inbox store: the carriers this node holds or owns, each at most
21/// `RELAY_INBOX_MAX_LEN` held messages. The store is retained and evicts nothing (#1021): a
22/// hold beyond the budget is refused, so the sender's message is not held, instead of evicting
23/// mail already held.
24pub const RELAY_INBOX_STORAGE_CAPACITY: u32 = 64 * 1024 * 1024;
25/// Byte budget of each retained browser mail store (`mail-inbox` and `mail-records`).
26pub const MAIL_STORAGE_CAPACITY: u32 = 64 * 1024 * 1024;
27/// Byte budget of the store of the data namespace's remove sides (#920, #907): at least the
28/// `REMOVAL_STORE_MAX_REMOVES` items the accounting admits, each filed in at most
29/// `REMOVAL_STORED_ITEM_WIRE_MAX` bytes when every record holds one (about 19.6 MB). The store
30/// is retained and evicts nothing: a remove beyond the budget is refused, never another one
31/// evicted.
32pub const DHT_REMOVAL_STORAGE_CAPACITY: u32 = 24 * 1024 * 1024;
33const _: () = assert!(
34 rings_core::consts::REMOVAL_STORE_MAX_REMOVES
35 * rings_core::consts::REMOVAL_STORED_ITEM_WIRE_MAX
36 <= DHT_REMOVAL_STORAGE_CAPACITY as usize
37);