Skip to content

Conversation

@sergeytimoshin
Copy link
Contributor

@sergeytimoshin sergeytimoshin commented Jul 30, 2025

  1. Gap Detection & Rewind: A comprehensive system has been implemented to detect sequence gaps across all state update types (V1/V2 trees, nullifications, batch events, etc.). When a gap is detected, the indexer now automatically triggers a "rewind" command to the block fetcher, which repositions the stream to re-fetch the missing blocks, ensuring no data is missed.
  2. Tree Filtering: The indexer can now be started with a --tree argument. When provided, it will filter and process only the blocks and transactions relevant to the specified Merkle tree. This speeds up indexing, when backfilling a specific tree.
  3. Snapshot Analysis Tool: A new photon-analyze-snapshot tool added to provide info about snapshot files.

seq: *seq as u64,
signature: Default::default(),
},
);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not unwrap ?

Comment on lines 147 to 150
crate::ingester::parser::tree_info::StateV2SeqWithContext::default()
}
} else {
crate::ingester::parser::tree_info::StateV2SeqWithContext::default()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this looks suspicous

Comment on lines 115 to 128
} else {
SequenceEntry {
sequence: 0,
slot: 0,
signature: String::new(),
}
}
} else {
SequenceEntry {
sequence: 0,
slot: 0,
signature: String::new(),
}
};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this looks suspicous

if let Some(entry) = &seq_context.output_queue_entry {
(entry.sequence, Some(entry.clone()))
} else {
(0, None)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this correct?

if let Some(entry) = &seq_context.batch_event_entry {
(entry.sequence, Some(entry.clone()))
} else {
(0, None)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this correct?

if let Some(entry) = &seq_context.batch_event_entry {
(entry.sequence, Some(entry.clone()))
} else {
(0, None)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this correct?

Comment on lines 537 to 538
if unpacked_start_seq > 0
&& unpacked_start_seq != u64::MAX
Copy link
Contributor

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

Copy link
Contributor Author

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

@ananas-block
Copy link
Contributor

apart from those nitpicks lgtm

@sergeytimoshin sergeytimoshin marked this pull request as draft August 8, 2025 13:16
@sergeytimoshin sergeytimoshin marked this pull request as ready for review August 8, 2025 15:08
sergeytimoshin and others added 25 commits August 19, 2025 16:16
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.
@sergeytimoshin sergeytimoshin force-pushed the sergey/account-tx-safe branch from 4db2da2 to 7823882 Compare August 19, 2025 15:16
- 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
@sergeytimoshin sergeytimoshin marked this pull request as draft September 2, 2025 13:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants