Add a flag to start processing statediff if we are caught up to the head of the chain #205

Merged
abdulrabbani00 merged 4 commits from feature/155-waitForSync into v1.10.16-statediff-v3 2022-03-18 13:44:13 +00:00
abdulrabbani00 commented 2022-03-10 18:14:22 +00:00 (Migrated from github.com)

Overview

This PR will allow users to add a flag when starting geth, indicating if we should wait for the statediff service to catch up to the head of the chain.

  • The feature has been tested using dapptools.
  • The feature includes unit tests.
  • The feature has not been tested with mainnet data.
  • The feature has not been tested for performance.

Data Structure Changes

This feature changes two major data structures used in the statediffing service.

  1. statediff/config.go - Config
    a. WaitforSync - This change allows us to indicate if the statediff service should wait for us to catch up to head.
  2. statediff/service.go - Service
    a. WaitforSync - This change allows us to indicate if the statediff service should wait for us to catch up to head.
    b. Backend - This backend object is necessary to query the internal API, which indicates if we have caught up to the head of the chain.

These changes have not failed any of the current unit tests under /statediff.

Testing

This PR includes two unit tests. These unit tests have a new mock called Backend. The tests make sure that we catch up to head properly before indicating that we are all caught up.

We should test this with production data to ensure the feature is working correctly and does not incur any performance issues.

# Overview This PR will allow users to add a flag when starting geth, indicating if we should wait for the statediff service to catch up to the head of the chain. * The feature has been tested using dapptools. * The feature includes unit tests. * The feature has __not__ been tested with mainnet data. * The feature has __not__ been tested for performance. # Data Structure Changes This feature changes two major data structures used in the statediffing service. 1. `statediff/config.go` - `Config` a. `WaitforSync` - This change allows us to indicate if the statediff service should wait for us to catch up to head. 2. `statediff/service.go` - `Service` a. `WaitforSync` - This change allows us to indicate if the statediff service should wait for us to catch up to head. b. `Backend` - This backend object is necessary to query the internal API, which indicates if we have caught up to the head of the chain. These changes have not failed any of the current unit tests under `/statediff.` # Testing This PR includes two unit tests. These unit tests have a new mock called `Backend.` The tests make sure that we catch up to head properly before indicating that we are all caught up. We should test this with production data to ensure the feature is working correctly and does not incur any performance issues.
i-norden requested changes 2022-03-16 20:23:32 +00:00
i-norden left a comment
Member

Looks great! Just a few comments for some very minor non-functional changes.

Looks great! Just a few comments for some very minor non-functional changes.
abdulrabbani00 (Migrated from github.com) reviewed 2022-03-18 12:08:29 +00:00
abdulrabbani00 (Migrated from github.com) reviewed 2022-03-18 12:09:01 +00:00
abdulrabbani00 (Migrated from github.com) reviewed 2022-03-18 12:27:06 +00:00
abdulrabbani00 (Migrated from github.com) reviewed 2022-03-18 12:27:15 +00:00
i-norden approved these changes 2022-03-18 13:16:34 +00:00
i-norden left a comment
Member

LGTM! Thanks for making the updates.

LGTM! Thanks for making the updates.
Sign in to join this conversation.
No reviewers
No Milestone
No project
No Assignees
2 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#205
No description provided.