@@ -247,6 +247,8 @@ def run_test(self):
247247 node0 .invalidateblock (extra_hash )
248248 assert_equal (node0 .getblockcount (), base_height )
249249 node0 .setnetworkactive (True )
250+ for node_index in range (1 , len (self .nodes )):
251+ self .connect_nodes (0 , node_index )
250252 force_finish_mnsync (node0 )
251253 self .sync_all ()
252254 self .wait_for_sporks_same ()
@@ -418,7 +420,13 @@ def assert_unfaked_snapshot_counts(background_height):
418420 self .disconnect_nodes (snapshot_index , 0 )
419421
420422 completed , = snapshot_node .getchainstates ()["chainstates" ]
421- assert_equal (completed ["blocks" ], base_height )
423+ # The rollback helper rolls the isolated block forward before writing.
424+ # Once its header is later announced to the reconnected network, the
425+ # quorum can ChainLock it and override the local invalidation used to
426+ # hold the fixture at the snapshot base.
427+ final_height = base_height + 1
428+ assert_equal (completed ["blocks" ], final_height )
429+ assert_equal (snapshot_node .getbestblockhash (), extra_hash )
422430 assert_equal (completed ["validated" ], True )
423431 assert_equal (completed ["snapshot_blockhash" ], base_hash )
424432 assert_equal (
@@ -438,7 +446,7 @@ def assert_unfaked_snapshot_counts(background_height):
438446 ):
439447 self .restart_node (snapshot_index , extra_args = snapshot_args )
440448 cleaned , = snapshot_node .getchainstates ()["chainstates" ]
441- assert_equal (cleaned ["blocks" ], base_height )
449+ assert_equal (cleaned ["blocks" ], final_height )
442450 assert_equal (cleaned ["validated" ], True )
443451 assert "snapshot_blockhash" not in cleaned
444452 assert not (snapshot_node .chain_path / "chainstate_snapshot" ).exists ()
@@ -447,7 +455,7 @@ def assert_unfaked_snapshot_counts(background_height):
447455 self .log .info ("Restart once more after cleanup" )
448456 self .restart_node (snapshot_index , extra_args = snapshot_args )
449457 final_state , = snapshot_node .getchainstates ()["chainstates" ]
450- assert_equal (final_state ["blocks" ], base_height )
458+ assert_equal (final_state ["blocks" ], final_height )
451459 assert_equal (final_state ["validated" ], True )
452460 assert "snapshot_blockhash" not in final_state
453461
0 commit comments