decred / dcrd

Decred daemon in Go (golang).
https://decred.org
ISC License
731 stars 289 forks source link

mixclient: Introduce random message jitter #3388

Closed jrick closed 1 month ago

jrick commented 1 month ago

In this change, random per-peer (per-identity) and per-message jitter are added to add additional delay to all message broadcasts. The jitter delay will range from 0-3s, with a random 0-2700ms of that being per-peer and 0-300ms being per-message. The total delay is calculated as 1/10 of the stage timeout duration, and the per-message delay is calculated is both the mean and median of dcrd's inventory trickling delay.

While here, pair request messages are also submitted to the network with random delays spanning over the entire epoch duration, while avoiding any PR sends during the 30s before and after the epoch.