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
//! Named duration constants for polling, cache refresh, and backoff.
//!
//! Centralizes tuning parameters so intent is clear and changes don't require
//! searching the codebase. For timeout limits, see `crate::utils::timeout`.
use Duration;
/// Cache TTL for chain tip hash/difficulty (getblockchaininfo, get_best_block_hash).
pub const CACHE_REFRESH_TIP: Duration = from_secs;
/// Cache TTL for uptime (getuptime).
pub const CACHE_REFRESH_UPTIME: Duration = from_millis;
/// Cache TTL for memory stats (getmemoryinfo).
pub const CACHE_REFRESH_MEMORY: Duration = from_secs;
/// Poll interval for waitfornewblock / waitforblock / waitforblockheight.
pub const POLL_INTERVAL_WAIT_FOR_BLOCK: Duration = from_millis;
/// Interval for auth rate limiter cleanup (stale entries).
pub const AUTH_RATE_LIMITER_CLEANUP_INTERVAL: Duration = from_secs;
/// Sleep between handshake message poll iterations (node startup).
pub const HANDSHAKE_POLL_SLEEP: Duration = from_millis;
/// Sleep in background message processor loop (avoids busy-loop when no messages).
pub const MESSAGE_PROCESSOR_POLL_SLEEP: Duration = from_millis;
/// Sleep between mempool loop iterations (prevents busy waiting).
pub const MEMPOOL_LOOP_SLEEP: Duration = from_millis;
/// Yield sleep in IBD when reorder buffer is full (avoids busy spin).
pub const IBD_YIELD_SLEEP: Duration = from_millis;
/// Backoff when a background task loop has work queued (avoids busy spin).
pub const BACKGROUND_TASK_BACKOFF_SLEEP: Duration = from_millis;
/// Brief wait after starting RPC server before connecting (allows bind/listen).
pub const RPC_SERVER_STARTUP_WAIT: Duration = from_millis;
/// Timeout for reading a single response in RPC server tests / health check.
pub const RPC_CLIENT_READ_TIMEOUT: Duration = from_secs;
/// Delay after unloading a module before reload (allows cleanup to complete).
pub const MODULE_RELOAD_CLEANUP_DELAY: Duration = from_millis;