Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 18 additions & 2 deletions geyser-plugin-runner/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,26 @@ fn main() -> Result<(), Box<dyn Error>> {
let mut todo_previous_blockhash = solana_hash::Hash::default();
let mut todo_latest_entry_blockhash = solana_hash::Hash::default();
loop {
let nodes = reader.read_until_block()?;
let nodes = match reader.read_until_block() {
Ok(nodes) => nodes,
Err(e) => {
// Check if this is an EOF error at the end of the file
if e.to_string().contains("UnexpectedEof")
|| e.to_string().contains("failed to fill whole buffer")
{
println!(
"Reached end of CAR file. Latest processed block: {:?}",
latest_processed_block_number
);
break; // Exit loop gracefully
}
// For other errors, propagate them
return Err(e);
}
};
// println!("Nodes: {:?}", nodes.get_cids());
let block = nodes.get_block()?;

// Update the latest processed block number
latest_processed_block_number = Some(block.slot);

Expand Down
Loading