@@ -42,7 +42,7 @@ fn derive_block_state_update(
4242
4343 match StateUpdate :: merge_updates_with_slot ( state_updates, Some ( block. metadata . slot ) ) {
4444 Ok ( merged_update) => Ok ( merged_update) ,
45- Err ( SequenceGapError :: GapDetected ( gaps) ) => {
45+ Err ( SequenceGapError :: GapDetected { gaps, parsed_state } ) => {
4646 if let Some ( controller) = rewind_controller {
4747 let rewind_slot = determine_rewind_slot ( & gaps) ;
4848 let reason = format ! (
@@ -52,7 +52,7 @@ fn derive_block_state_update(
5252 ) ;
5353 controller. request_rewind ( rewind_slot, reason) ?;
5454 }
55- Err ( IngesterError :: SequenceGapDetected ( gaps) )
55+ Err ( IngesterError :: SequenceGapDetected { gaps, parsed_state } )
5656 }
5757 }
5858}
@@ -121,7 +121,7 @@ pub async fn index_block_batch(
121121 Some ( block_batch. last ( ) . unwrap ( ) . metadata . slot )
122122 ) {
123123 Ok ( merged) => merged,
124- Err ( SequenceGapError :: GapDetected ( gaps) ) => {
124+ Err ( SequenceGapError :: GapDetected { gaps, parsed_state } ) => {
125125 if let Some ( controller) = rewind_controller {
126126 let rewind_slot = determine_rewind_slot ( & gaps) ;
127127 let reason = format ! (
@@ -131,7 +131,7 @@ pub async fn index_block_batch(
131131 ) ;
132132 controller. request_rewind ( rewind_slot, reason) ?;
133133 }
134- return Err ( IngesterError :: SequenceGapDetected ( gaps) ) ;
134+ return Err ( IngesterError :: SequenceGapDetected { gaps, parsed_state } ) ;
135135 }
136136 } ;
137137
@@ -151,9 +151,9 @@ pub async fn index_block_batch_with_infinite_retries(
151151 loop {
152152 match index_block_batch ( db, & block_batch, rewind_controller) . await {
153153 Ok ( ( ) ) => return ,
154- Err ( IngesterError :: SequenceGapDetected ( _ ) ) => {
154+ Err ( IngesterError :: SequenceGapDetected { gaps , parsed_state : _ } ) => {
155155 // For sequence gaps, we don't retry - we let the rewind mechanism handle it
156- log:: error!( "Sequence gap detected in batch, stopping processing to allow rewind" ) ;
156+ log:: error!( "Sequence gap detected in batch with {} gaps , stopping processing to allow rewind" , gaps . len ( ) ) ;
157157 return ;
158158 }
159159 Err ( e) => {
0 commit comments