Skip to main content

MIN_WAKEUP_DELAY

Constant MIN_WAKEUP_DELAY 

Source
pub const MIN_WAKEUP_DELAY: Duration;
Expand description

Shortest delay DelegateCtx::schedule_wakeup will request. Anything below it is clamped up to it, by that function.

A delegate that re-arms inside its own WakeupFired handler with a zero or near-zero delay would otherwise spin the node in a tight wake loop — the same unbounded-work hazard a deadline in the past would have created, which is why moving to a relative delay did not remove the need for this floor.

The host must clamp too, and does not yet. A delegate can declare the import itself and bypass this wrapper, so the clamp here bounds only well-behaved callers; only the host can make this a limit. That host-side floor is an obligation on freenet-core#3972, not a property of anything shipped.

A second obligation in the same place: for a long delay to be useful the host must persist pending wakeups across a node restart. No host does this today. The precedent runs the wrong way — DELEGATE_SUBSCRIPTIONS, the one comparable piece of per-delegate host state, is in-memory and a restart discards it entirely.