Skip to content
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

Merged
merged 6 commits into from
Dec 26, 2023
Merged

feat: determinate gape slot range #17

merged 6 commits into from
Dec 26, 2023

Conversation

RequescoS
Copy link
Contributor

No description provided.


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());
Copy link
Contributor

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();
Copy link
Contributor

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?

Copy link
Contributor

@StanChe StanChe left a 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?

@StanChe StanChe merged commit aaf18a4 into main Dec 26, 2023
2 checks passed
@StanChe StanChe deleted the feat/gapfill-client branch December 26, 2023 13:50
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.

3 participants