This PR moves global util.py implementations of sync_blocks and sync_mempools to framework/test_framework.py member functions.
Additionally, it updates feature_backwards_compatibility.py-test to use these new member functions.
Fixes #18930
26 | @@ -27,9 +27,7 @@ 27 | 28 | from test_framework.util import ( 29 | adjust_bitcoin_conf_for_pre_17, 30 | - assert_equal, 31 | - sync_blocks, 32 | - sync_mempools, 33 | + assert_equal
nit: Please keep the trailing comma to minimize this diff and future diffs, as well as guiding editors with formatting.
29 | @@ -30,9 +30,7 @@ 30 | connect_nodes, 31 | disconnect_nodes, 32 | get_datadir_path, 33 | - initialize_datadir, 34 | - sync_blocks, 35 | - sync_mempools, 36 | + initialize_datadir
same
Approach ACK (only looked at the diff on GitHub)
Co-authored-by: MarcoFalke <falke.marco@gmail.com>
528 | - sync_mempools(nodes or self.nodes, **kwargs) 529 | + sync_blocks needs to be called with an rpc_connections set that has least 530 | + one node already synced to the latest, stable tip, otherwise there's a 531 | + chance it might return before all nodes are stably synced. 532 | + """ 533 | + stop_time = time.time() + timeout
The timeout should be scaled by self.factor, no? If yes, please add a commit for that.
Wasn't aware of it as the methods weren't adapted in the factor-PR. Have used the original self.options.factor property to adjust timeouts for both methods.
I liked the solution. Looking forward to seeing this reopened :)
Me too -- please consider re-opening :)