Skip to main content

Module config

Module config 

Source
Expand description

Construction-time configuration for a Node.

The local peer identity is required at construction; every other field carries a production-conservative default (cycle-op budget, in-flight async cap, outbound-queue cap, bus capacity).

Structs§

NodeConfig
Construction-time configuration for a Node.

Constants§

DEFAULT_BUS_CAPACITY
Default bus capacity.
DEFAULT_CYCLE_OP_BUDGET
Default per-cycle Op budget. Some(1000) yields voluntarily after 1000 op-invocations per poll; an emit of EngineStep::CycleBudgetExceeded tells the host the engine paused so other work can run. None disables the budget guard.
DEFAULT_INGRESS_BYTE_BUDGET
Default cap on total in-flight ingress bytes the engine may hold across the ingress queue, slot table, and pending async completion buffers at any instant. 256 MiB. Wire and application boundaries try_charge against this cap before admitting a payload; overflow emits the appropriate BudgetExceeded InfraEvent and drops the offending bytes.
DEFAULT_MAX_APP_EVENT_BYTES
Default per-AppEvent payload cap consulted by Node::deliver_event. 1 MiB. Oversize payloads return DeliveryError::OversizePayload synchronously AND emit AppIngressError { kind: PerItemCapExceeded } on the bus.
DEFAULT_MAX_COMPLETION_RESULT_BYTES
Default per-CompletionHandle result-payload cap. 4 MiB. Larger completions emit AppIngressError { kind: PerItemCapExceeded } and the component sees an async-op timeout in place of the dropped completion.
DEFAULT_MAX_INVOKE_BYTES
Default per-Invoke cumulative payload cap. 10 MiB. Sum of every (name, bytes) entry’s payload length.
DEFAULT_MAX_INVOKE_INPUTS
Default per-Invoke input-count cap. 100 inputs. Caller-side guard against pathological invoke() calls; the cap rejects before any per-input allocation runs.
DEFAULT_MAX_OUTBOUND_QUEUE
Default cap on the outbound envelope queue depth. Some(10_000) drops the oldest envelope when the cap is hit (FIFO drop) and emits EngineStep::OutboundDropped. None disables the cap.
DEFAULT_MAX_PENDING_ASYNC
Default cap on the number of in-flight DispatchResult::Async commands. Some(10_000) rejects further async dispatches with OpError("pending-async limit exceeded") once the cap is hit - protects against a runaway component returning Async(_) in a tight loop. None disables the cap.
DEFAULT_PER_HOP_BUDGET_NS
Default per-target-boundary-hop budget for sizing async deadlines on wire.Send NodeProtos. 100 ms in nanoseconds. The compiler’s analyze_wire_dependencies stamps a static chain_depth count on each Send; the engine multiplies by this budget at deadline-stamp time so a Send whose downstream chain reaches N target boundaries gets N * per_hop_budget_ns to respond.
EDGE_INGRESS_BYTE_BUDGET
Edge preset for NodeConfig::ingress_byte_budget. 8 MiB.
EDGE_MAX_APP_EVENT_BYTES
Edge preset for NodeConfig::max_app_event_bytes. 64 KiB.
EDGE_MAX_COMPLETION_RESULT_BYTES
Edge preset for NodeConfig::max_completion_result_bytes. 64 KiB.
EDGE_MAX_INVOKE_BYTES
Edge preset for NodeConfig::max_invoke_bytes. 256 KiB.
EDGE_MAX_INVOKE_INPUTS
Edge preset for NodeConfig::max_invoke_inputs. 16 inputs.