@@ -7,8 +7,7 @@ use codec::Encode;
77use log:: { debug, info} ;
88use sp_core:: Bytes ;
99use sp_statement_store:: {
10- RejectionReason , Statement , StatementAllowance , SubmitResult , Topic ,
11- TopicFilter ,
10+ RejectionReason , Statement , StatementAllowance , SubmitResult , Topic , TopicFilter ,
1211} ;
1312
1413use sc_statement_store:: test_utils:: { create_allowance_items, create_test_statement, get_keypair} ;
@@ -388,14 +387,14 @@ async fn statement_store_crash_mid_sync() -> Result<(), anyhow::Error> {
388387/// Scenario:
389388/// 1. Spawn charlie only and let the relay chain advance ~10 blocks
390389/// 2. Submit a statement to charlie
391- /// 3. Add dave as a late joiner — dave will enter major sync because the chain has
392- /// already progressed. While dave is major syncing, its statement handler ignores
393- /// incoming notifications, so the initial sync batch from charlie is dropped
390+ /// 3. Add dave as a late joiner — dave will enter major sync because the chain has already
391+ /// progressed. While dave is major syncing, its statement handler ignores incoming
392+ /// notifications, so the initial sync batch from charlie is dropped
394393/// 4. Wait for dave to exit major sync
395- /// 5. Subscribe to statements on dave AFTER sync has ended — any arrival is therefore
396- /// caused exclusively by the reconnect triggered at sync completion
397- /// 6. Assert the statement arrives, proving that `reconnect_statement_peers` fired and
398- /// triggered a fresh initial sync with charlie
394+ /// 5. Subscribe to statements on dave AFTER sync has ended — any arrival is therefore caused
395+ /// exclusively by the reconnect triggered at sync completion
396+ /// 6. Assert the statement arrives, proving that `reconnect_statement_peers` fired and triggered a
397+ /// fresh initial sync with charlie
399398///
400399/// Without the fix (reconnect_statement_peers on sync-end), the subscription would time
401400/// out because nothing re-triggers the initial sync after major sync completes
@@ -464,18 +463,11 @@ async fn statement_store_peer_disconnect_during_major_sync() -> Result<(), anyho
464463 let dave_rpc = dave. rpc ( ) . await ?;
465464
466465 // Wait for dave to reach charlie's block height
467- dave. wait_metric_with_timeout (
468- "block_height{status=\" best\" }" ,
469- |h| h >= charlie_height,
470- 120u64 ,
471- )
472- . await
473- . map_err ( |_| {
474- anyhow:: anyhow!(
475- "Dave did not reach block height {:.0} within 120s" ,
476- charlie_height
477- )
478- } ) ?;
466+ dave. wait_metric_with_timeout ( "block_height{status=\" best\" }" , |h| h >= charlie_height, 120u64 )
467+ . await
468+ . map_err ( |_| {
469+ anyhow:: anyhow!( "Dave did not reach block height {:.0} within 120s" , charlie_height)
470+ } ) ?;
479471 let sync_end = dave_join_time. elapsed ( ) ;
480472 info ! ( "Dave reached block height {:.0} after {:.1}s" , charlie_height, sync_end. as_secs_f64( ) ) ;
481473
0 commit comments