- 
                Notifications
    You must be signed in to change notification settings 
- Fork 16
feat: gap detection & rewind #288
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
feat: gap detection & rewind #288
Conversation
| seq: *seq as u64, | ||
| signature: Default::default(), | ||
| }, | ||
| ); | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not unwrap ?
        
          
                src/ingester/detect_gaps.rs
              
                Outdated
          
        
      | crate::ingester::parser::tree_info::StateV2SeqWithContext::default() | ||
| } | ||
| } else { | ||
| crate::ingester::parser::tree_info::StateV2SeqWithContext::default() | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this looks suspicous
        
          
                src/ingester/detect_gaps.rs
              
                Outdated
          
        
      | } else { | ||
| SequenceEntry { | ||
| sequence: 0, | ||
| slot: 0, | ||
| signature: String::new(), | ||
| } | ||
| } | ||
| } else { | ||
| SequenceEntry { | ||
| sequence: 0, | ||
| slot: 0, | ||
| signature: String::new(), | ||
| } | ||
| }; | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this looks suspicous
        
          
                src/ingester/detect_gaps.rs
              
                Outdated
          
        
      | if let Some(entry) = &seq_context.output_queue_entry { | ||
| (entry.sequence, Some(entry.clone())) | ||
| } else { | ||
| (0, None) | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this correct?
        
          
                src/ingester/detect_gaps.rs
              
                Outdated
          
        
      | if let Some(entry) = &seq_context.batch_event_entry { | ||
| (entry.sequence, Some(entry.clone())) | ||
| } else { | ||
| (0, None) | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this correct?
        
          
                src/ingester/detect_gaps.rs
              
                Outdated
          
        
      | if let Some(entry) = &seq_context.batch_event_entry { | ||
| (entry.sequence, Some(entry.clone())) | ||
| } else { | ||
| (0, None) | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this correct?
        
          
                src/ingester/detect_gaps.rs
              
                Outdated
          
        
      | if unpacked_start_seq > 0 | ||
| && unpacked_start_seq != u64::MAX | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hm we handle both 0 and u64::MAX here, but it's not clean we should refactor it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added more comments + moved to ingester/gap module
| apart from those nitpicks lgtm | 
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
refactor: add a dedicated error variant for gap detection
The new `--disable-gap-detection` flag allows users to opt out of the sequence gap detection and rewinding behavior, simplifying the indexing process in cases where it's not needed.
4db2da2    to
    7823882      
    Compare
  
    - Adds sequential index validation for both operations - Checks for already processed batches during re-indexing - Improves handling of address batch indices and queue state - Retains nullifier queue indices for re-indexing support - Makes temporary file creation more robust with fallback
Uh oh!
There was an error while loading. Please reload this page.