Find gap from latest block in the database and the first block processed by the statediff service on database connection #216

Closed
opened 2022-03-18 13:04:07 +00:00 by abdulrabbani00 · 0 comments
abdulrabbani00 commented 2022-03-18 13:04:07 +00:00 (Migrated from github.com)

This feature should do the following:

  1. When the statediff service connects to the database or reconnects to the database:
    a. Get the latest block published to the database.
    b. Send a signal (let's call it checkHeadAndLatestDiff).
  2. If checkHeadAndLatestDiff is true:
    a. Compare the latest block in the database, and compare it to the first incoming block from the chain, head.
    b. If latest + 1 != head, update the known_gaps table with {start_block: latest + 1, end_block: head -1}

This feature will handle the following scenarios:

  • Missed data due to restarts.
  • Missed data due to database drops.
  • Missed data due to SIGKILL.
This feature should do the following: 1. When the statediff service connects to the database or reconnects to the database: a. Get the `latest` block published to the database. b. Send a signal (let's call it `checkHeadAndLatestDiff`). 2. If `checkHeadAndLatestDiff` is `true`: a. Compare the `latest` block in the database, and compare it to the first incoming block from the chain, `head`. b. If `latest + 1 != head`, update the `known_gaps` table with `{start_block: latest + 1, end_block: head -1}` This feature will handle the following scenarios: * Missed data due to restarts. * Missed data due to database drops. * Missed data due to `SIGKILL`.
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: cerc-io/go-ethereum#216
No description provided.