You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Merge bitcoin#24021: Rename and move PoissonNextSend functions
9b8dcb2 [net processing] Rename PoissonNextSendInbound to NextInvToInbounds (John Newbery)
ea99f5d [net processing] Move PoissonNextSendInbound to PeerManager (John Newbery)
bb06074 scripted-diff: replace PoissonNextSend with GetExponentialRand (John Newbery)
03cfa1b [refactor] Use uint64_t and std namespace in PoissonNextSend (John Newbery)
9e64d69 [move] Move PoissonNextSend to src/random and update comment (John Newbery)
Pull request description:
`PoissonNextSend` and `PoissonNextSendInbound` are used in the p2p code to obfuscate various regularly occurring processes, in order to make it harder for others to get timing-based information deterministically.
The naming of these functions has been confusing to several people (including myself, see also bitcoin#23347) because the resulting random timestamps don't follow a Poisson distribution but an exponential distribution (related to events in a Poisson process, hence the name). This PR
- moves `PoissonNextSend()` out of `net` to `random` and renames it to `GetExponentialRand()`
- moves `PoissonNextSendInbound()` out of `CConnman` to `PeerManager` and renames it to `NextInvToInbounds()`
- adds documentation for these functions
This is work by jnewbery - due to him being less active currently, I opened the PR and will address feedback.
ACKs for top commit:
jnewbery:
ACK 9b8dcb2
hebasto:
ACK 9b8dcb2, I have reviewed the code and it looks OK, I agree it can be merged.
theStack:
ACK 9b8dcb2 📊
Tree-SHA512: 85c366c994e7147f9981fe863fb9838502643fa61ffd32d55a43feef96a38b79a5daa2c4d38ce01074897cc95fa40c76779816edad53f5265b81b05c3a1f4f50
0 commit comments