-
Notifications
You must be signed in to change notification settings - Fork 5
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
feat: determinate gape slot range #17
Conversation
nft_ingester/src/message_handler.rs
Outdated
|
||
async fn handle_account(&self, data: Vec<u8>) -> Result<(), IngesterError> { | ||
let account_update = | ||
utils::flatbuffer::account_info_generated::account_info::root_as_account_info(&data)?; | ||
|
||
self.store_first_processed_slot(account_update.slot()); |
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.
LGTM!
But I would also consider extract first processed slot in a little bit different way, I mean that function will do it's job only once but then will be called with every new account update. We could get last saved slot as we do it now, and then once we got new update iter from that slot and get the next one, it will be our first processed slot. Isn't call to action, just a food for thought.
let cloned_rocks_storage = rocks_storage.clone(); | ||
tasks.spawn(tokio::spawn(async move { | ||
loop { | ||
let slot = cloned_rocks_storage.last_saved_slot().unwrap().unwrap(); |
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 is it safe unwrapping here?
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.
Looks good, but those unwraps may trigger some runtime panics, don't they?
No description provided.