Duplicate data occasionally inserted during statediffing #245

Closed
opened 2022-06-17 13:19:19 +00:00 by prathamesh0 · 0 comments
prathamesh0 commented 2022-06-17 13:19:19 +00:00 (Migrated from github.com)

The indexer object in the statediffing service holds a block number as a field. Since the same indexer is used in regular statediffing (WriteLoop) as well as to serve writeStateDiffAt API calls, the block number field sometimes gets overwritten in the middle of statediffing.

This was discovered while running a watcher against the v4 endpoints. On making multiple writeStateDiffAt API calls through ipld-eth-server to a head-tracking geth node for a missing block (12948382), it indexed data belonging to the missing block at two different heights (at 12948382 and at head 14972625). The same scenario happened with few other blocks as well (5 blocks out of ~100 older blocks).

image (4)

Relevant code change: https://github.com/vulcanize/go-ethereum/pull/211/files#diff-94d8d9065b029905674a053b6f9eb87f9fa49dc82ff8191e7c899e35fd2fd66eR58

Tasks:

  • Fixes in statediffing code
  • Fix ipld-eth-db schema and update core services
The indexer object in the statediffing service holds a block number as a field. Since the same indexer is used in regular statediffing (`WriteLoop`) as well as to serve `writeStateDiffAt` API calls, the block number field sometimes gets overwritten in the middle of statediffing. This was discovered while running a watcher against the v4 endpoints. On making multiple `writeStateDiffAt` API calls through `ipld-eth-server` to a head-tracking geth node for a missing block (`12948382`), it indexed data belonging to the missing block at two different heights (at `12948382` and at head `14972625`). The same scenario happened with few other blocks as well (5 blocks out of ~100 older blocks). ![image (4)](https://user-images.githubusercontent.com/42446521/174302434-ebc9e62f-489e-4e49-bceb-9e826606f746.png) Relevant code change: https://github.com/vulcanize/go-ethereum/pull/211/files#diff-94d8d9065b029905674a053b6f9eb87f9fa49dc82ff8191e7c899e35fd2fd66eR58 Tasks: - [x] Fixes in statediffing code - [x] Fix ipld-eth-db schema and update core services
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#245
No description provided.