resolves #32965.
node1 (with 24 blocks) causes node0 (with 6 blocks + 1 extra header) to silently reorg. so move the subtest to a point before the 20 blocks are generated so that node1's state doesn't cause node0 to silently reorg.
resolves #32965.
node1 (with 24 blocks) causes node0 (with 6 blocks + 1 extra header) to silently reorg. so move the subtest to a point before the 20 blocks are generated so that node1's state doesn't cause node0 to silently reorg.
<!--e57a25ab6845829454e8d69fc972939a-->
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
<!--006a51241073e994b41acfe9ec718e94-->
For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/32968.
<!--021abf342d371248e50ceaed478a90ca-->
See the guideline for information on the review process.
If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.
<!--5faf32d7da4f0f540f40219e4f7537a3-->
Possible typos and grammar issues:
<sup>drahtbot_id_4_m</sup>
100 | @@ -101,6 +101,7 @@ def run_test(self): 101 | assert_equal(self.nodes[0].getbestblockhash(), blockhash_3) 102 | assert_equal(self.nodes[0].getblockchaininfo()['blocks'], 3) 103 | assert_equal(self.nodes[0].getblockchaininfo()['headers'], 3) 104 | + self.disconnect_nodes(0, 1)
This means in the remainder of the test, the state of the two nodes shouldn't affect each other. So the reconsiderblock+test
assert_equal(self.nodes[0].getbestblockhash(), blockhash_6)
assert_equal(self.nodes[0].getblockchaininfo()['blocks'], 6)
assert_equal(self.nodes[0].getblockchaininfo()['headers'], 7)
Can be moved after this line to disconnect the nodes? This would bundle the tests more nicely, but no strong opinion.
yeah makes sense, I guess this was the reason some of the test was moved up in #30479 (comment)
lgtm ACK 4aa0e4d9ce6283665b1aac185da67543b8df606e
Also, left a nit/questsion
node1 (with 24 blocks) causes node0 (with 6 blocks) to silently
reorg. so move the subtest to a point before the 20 blocks are
generated so that node1's state doesn't cause node0 to silently
reorg.
101 | @@ -102,6 +102,14 @@ def run_test(self): 102 | assert_equal(self.nodes[0].getblockchaininfo()['blocks'], 3) 103 | assert_equal(self.nodes[0].getblockchaininfo()['headers'], 3) 104 | 105 | + # Reconsider the header 106 | + self.nodes[0].reconsiderblock(block.hash) 107 | + # Since header doesn't have block data, it can't be chain tip
“Since header doesn't have block data, it can't be chain tip” -> “Since the header doesn't have block data, it can't be the chain tip” [missing definite articles]
lgtm ACK 28416f367a5d720d89214aa8ef94013caa1d1a40
Can be tested via by moving the lines after self.nodes[0].reconsiderblock(block.hash) down again and observing a failure.
Code Review ACK 28416f367a5d720d89214aa8ef94013caa1d1a40