This makes calls to such methods more explicit and less error-prone.
Motivated by #29736 (review)
This makes calls to such methods more explicit and less error-prone.
Motivated by #29736 (review)
<!--e57a25ab6845829454e8d69fc972939a-->
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
<!--006a51241073e994b41acfe9ec718e94-->
For detailed information about the code coverage, see the test coverage report.
<!--021abf342d371248e50ceaed478a90ca-->
See the guideline for information on the review process.
| Type | Reviewers |
|---|---|
| ACK | maflcko, brunoerg, BrandonOdiwuor, AngusP, stratospher |
| Concept ACK | kevkevinpal |
If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.
<!--174a7506f384e20aa4161008e828411d-->
Reviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.
Concept ACK 985d4d4
This makes calls to such methods more explicit and less error prone
lgtm ACK 61560d5e939034e1a94d95cdc5c498095ab4fddb
ACK 61560d5e939034e1a94d95cdc5c498095ab4fddb
crACK 61560d5e939034e1a94d95cdc5c498095ab4fddb
197 | @@ -198,15 +198,15 @@ def announce_block_and_wait_for_getdata(self, block, use_header, timeout=60): 198 | self.send_message(msg) 199 | else: 200 | self.send_message(msg_inv(inv=[CInv(MSG_BLOCK, block.sha256)])) 201 | - self.wait_for_getheaders() 202 | + self.wait_for_getheaders(timeout=timeout) 203 | self.send_message(msg) 204 | - self.wait_for_getdata([block.sha256]) 205 | + self.wait_for_getdata([block.sha256], timeout=timeout)
Nit: default timeout=60, but that's 60 secs for each inner function that takes a timeout, so the total timeout for announce_block_and_wait_for_getdata is 120 in this case.
Probably fine, but potentially confusing, i.e. announce_block_and_wait_for_getdata(..., timeout=60) can actually run for ~120 seconds. An alternative would be something like timeout=timeout//2 on wait_for_getheaders and wait_for_getdata but that doesn't seem much better to me. More complex could be to subtract 'already spent time' from timeout after each inner wait_* call?
Also nit: should timeout on announce_block_and_wait_for_getdata also be kwargs only?
Nit: default timeout=60, but that's 60 secs for each inner function that takes a timeout, so the total timeout for announce_block_and_wait_for_getdata is 120 in this case.
the first 60 second timeout would cause the test to crash and we wouldn't wait around for the next crash to happen :)
Also nit: should timeout on announce_block_and_wait_for_getdata also be kwargs only?
don't think it's worth it since it's only a local function used in 1 file.
the first 60 second timeout would cause the test to crash and we wouldn't wait around for the next crash to happen :)
I meant if the first took say 59s to succeed then the second another 59s, but yeah it's not really an issue
Nit: default timeout=60, but that's 60 secs for each inner function that takes a timeout, so the total timeout for announce_block_and_wait_for_getdata is 120 in this case.
the first 60 second timeout would cause the test to crash and we wouldn't wait around for the next crash to happen :)
Also nit: should timeout on announce_block_and_wait_for_getdata also be kwargs only?
don't think it's worth it since it's only a local function used in 1 file.
Yeah, this was my intuition too. The same applies to the total timeout, I think it'd be worth if this was used outside the context of this file, but it is actually only used in a single test
ACK 61560d5e939034e1a94d95cdc5c498095ab4fddb
tested ACK 61560d5.
rfm?