Skip to content

Conversation

@livehardd
Copy link
Contributor

The history index stages were hardcoding block 0 to check for first sync, which fails when genesis starts at a non-zero block. This prevented the first-sync optimization (clearing tables and rebuilding from scratch) from running.

Changed to check if the history table is empty instead, and use the actual checkpoint block number as the starting point rather than assuming 0.

Copy link
Collaborator

@mattsse mattsse left a comment

Choose a reason for hiding this comment

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

Comment on lines +102 to +103
let first_sync =
provider.tx_ref().cursor_read::<tables::AccountsHistory>()?.last()?.is_none();
Copy link
Collaborator

Choose a reason for hiding this comment

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

we shouldnt use raw cursors here because this will complicate things with static files I think.

also I dont think there's a valid reason for this, even if the node is initialized with block > 0 dont think we insert history

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

2 participants