[bounty] [test] Functional test for average ms delay between trickled INV transmission in !746
A bounty of 5 BCH is set for a functional test to show that the -txbroadcastinterval
parameter works as expected. See 'Bounty rules' at the end.
Background
!746 (merged) introduces two new parameters, of which -txbroadcastinterval
regulates the "broadcast interval".
This is supposed to be the average time (in ms) between broadcasts of transaction INV messages.
In net.cpp, the PoissonNextSend
and PoissonNextSendInbound
functions are called to obtain exponential variates of the future time to send the next INV (to outbound and inbound peers respectively).
Requirements
The functional test (a new Python test in test/functional/bchn-txbroadcastinterval.py
) should collect samples of the broadcast interval for some non-extreme values of -txbroadcastinterval
and statistically test against the null hypothesis that these samples are exponentially distributed with average equal to the given interval parameter.
NOTE: the intervals for inbound and outbound peers are differentiated by the code. Your test will need to cover both cases.
The statistical testing can be done using a Kolmorogov-Smirnov goodness-of-fit test using the stats.kstest
method from the scipy
module. It is recommended to use this test, but others in scipy
may also be used if you can motivate it adequately. We leave it to you to decide on the significance level that you want to apply in your test. We anticipate that such a test will break down at very low interval values, and your submission should demonstrate that you have investigated where your test starts to fail and thus motivate your choice of parameter ranges.
The test development should build on the code presented in !746 (merged). It can assume that SciPy v1.1.0 is available (this version is natively available on Debian 10). This is not yet included in our build/installation documentation or CI, but it will be readied for this new test and future ones like it.
To develop the test you will need to install scipy for Python3 (e.g. the python3-scipy
package on Debian/Ubuntu) using your package manager.
Bounty rules
This bounty will only be awarded to one entrant (can be a group though). A successful entry must fulfil the requirements described above. If you have questions, please ask before or during your work.
To participate in this bounty, we strongly advise to join BCHN slack (shareable invite link) and let us know in the #dev-general
channel that you want to work on it.
We can then tell you if other entrants are so close to a solution that you might be wasting your time, or whether it makes sense to proceed.
We generally prefer if entrants contact and discuss with us on Slack prior to embarking, rather than only submitting a supposedly complete solution via GitLab.
We also prefer only one entrant (or team) working on one bounty at a time, unless otherwise specified.
Our suggestion is that if you do bounty development work, do so in a private repo and share the testable product with us privately so that others do not snipe your work with low effort before it's done.
In some cases, at the discretion of the project team, we will accept partial results and award partial bounties. A prerequisite is that you let us know that you've reached a stopping point in your work, and publish it.
If you do your bounty work in the open using a Merge Request, please mark it as 'WIP' or 'Draft' until such time as it is completed and ready for review.