theStack
commented at 2:37 am on January 19, 2024:
contributor
This PR adds missing test coverage for disconnecting peers which don’t offer the desirable service flags in their VERSION message:
https://github.com/bitcoin/bitcoin/blob/5f3a0574c45477288bc678b15f24940486084576/src/net_processing.cpp#L3384-L3389
This check is relevant for the connection types “outbound-full-relay”, “block-relay-only” and “addr-fetch” (see CNode::ExpectServicesFromConn(...)). Feeler connections always disconnect, which is also tested here.
In lack of finding a proper file where this test would fit in, I created a new one. Happy to take suggestions there.
DrahtBot
commented at 2:37 am on January 19, 2024:
contributor
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
I guess one solution could be to add a send_version parameter to add_outbound_p2p_connection (like add_p2p_connection already has) to prevent the immediate sending of the version message. We could set that to false in the test and send the version message triggering the disconnect manually. Will set the PR to draft state until I have something working.
theStack marked this as a draft
on Jan 25, 2024
theStack force-pushed
on Jan 26, 2024
theStack
commented at 2:53 am on January 26, 2024:
contributor
Solved the flaky test issue by introducing a wait_for_disconnect parameter to add_p2p_outbound_connection, which hits the same code path as for feeler connections if set (i.e. waiting for immediate disconnect).
theStack marked this as ready for review
on Jan 26, 2024
in
test/functional/p2p_handshake.py:45
in
ff5f99400aoutdated
40+ with node.assert_debug_log([expected_debug_log]):
41+ self.check_outbound_disconnect(node, i, conn_type, services)
42+
43+ self.log.info("Check that feeler connections get disconnected immediately")
44+ with node.assert_debug_log(["feeler connection completed"]):
45+ self.check_outbound_disconnect(node, i+1, "feeler", 0)
stratospher
commented at 7:56 am on January 29, 2024:
ff5f994: nit: NODE_NONE here too?
stratospher
commented at 7:57 am on January 29, 2024:
contributor
tested ACKff5f994.
DrahtBot requested review from BrandonOdiwuor
on Jan 29, 2024
DrahtBot requested review from furszy
on Jan 29, 2024
DrahtBot requested review from delta1
on Jan 29, 2024
DrahtBot removed review request from delta1
on Jan 29, 2024
DrahtBot removed review request from BrandonOdiwuor
on Jan 29, 2024
DrahtBot requested review from delta1
on Jan 29, 2024
DrahtBot requested review from BrandonOdiwuor
on Jan 29, 2024
DrahtBot added the label
Needs rebase
on Jan 29, 2024
theStack force-pushed
on Jan 29, 2024
theStack
commented at 10:59 pm on January 29, 2024:
contributor
Rebased on master (after the merge of #24748 :tada: ), and tackled #29279 (review). Note that I tried enabling v2 transport for this test, but it seems that it is non-trivial and needs some deeper changes in the test framework regarding the order of version messages sent (see slightly related comment https://mirror.b10c.me/bitcoin-bitcoin/24748/#discussion_r1465420112). Will tackle that in a follow-up.
DrahtBot removed the label
Needs rebase
on Jan 30, 2024
stratospher
commented at 3:56 am on January 30, 2024:
contributor
ACKd82eafb173d6bfa98a59e86a845013cc8528b65d.
DrahtBot removed review request from delta1
on Jan 30, 2024
DrahtBot removed review request from BrandonOdiwuor
on Jan 30, 2024
DrahtBot requested review from BrandonOdiwuor
on Jan 30, 2024
DrahtBot requested review from delta1
on Jan 30, 2024
in
test/functional/p2p_handshake.py:35
in
d82eafb173outdated
30+
31+ def run_test(self):
32+ node = self.nodes[0]
33+ self.log.info("Check that lacking desired service flags leads to disconnect")
34+ for i, conn_type in enumerate(["outbound-full-relay", "block-relay-only", "addr-fetch"]):
35+ services = random.choice([NODE_NONE, NODE_NETWORK, NODE_WITNESS])
ACKd82eafb173d6bfa98a59e86a845013cc8528b65d
nit: Why not enumerate all combinations of services and connection types here?
epiccurious
commented at 2:23 am on February 11, 2024:
ACK this nit. Any reason to not include all here?
Empact
commented at 11:24 pm on February 22, 2024:
Benefits of enumerating: tests will be comprehensive and ensure that results can be consistently reproduced on every run, instead of being possibly flaky.
Costs: 9 instead of 3 iterations of this case.
Seems to weigh in favor of iteration - imo our tests should tend towards comprehensive and consistent.
theStack
commented at 12:51 pm on February 23, 2024:
Sorry for the extra-late reply! I agree that enumerating through the combinations makes sense. Since there is already a good number of ACKs, I prefer to tackle that in a follow-up, together with other proposed changes / new test coverage ideas (e.g. #29279 (review) and #29279#pullrequestreview-1860288188).
cbergqvist
commented at 2:49 pm on February 23, 2024:
(ACKing nit).
DrahtBot removed review request from BrandonOdiwuor
on Feb 2, 2024
DrahtBot removed review request from delta1
on Feb 2, 2024
DrahtBot requested review from BrandonOdiwuor
on Feb 2, 2024
DrahtBot requested review from delta1
on Feb 2, 2024
furszy
commented at 8:12 pm on February 2, 2024:
member
Now that #28170 has been merged, it would be good to include a test case for it.
The node should only connect to NODE_NETWORK_LIMITED peers when the local chain is within 24h window from the tip.
DrahtBot removed review request from BrandonOdiwuor
on Feb 2, 2024
DrahtBot removed review request from delta1
on Feb 2, 2024
DrahtBot requested review from BrandonOdiwuor
on Feb 2, 2024
DrahtBot requested review from furszy
on Feb 2, 2024
DrahtBot requested review from delta1
on Feb 2, 2024
glozow referenced this in commit
4572f48fd5
on Feb 6, 2024
DrahtBot removed review request from BrandonOdiwuor
on Feb 11, 2024
DrahtBot removed review request from delta1
on Feb 11, 2024
DrahtBot requested review from delta1
on Feb 11, 2024
DrahtBot requested review from BrandonOdiwuor
on Feb 11, 2024
epiccurious
commented at 2:27 am on February 11, 2024:
none
good to include a test case … only connect to NODE_NETWORK_LIMITED peers when the local chain is within 24h window from the tip
ACK
DrahtBot removed review request from delta1
on Feb 11, 2024
DrahtBot removed review request from BrandonOdiwuor
on Feb 11, 2024
DrahtBot requested review from delta1
on Feb 11, 2024
DrahtBot requested review from BrandonOdiwuor
on Feb 11, 2024
epiccurious
commented at 2:28 am on February 11, 2024:
none
utACKd82eafb173d6bfa98a59e86a845013cc8528b65d.
DrahtBot removed review request from delta1
on Feb 11, 2024
DrahtBot removed review request from BrandonOdiwuor
on Feb 11, 2024
DrahtBot requested review from delta1
on Feb 11, 2024
DrahtBot requested review from BrandonOdiwuor
on Feb 11, 2024
in
test/functional/p2p_handshake.py:28
in
d82eafb173outdated
nit: since we wait for the disconnect anyway it seems that passing a different p2p_idx each time isn’t necessary, so the test could be simplified a tiny bit
theStack
commented at 6:26 pm on February 28, 2024:
Good catch, done. The p2p_idx is now passed with a fixed value of zero.
fjahr
commented at 0:04 am on February 19, 2024:
contributor
tACKd82eafb173d6bfa98a59e86a845013cc8528b65d
DrahtBot removed review request from delta1
on Feb 19, 2024
DrahtBot removed review request from BrandonOdiwuor
on Feb 19, 2024
DrahtBot requested review from BrandonOdiwuor
on Feb 19, 2024
DrahtBot requested review from delta1
on Feb 19, 2024
DrahtBot removed review request from BrandonOdiwuor
on Feb 19, 2024
DrahtBot removed review request from delta1
on Feb 19, 2024
DrahtBot requested review from BrandonOdiwuor
on Feb 19, 2024
DrahtBot requested review from delta1
on Feb 19, 2024
DrahtBot removed review request from BrandonOdiwuor
on Feb 22, 2024
DrahtBot removed review request from delta1
on Feb 22, 2024
DrahtBot requested review from BrandonOdiwuor
on Feb 22, 2024
DrahtBot requested review from delta1
on Feb 22, 2024
DrahtBot removed review request from BrandonOdiwuor
on Feb 23, 2024
DrahtBot removed review request from delta1
on Feb 23, 2024
DrahtBot requested review from delta1
on Feb 23, 2024
DrahtBot requested review from BrandonOdiwuor
on Feb 23, 2024
cbergqvist
commented at 2:52 pm on February 23, 2024:
none
ACKd82eafb.
++Verbosity
Review
Test code is fairly clear.
Tested (23 Feb)
Ran ./test/functional/p2p_handshake.py a bunch of times unmodified and observed the different service flags being chosen randomly and tests succeeding.
Poked (27 Feb)
Modified p2p_handshake.py to always make the outbound connection have DESIRABLE_SERVICE_FLAGS. Observed that the outbound node would no longer get disconnected.
DrahtBot removed review request from delta1
on Feb 23, 2024
DrahtBot removed review request from BrandonOdiwuor
on Feb 23, 2024
DrahtBot requested review from delta1
on Feb 23, 2024
DrahtBot requested review from BrandonOdiwuor
on Feb 23, 2024
DrahtBot removed review request from delta1
on Feb 23, 2024
DrahtBot removed review request from BrandonOdiwuor
on Feb 23, 2024
DrahtBot requested review from delta1
on Feb 23, 2024
DrahtBot requested review from BrandonOdiwuor
on Feb 23, 2024
DrahtBot added the label
Needs rebase
on Feb 27, 2024
DrahtBot removed review request from delta1
on Feb 27, 2024
DrahtBot removed review request from BrandonOdiwuor
on Feb 27, 2024
DrahtBot requested review from BrandonOdiwuor
on Feb 27, 2024
DrahtBot requested review from delta1
on Feb 27, 2024
theStack force-pushed
on Feb 28, 2024
theStack
commented at 6:20 pm on February 28, 2024:
contributor
Thanks for the reviews! In the course of rebasing the PR, I’ve restructured it a bit to tackle all suggestions. A new method test_desirable_service_flags is now introduced, which exercises the combination of all relevant outbound connection types with a list of given service flags (see comment #29279 (review)). For testing the successful cases where no disconnect happens, a boolean parameter expect_disconnect is introduced. Lastly, another commit adds a test for the adaptive service flags logic introduced in #28170 (see comment #29279#pullrequestreview-1860288188). Support for --v2transport was also introduced.
The test cases are really simple now and could be extended quite a bit, but I think it’s a good start.
DrahtBot removed the label
Needs rebase
on Feb 28, 2024
in
test/functional/p2p_handshake.py:77
in
2f5b69eaeboutdated
61@@ -60,6 +62,13 @@ def run_test(self):
62 self.test_desirable_service_flags(node, [NODE_NONE, NODE_NETWORK, NODE_WITNESS], expect_disconnect=True)
63 self.test_desirable_service_flags(node, [NODE_NETWORK | NODE_WITNESS], expect_disconnect=False)
6465+ self.log.info("Check that limited peers are only desired if the local chain is close to the tip (<24h)")
66+ node.setmocktime(int(time.time()) + 25 * 3600) # tip outside the 24h window, should fail
67+ self.test_desirable_service_flags(node, [NODE_NETWORK_LIMITED | NODE_WITNESS], expect_disconnect=True)
68+ self.generate(node, 1) # catch up by mining a block
69+ node.setmocktime(int(time.time()) + 23 * 3600) # tip inside the 24h window, should succeed
nit: This is a bit redundant. Either mining the block or changing the mock time alone will make the following test succeed.
davidgumberg
commented at 5:00 am on March 4, 2024:
I think it’s a bug, since this causes ApproximateBestBlockDepth() to return a negative number, any positive value of NODE_NETWORK_LIMITED_ALLOW_CONN_BLOCKS will pass here.
One suggestion:
0 self.generate(node, 1) # catch up by mining a block
1 node.bumpmocktime(23 * 3600) # tip inside the 24h window, should succeed
I think it’s a bug, since this causes ApproximateBestBlockDepth() to return a negative number, any positive value of NODE_NETWORK_LIMITED_ALLOW_CONN_BLOCKS will pass here.
Good catch. What happened here was that the mock time was set to before the best block time (something that should never happen in practice), leading to a negative result. That was indeed not intended.
I decided to simply drop the generate call to keep the change simple.
fjahr
commented at 8:15 pm on February 28, 2024:
contributor
re-ACK2f5b69eaeb623a7b0306e7f41fd2d28741f131c0
DrahtBot removed review request from BrandonOdiwuor
on Feb 28, 2024
DrahtBot removed review request from delta1
on Feb 28, 2024
DrahtBot requested review from stratospher
on Feb 28, 2024
DrahtBot requested review from BrandonOdiwuor
on Feb 28, 2024
DrahtBot requested review from cbergqvist
on Feb 28, 2024
DrahtBot requested review from delta1
on Feb 28, 2024
DrahtBot requested review from epiccurious
on Feb 28, 2024
DrahtBot removed review request from BrandonOdiwuor
on Feb 28, 2024
DrahtBot removed review request from cbergqvist
on Feb 28, 2024
DrahtBot removed review request from delta1
on Feb 28, 2024
DrahtBot removed review request from epiccurious
on Feb 28, 2024
DrahtBot requested review from cbergqvist
on Feb 28, 2024
DrahtBot requested review from epiccurious
on Feb 28, 2024
DrahtBot requested review from BrandonOdiwuor
on Feb 28, 2024
DrahtBot requested review from delta1
on Feb 28, 2024
cbergqvist approved
cbergqvist
commented at 10:59 pm on February 28, 2024:
none
ACK2f5b69e!
Tried to make sense of git range-diff d82eafb~2..d82eafb 2f5b69e~3..2f5b69e but the GitHub Files changed view did help.
Ran
0./test/functional/p2p_handshake.py
and
0./test/functional/p2p_handshake.py --v2transport
a couple of times each.
DrahtBot removed review request from epiccurious
on Feb 28, 2024
DrahtBot removed review request from BrandonOdiwuor
on Feb 28, 2024
DrahtBot removed review request from delta1
on Feb 28, 2024
DrahtBot requested review from delta1
on Feb 28, 2024
DrahtBot requested review from epiccurious
on Feb 28, 2024
DrahtBot requested review from BrandonOdiwuor
on Feb 28, 2024
marcofleon
commented at 0:03 am on March 1, 2024:
contributor
Good work, ACK2f5b69eaeb623a7b0306e7f41fd2d28741f131c0. Read over the changes, built the PR, ran all functional tests and then individually ran p2p_handshake.py and p2p_handshake.py --v2transport. I also inverted some of the logic of expect_disconnect throughout the test. Everything passed/failed as expected.
The test is designed well and is easily extensible, so I’d say current test coverage is sufficient for merging.
DrahtBot removed review request from delta1
on Mar 1, 2024
DrahtBot removed review request from epiccurious
on Mar 1, 2024
DrahtBot removed review request from BrandonOdiwuor
on Mar 1, 2024
DrahtBot requested review from BrandonOdiwuor
on Mar 1, 2024
DrahtBot requested review from delta1
on Mar 1, 2024
DrahtBot requested review from epiccurious
on Mar 1, 2024
DrahtBot requested review from marcofleon
on Mar 1, 2024
DrahtBot removed review request from BrandonOdiwuor
on Mar 1, 2024
DrahtBot removed review request from delta1
on Mar 1, 2024
DrahtBot removed review request from epiccurious
on Mar 1, 2024
DrahtBot removed review request from marcofleon
on Mar 1, 2024
DrahtBot requested review from BrandonOdiwuor
on Mar 1, 2024
DrahtBot requested review from epiccurious
on Mar 1, 2024
DrahtBot requested review from delta1
on Mar 1, 2024
in
test/functional/test_framework/test_node.py:729
in
a991f1b5d1outdated
nit: Maybe it would be more flexible to just have a expect_success parameter here, and let the calling test deal with the waiting for the disconnect. That way, in future tests it could also be used to test for disconnections that happen before sending the version message (e.g. during the v2 handshake, similar to what #29431 does).
I looked a bit into that but decided to leave it as a follow-up, as it opens up some questions (e.g. should the treatment for feeler connections then also removed and the waiting happen on the caller side?).
mzumsande
commented at 6:45 pm on March 1, 2024:
contributor
Modified values and logic in HasAllDesirableServiceFlags and GetDesirableServiceFlags and verified that the tests added here complain.
It might be nice to have a test to ensure that we won’t evict manual or inbound connections for having bad service flags, but as far as I can tell, that would require more refactoring of the test framework, maybe in a follow-up.
One question that still lingers for me after reviewing this is why the limit for NETWORK_LIMITED being desirable (added in #28170) is: NODE_NETWORK_LIMITED_ALLOW_CONN_BLOCKS = 144; instead of 288 which is how many blocks BIP 159 requires NETWORK_LIMITED nodes to store.
DrahtBot removed review request from BrandonOdiwuor
on Mar 5, 2024
DrahtBot removed review request from marcofleon
on Mar 5, 2024
DrahtBot removed review request from epiccurious
on Mar 5, 2024
DrahtBot removed review request from delta1
on Mar 5, 2024
DrahtBot removed review request from cbergqvist
on Mar 5, 2024
DrahtBot requested review from cbergqvist
on Mar 5, 2024
DrahtBot requested review from epiccurious
on Mar 5, 2024
DrahtBot requested review from BrandonOdiwuor
on Mar 5, 2024
DrahtBot requested review from delta1
on Mar 5, 2024
DrahtBot requested review from marcofleon
on Mar 5, 2024
DrahtBot removed review request from cbergqvist
on Mar 5, 2024
DrahtBot removed review request from epiccurious
on Mar 5, 2024
DrahtBot removed review request from BrandonOdiwuor
on Mar 5, 2024
DrahtBot removed review request from delta1
on Mar 5, 2024
DrahtBot removed review request from marcofleon
on Mar 5, 2024
DrahtBot requested review from cbergqvist
on Mar 5, 2024
DrahtBot requested review from delta1
on Mar 5, 2024
DrahtBot requested review from BrandonOdiwuor
on Mar 5, 2024
DrahtBot requested review from marcofleon
on Mar 5, 2024
DrahtBot requested review from epiccurious
on Mar 5, 2024
DrahtBot removed review request from cbergqvist
on Mar 5, 2024
DrahtBot removed review request from delta1
on Mar 5, 2024
DrahtBot removed review request from BrandonOdiwuor
on Mar 5, 2024
DrahtBot removed review request from marcofleon
on Mar 5, 2024
DrahtBot removed review request from epiccurious
on Mar 5, 2024
DrahtBot requested review from epiccurious
on Mar 5, 2024
DrahtBot requested review from BrandonOdiwuor
on Mar 5, 2024
DrahtBot requested review from marcofleon
on Mar 5, 2024
DrahtBot requested review from delta1
on Mar 5, 2024
DrahtBot requested review from cbergqvist
on Mar 5, 2024
cbergqvist approved
cbergqvist
commented at 10:07 pm on March 6, 2024:
none
ACK49fbd57.
Still have some things to learn about git diffing it seems. I revoke my review of 2f5b69e and re-raise with this one now that I have absorbed a rough idea of NODE_NETWORK_LIMITED and ApproximateBestBlockDepth(). Cheers @davidgumberg!
nit: Would feel more comfortable if the test moved forwards in time instead of backwards, setting the node’s mocked hours to 23 before 25. I re-tested p2p_handshake.py with and without --v2transport, both with backwards time travel as currently implemented, and switching around the lines for forwards time travel (also tried a version using bumpmocktime() 2 hours which also worked, but may be less clear).
DrahtBot removed review request from epiccurious
on Mar 6, 2024
DrahtBot removed review request from BrandonOdiwuor
on Mar 6, 2024
DrahtBot removed review request from marcofleon
on Mar 6, 2024
DrahtBot removed review request from delta1
on Mar 6, 2024
DrahtBot requested review from epiccurious
on Mar 6, 2024
DrahtBot requested review from marcofleon
on Mar 6, 2024
DrahtBot requested review from BrandonOdiwuor
on Mar 6, 2024
DrahtBot requested review from delta1
on Mar 6, 2024
furszy
commented at 10:19 pm on March 6, 2024:
member
One question that still lingers for me after reviewing this is why the limit for NETWORK_LIMITED being desirable (added in #28170) is: NODE_NETWORK_LIMITED_ALLOW_CONN_BLOCKS = 144; instead of 288 which is how many blocks BIP 159 requires NETWORK_LIMITED nodes to store.
@davidgumberg start from this comment #28170#pullrequestreview-1825332930. We had the same conversation there.
DrahtBot removed review request from epiccurious
on Mar 6, 2024
DrahtBot removed review request from marcofleon
on Mar 6, 2024
DrahtBot removed review request from BrandonOdiwuor
on Mar 6, 2024
DrahtBot removed review request from delta1
on Mar 6, 2024
DrahtBot requested review from furszy
on Mar 6, 2024
DrahtBot requested review from epiccurious
on Mar 6, 2024
DrahtBot requested review from marcofleon
on Mar 6, 2024
DrahtBot requested review from BrandonOdiwuor
on Mar 6, 2024
DrahtBot requested review from delta1
on Mar 6, 2024
in
test/functional/p2p_handshake.py:21
in
b6c7ae6bdeoutdated
I think it is valid to assume that the limited peers that satisfy the 24 hour time frame are to be included the expected logic too. From a broader perspective, they act as normal peers but take too long due to the limitations they face.
b6c7ae6: shouldn’t we use NODE_NETWORK_LIMITED | NODE_WITNESS for pruned peers debug log in 49fbd57.
Indeed, good find. This worked because in the disconnect case, the desirable service flags (appearing in the log as “… does not offer the expected services …”) fall back to NODE_NETWORK | NODE_WITNESS, and in the successful case, the concrete desirable service flags are not tested anywhere. Reworked the last commit (see comment in main thread below).
DrahtBot removed review request from epiccurious
on Mar 7, 2024
DrahtBot removed review request from marcofleon
on Mar 7, 2024
DrahtBot removed review request from BrandonOdiwuor
on Mar 7, 2024
DrahtBot removed review request from delta1
on Mar 7, 2024
DrahtBot requested review from epiccurious
on Mar 7, 2024
DrahtBot requested review from delta1
on Mar 7, 2024
DrahtBot requested review from stratospher
on Mar 7, 2024
DrahtBot requested review from BrandonOdiwuor
on Mar 7, 2024
DrahtBot requested review from marcofleon
on Mar 7, 2024
DrahtBot removed review request from epiccurious
on Mar 7, 2024
DrahtBot removed review request from delta1
on Mar 7, 2024
DrahtBot removed review request from BrandonOdiwuor
on Mar 7, 2024
DrahtBot removed review request from marcofleon
on Mar 7, 2024
DrahtBot requested review from BrandonOdiwuor
on Mar 7, 2024
DrahtBot requested review from marcofleon
on Mar 7, 2024
DrahtBot requested review from epiccurious
on Mar 7, 2024
DrahtBot requested review from delta1
on Mar 7, 2024
DrahtBot removed review request from BrandonOdiwuor
on Mar 8, 2024
DrahtBot removed review request from marcofleon
on Mar 8, 2024
DrahtBot removed review request from epiccurious
on Mar 8, 2024
DrahtBot removed review request from delta1
on Mar 8, 2024
DrahtBot requested review from BrandonOdiwuor
on Mar 8, 2024
DrahtBot requested review from marcofleon
on Mar 8, 2024
DrahtBot requested review from delta1
on Mar 8, 2024
DrahtBot requested review from epiccurious
on Mar 8, 2024
test: p2p: support disconnect waiting for `add_outbound_p2p_connection`
Adds a new boolean parameter `wait_for_disconnect` to the
`add_outbound_p2p_connection` method. If set, the node under
test is checked to disconnect immediately after receiving the
version message (same logic as for feeler connections).
405ac819af
test: p2p: check disconnect due to lack of desirable service flagsc4a67d396d
test: p2p: check limited peers desirability (depending on best block depth)
This adds coverage for the logic introduced in PR #28170
("p2p: adaptive connections services flags").
2f23987849
theStack force-pushed
on Mar 11, 2024
theStack
commented at 2:42 pm on March 11, 2024:
contributor
Force-pushed with rebase on master and tackled comment #29279 (review).
I reworked the test_desirable_service_flags method in the last commit by introducing a new desirable_service_flags parameter that has to be passed. Also, there are now two constants DESIRABLE_SERVICE_FLAGS_FULL and DESIRABLE_SERVICE_FLAGS_PRUNED with a comment that the latter is dynamic. Hope that this all is not considered too confusing. Re-review would be much appreciated!
davidgumberg
commented at 3:14 am on March 12, 2024:
contributor
Looks good, retested by modifying HasAllDesirableServiceFlags and ExpectServicesFromConn
DrahtBot requested review from fjahr
on Mar 12, 2024
DrahtBot requested review from cbergqvist
on Mar 12, 2024
in
test/functional/p2p_handshake.py:78
in
2f23987849
76+ self.log.info("Check that limited peers are only desired if the local chain is close to the tip (<24h)")
77+ node.setmocktime(int(time.time()) + 25 * 3600) # tip outside the 24h window, should fail
78+ self.test_desirable_service_flags(node, [NODE_NETWORK_LIMITED | NODE_WITNESS],
79+ DESIRABLE_SERVICE_FLAGS_FULL, expect_disconnect=True)
80+ node.setmocktime(int(time.time()) + 23 * 3600) # tip inside the 24h window, should succeed
81+ self.test_desirable_service_flags(node, [NODE_NETWORK_LIMITED | NODE_WITNESS],
nit: The DESIRABLE_SERVICE_FLAGS_* above are the same as the combinations passed as service_flag_tests so that variable could have been used in both places IMO (with a slight rename maybe). But this isn’t critical.
fjahr
commented at 7:06 pm on March 12, 2024:
contributor
re-utACK2f23987849758537f76df7374d85a7e87b578b61
(CI failure can be ignored)
cbergqvist approved
cbergqvist
commented at 12:11 pm on March 14, 2024:
none
re ACK2f23987849758537f76df7374d85a7e87b578b61
Built & re-ran test/functional/test_runner.py --cachedir=/mnt/tmp/cache --tmpdir=/mnt/tmp.
stratospher
commented at 3:53 am on March 15, 2024:
contributor
tested ACK2f23987. 🚀
itornaza
commented at 8:03 pm on March 18, 2024:
none
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: 2024-11-24 03:12 UTC
This site is hosted by @0xB10C More mirrored repositories can be found on mirror.b10c.me