mirror of
https://github.com/lightningnetwork/lnd.git
synced 2026-08-13 12:32:48 +02:00
This commit adds per-peer backpressure control to the onion message actor system by introducing a BackpressureMailbox that uses Random Early Detection (RED) to probabilistically drop messages when the per-peer queue depth exceeds a configurable threshold. The OnionActorFactory type now accepts variadic ActorOptions, allowing the spawn call site (brontide) to provide per-peer mailbox configuration. A DefaultOnionActorOpts helper provides the standard RED thresholds so callers don't need to wire up the BackpressureMailbox manually. Key changes: - OnionActorFactory signature extended with ...ActorOption[*Request, *Response] so backpressure policy is no longer baked into the factory. - NewOnionActorFactory drops its shouldDrop parameter; it forwards opts through to serviceKey.Spawn. - DefaultOnionActorOpts(shouldDrop) returns the default backpressure options (BackpressureMailbox + DefaultOnionMailboxSize). - peer.Config gains OnionActorOpts callback for per-peer customization. - server.go creates default opts once and returns them for every peer. |
||
|---|---|---|
| .. | ||
| brontide.go | ||
| brontide_test.go | ||
| chan_observer.go | ||
| daemon_adapters.go | ||
| interfaces.go | ||
| log.go | ||
| musig_chan_closer.go | ||
| musig_nonce_order_test.go | ||
| ping_manager.go | ||
| ping_manager_test.go | ||
| setup_test.go | ||
| test_utils.go | ||