@@ -20,7 +20,7 @@ use tracing::debug;
2020/// Caches commits to be applied later. This flow is only relevant while the node is starting up.
2121#[ derive( Clone ) ]
2222pub struct Bootstrapper {
23- pub catch_up_height : BlockNumber ,
23+ pub target_height : BlockNumber ,
2424 pub sync_retry_interval : Duration ,
2525 pub commit_block_backlog : Vec < CommitBlockBacklog > ,
2626 pub l1_provider_client : SharedL1ProviderClient ,
@@ -49,13 +49,13 @@ impl Bootstrapper {
4949 n_sync_health_check_failures : Default :: default ( ) ,
5050 // This is overriden when starting the sync task (e.g., when provider starts
5151 // bootstrapping).
52- catch_up_height : BlockNumber ( 0 ) ,
52+ target_height : BlockNumber ( 0 ) ,
5353 }
5454 }
5555
5656 /// Check if the caller has caught up with the bootstrapper.
5757 pub fn is_caught_up ( & self , current_provider_height : BlockNumber ) -> bool {
58- let is_caught_up = current_provider_height > self . catch_up_height ;
58+ let is_caught_up = current_provider_height > self . target_height ;
5959
6060 self . sync_task_health_check ( is_caught_up) ;
6161
@@ -84,9 +84,9 @@ impl Bootstrapper {
8484 pub fn start_l2_sync (
8585 & mut self ,
8686 current_provider_height : BlockNumber ,
87- catch_up_height : BlockNumber ,
87+ target_height : BlockNumber ,
8888 ) {
89- self . catch_up_height = catch_up_height ;
89+ self . target_height = target_height ;
9090 // FIXME: spawning a task like this is evil.
9191 // However, we aren't using the task executor, so no choice :(
9292 // Once we start using a centralized threadpool, spawn through it instead of the
@@ -95,15 +95,15 @@ impl Bootstrapper {
9595 self . l1_provider_client . clone ( ) ,
9696 self . sync_client . clone ( ) ,
9797 current_provider_height,
98- catch_up_height ,
98+ target_height ,
9999 self . sync_retry_interval ,
100100 ) ) ;
101101
102102 self . sync_task_handle = SyncTaskHandle :: Started ( sync_task_handle. into ( ) ) ;
103103 }
104104
105- pub fn catch_up_height ( & self ) -> BlockNumber {
106- self . catch_up_height
105+ pub fn target_height ( & self ) -> BlockNumber {
106+ self . target_height
107107 }
108108
109109 fn sync_task_health_check ( & self , is_caught_up : bool ) {
@@ -129,7 +129,7 @@ impl Bootstrapper {
129129
130130impl PartialEq for Bootstrapper {
131131 fn eq ( & self , other : & Self ) -> bool {
132- self . catch_up_height == other. catch_up_height
132+ self . target_height == other. target_height
133133 && self . commit_block_backlog == other. commit_block_backlog
134134 }
135135}
@@ -139,7 +139,7 @@ impl Eq for Bootstrapper {}
139139impl std:: fmt:: Debug for Bootstrapper {
140140 fn fmt ( & self , f : & mut std:: fmt:: Formatter < ' _ > ) -> std:: fmt:: Result {
141141 f. debug_struct ( "Bootstrapper" )
142- . field ( "catch_up_height " , & self . catch_up_height )
142+ . field ( "target_height " , & self . target_height )
143143 . field ( "commit_block_backlog" , & self . commit_block_backlog )
144144 . field ( "sync_task_handle" , & self . sync_task_handle )
145145 . finish_non_exhaustive ( )
@@ -150,14 +150,14 @@ async fn l2_sync_task(
150150 l1_provider_client : SharedL1ProviderClient ,
151151 sync_client : SharedStateSyncClient ,
152152 mut current_height : BlockNumber ,
153- catch_up_height : BlockNumber ,
153+ target_height : BlockNumber ,
154154 retry_interval : Duration ,
155155) {
156- while current_height <= catch_up_height {
156+ while current_height <= target_height {
157157 // TODO(Gilad): add tracing instrument.
158158 debug ! (
159159 "Syncing L1Provider with L2 height: {} to target height: {}" ,
160- current_height, catch_up_height
160+ current_height, target_height
161161 ) ;
162162 let block = sync_client. get_block ( current_height) . await . inspect_err ( |err| debug ! ( "{err}" ) ) ;
163163
0 commit comments