test: deduplicates p2p_tx_download constants #31758
pull sr-gi wants to merge 1 commits into bitcoin:master from sr-gi:deduplicate-p2p-contants changing 1 files +19 −20-
sr-gi commented at 7:13 pm on January 29, 2025: memberSome of the networking constants defined in p2p_tx_download.py are more generally defined in p2p.py
-
DrahtBot commented at 7:13 pm on January 29, 2025: contributor
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
Code Coverage & Benchmarks
For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/31758.
Reviews
See the guideline for information on the review process.
Type Reviewers ACK i-am-yuvi, danielabrozzoni, tdb3, maflcko If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.
Conflicts
No conflicts as of last run.
-
DrahtBot added the label Tests on Jan 29, 2025
-
in test/functional/p2p_tx_download.py:52 in efeaf2e0c1 outdated
45@@ -43,13 +46,10 @@ def on_getdata(self, message): 46 47 48 # Constants from net_processing 49-GETDATA_TX_INTERVAL = 60 # seconds 50 INBOUND_PEER_TX_DELAY = 2 # seconds 51-TXID_RELAY_DELAY = 2 # seconds 52 OVERLOADED_PEER_DELAY = 2 # seconds 53 MAX_GETDATA_IN_FLIGHT = 100 54 MAX_PEER_TX_ANNOUNCEMENTS = 5000
tdb3 commented at 1:38 am on January 30, 2025:Maybe it’s worth migrating some of these top2p.py
as well?
sr-gi commented at 5:03 pm on January 30, 2025:I thought about this, but some of these are only used in this test.
I just realized that some of them were even duplicated amongst themselves. For instance,
INBOUND_PEER_TX_DELAY
andNONPREF_PEER_TX_DELAY
refer to the same concept.I’ll do a second pass to further trim this
tdb3 approvedtdb3 commented at 1:39 am on January 30, 2025: contributorACK efeaf2e0c1f0de0d7c3819eb9beaefee2ddf0710i-am-yuvi approvedi-am-yuvi commented at 5:47 am on January 30, 2025: contributorACK efeaf2e0c1f0de0d7c3819eb9beaefee2ddf0710
0TEST | STATUS | DURATION 1 2p2p_tx_download.py | ✓ Passed | 33 s 3 4ALL | ✓ Passed | 33 s (accumulated)
sr-gi force-pushed on Jan 30, 2025sr-gi commented at 5:17 pm on January 30, 2025: member@tdb3 I de-duplicated even more, plus renamed some of the remaining ones to match the actual names in
txdownloadman.h
(and updated the comment referring tonet_processing
, given the constants do not live there anymore).As mentioned in-line, notice how
INBOUND_PEER_TX_DELAY
andNONPREF_PEER_TX_DELAY
refer to the same concept. The latter was introduced in #20171 instead of remaining (or re-using) the former.in test/functional/p2p_tx_download.py:52 in 2b94e1abbf outdated
52-TXID_RELAY_DELAY = 2 # seconds 53-OVERLOADED_PEER_DELAY = 2 # seconds 54-MAX_GETDATA_IN_FLIGHT = 100 55+# Constants from txdownloadman 56+MAX_PEER_TX_REQUEST_IN_FLIGHT = 100 57 MAX_PEER_TX_ANNOUNCEMENTS = 5000
tdb3 commented at 1:07 am on January 31, 2025:nit: Not a blocker, but would it make sense for all of these types of constants to live inp2p.py
?
sr-gi commented at 3:45 pm on January 31, 2025:I don’t have a strong opinion on this.
I’ve checked and looks like no other test uses this, or re-defines it. I’d lean towards leaving it locally to avoid bloating
p2p.py
, but I’m open to move it if there is support for it
tdb3 commented at 3:48 pm on January 31, 2025:Works for me. If/when the file is touched again, it could be moved then.tdb3 approvedtdb3 commented at 1:07 am on January 31, 2025: contributorACK 2b94e1abbfdef058546221d63f53b0b58eea22ea
Nice cleanup
DrahtBot requested review from i-am-yuvi on Jan 31, 2025i-am-yuvi approvedi-am-yuvi commented at 5:33 pm on February 1, 2025: contributorre-ACK 2b94e1abbfdef058546221d63f53b0b58eea22eadanielabrozzoni approveddanielabrozzoni commented at 3:30 pm on February 3, 2025: contributortACK 2b94e1abbfdef058546221d63f53b0b58eea22ea
The code looks good to me, I think renaming
MAX_GETDATA_IN_FLIGHT
toMAX_PEER_TX_REQUEST_IN_FLIGHT
makes it easier to refer back to txdownloadmanDrahtBot added the label Needs rebase on Feb 5, 2025test: deduplicates p2p_tx_download constants
Some of the networking constants defined in p2p_tx_download.py are more generally defined in p2p.py Also, rename the remaining ones to match ones defined in txdownloadman
sr-gi force-pushed on Feb 6, 2025DrahtBot removed the label Needs rebase on Feb 6, 2025sr-gi commented at 3:56 pm on February 6, 2025: memberRebased to fix merge conflicts.
Thanks for the review @tdb3 @danielabrozzoni @i-am-yuvi
i-am-yuvi commented at 7:42 pm on February 6, 2025: contributorre-ACK 0a02e7fdeaca26455b3710ef76b11101ac816e53DrahtBot requested review from tdb3 on Feb 6, 2025DrahtBot requested review from danielabrozzoni on Feb 6, 2025sr-gi commented at 4:28 pm on February 13, 2025: member@tdb3 @danielabrozzoni can you give this another look? The changes should be trivialdanielabrozzoni commented at 5:14 pm on February 13, 2025: contributorWhoops, I had forgotten about this one :)
re-ACK 0a02e7fdeaca26455b3710ef76b11101ac816e53
tdb3 approvedtdb3 commented at 0:55 am on February 14, 2025: contributorre ACK 0a02e7fdeaca26455b3710ef76b11101ac816e53maflcko commented at 6:34 am on February 14, 2025: memberreview ACK 0a02e7fdeaca26455b3710ef76b11101ac816e53 🔖
Signature:
0untrusted comment: signature from minisign secret key on empty file; verify via: minisign -Vm "${path_to_any_empty_file}" -P RWTRmVTMeKV5noAMqVlsMugDDCyyTSbA3Re5AkUrhvLVln0tSaFWglOw -x "${path_to_this_whole_four_line_signature_blob}" 1RUTRmVTMeKV5npGrKx1nqXCw5zeVHdtdYURB/KlyA/LMFgpNCs+SkW9a8N95d+U4AP1RJMi+krxU1A3Yux4bpwZNLvVBKy0wLgM= 2trusted comment: review ACK 0a02e7fdeaca26455b3710ef76b11101ac816e53 🔖 3jwepvbYV1gQLs1UZ9KxP6py22frJ6KEnwpkEv92Yl2aCC/5z7nmNDGrLnib/Rr1nVykvGBpPblkyvCq8YjX2AQ==
fanquake merged this on Feb 14, 2025fanquake closed this on Feb 14, 2025
This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2025-02-22 06:12 UTC
More mirrored repositories can be found on mirror.b10c.me