@@ -37,7 +37,12 @@ const RETRY_DELAY_S: u64 = 10;
37
37
const LOG_ITERATION_DELAY_MS : u64 = 200 ;
38
38
39
39
#[ cfg( not( feature = "simulation-mode" ) ) ]
40
- const DEFAULT_NODES : & [ & str ] = & [ "nick.hypr" , "nick1udwig.os" ] ;
40
+ const DEFAULT_NODES : & [ & str ] = & [
41
+ "us-cacher-1.hypr" ,
42
+ "eu-cacher-1.hypr" ,
43
+ "nick.hypr" ,
44
+ "nick1udwig.os" ,
45
+ ] ;
41
46
#[ cfg( feature = "simulation-mode" ) ]
42
47
const DEFAULT_NODES : & [ & str ] = & [ "fake.os" ] ;
43
48
@@ -784,22 +789,15 @@ impl State {
784
789
self . last_cached_block + 1
785
790
) ;
786
791
787
- // Only run RPC bootstrap if we're behind the current chain head
788
- let current_chain_head = hypermap. provider . get_block_number ( ) ?;
789
- if self . last_cached_block < current_chain_head {
790
- self . cache_logs_and_update_manifest ( hypermap) ?;
792
+ // Catch up remainder (or as fallback) using RPC
793
+ self . cache_logs_and_update_manifest ( hypermap) ?;
794
+
795
+ // run it twice for fresh boot case:
796
+ // - initial bootstrap takes much time
797
+ // - in that time, the block you are updating to is no longer the head of the chain
798
+ // - so run again to get to the head of the chain
799
+ self . cache_logs_and_update_manifest ( hypermap) ?;
791
800
792
- // run it twice for fresh boot case:
793
- // - initial bootstrap takes much time
794
- // - in that time, the block you are updating to is no longer the head of the chain
795
- // - so run again to get to the head of the chain
796
- self . cache_logs_and_update_manifest ( hypermap) ?;
797
- } else {
798
- info ! (
799
- "Already caught up to chain head ({}), no RPC bootstrap needed" ,
800
- current_chain_head
801
- ) ;
802
- }
803
801
Ok ( ( ) )
804
802
}
805
803
@@ -1184,10 +1182,13 @@ fn main_loop(
1184
1182
info ! ( "Last cached block: {}" , state. last_cached_block) ;
1185
1183
1186
1184
// Always bootstrap on start to get latest state from other nodes or RPC
1187
- if state. is_starting {
1185
+ while state. is_starting {
1188
1186
match state. bootstrap_state ( hypermap) {
1189
1187
Ok ( _) => info ! ( "Bootstrap process completed successfully." ) ,
1190
- Err ( e) => error ! ( "Error during bootstrap process: {:?}" , e) ,
1188
+ Err ( e) => {
1189
+ error ! ( "Error during bootstrap process: {:?}" , e) ;
1190
+ std:: thread:: sleep ( std:: time:: Duration :: from_secs ( RETRY_DELAY_S ) ) ;
1191
+ }
1191
1192
}
1192
1193
}
1193
1194
0 commit comments