Add a service (v3) to fill indexing gap for watched addresses #149
Merged
ashwinphatak
merged 16 commits from 2022-05-18 08:54:04 +00:00
ng-watched-addresses-v3 into master
Dismiss Review
Are you sure you want to dismiss this review?
Labels
Clear labels
Epic
Integration tests
bug
critical
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
v5
wontfix
Copied from Github
Kind/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Something isn't working
Improvements or additions to documentation
This issue or pull request already exists
New feature or request
Good for newcomers
Extra attention is needed
This doesn't seem right
Further information is requested
This will not be worked on
An issue or PR manually copied from GitHub.
Breaking change that won't be backward compatible
Something is not working
Documentation changes
Improve existing functionality
New functionality
This is security issue
Issue or pull request related to testing
Priority
Critical
The priority is critical
Priority
High
The priority is high
Priority
Low
The priority is low
Priority
Medium
The priority is medium
Reviewed
Confirmed
Issue has been confirmed
Reviewed
Duplicate
This issue or pull request already exists
Reviewed
Invalid
Invalid issue
Reviewed
Won't Fix
This issue won't be fixed
Status
Abandoned
Somebody has started to work on this but abandoned work
Status
Blocked
Something is blocking this issue or pull request
Status
Need More Info
Feedback is required to reproduce issue or to continue work
No labels
Milestone
No items
No Milestone
Projects
Clear projects
No projects
No Assignees
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: cerc-io/ipld-eth-server#149
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Part of https://github.com/vulcanize/go-ethereum/issues/127
v3.0.1and eth-ipfs-state-validator tov3.0.0v1.10.17-statediff-3.2.1github.com/vulcanize/ipld-eth-servertogithub.com/vulcanize/ipld-eth-server/v3Code looks great but I don't yet grasp why the pkg/fill/service.go belongs in this repo. We've already moved a db validation command here for convenience but a difference with this new fill process is that it mutates the database directly (granted only an "eth_meta" table and not any of the "eth" schema).
Should the service have some type of shutdown procedure in response to the interrupt notify below?
I don't see/remember why this and eth-ipfs-state-validator need to be tagged with v3 since we aren't importing and using multiple versions of them
If this is a standalone background process that has no server component and is disconnected from the rest of ipld-eth-server I'm not sure it belongs in this repo.
@@ -0,0 +171,4 @@// UpdateLastFilledAt updates the fill status for the provided addresses in the dbfunc (s *Service) UpdateLastFilledAt(blockNumber uint64, fillAddresses []interface{}) {// Prepare the queryquery := "UPDATE eth_meta.watched_addresses SET last_filled_at=? WHERE address IN (?" + strings.Repeat(",?", len(fillAddresses)-1) + ")"ipld-eth-server writing to the DB itself is outside of its usual scope
@@ -0,0 +171,4 @@// UpdateLastFilledAt updates the fill status for the provided addresses in the dbfunc (s *Service) UpdateLastFilledAt(blockNumber uint64, fillAddresses []interface{}) {// Prepare the queryquery := "UPDATE eth_meta.watched_addresses SET last_filled_at=? WHERE address IN (?" + strings.Repeat(",?", len(fillAddresses)-1) + ")"Implemented as per the discussion here: https://github.com/vulcanize/go-ethereum/issues/127#issuecomment-1011819114
We can move the service to a new repository if desired.
Required if we want to include them as a dependency with major version > 1.
See: https://github.com/golang/go/wiki/Modules#semantic-import-versioning
I see, I must have been manifesting false memories of having imported > 1 semantically versioned stuff before. Thanks!
@@ -0,0 +171,4 @@// UpdateLastFilledAt updates the fill status for the provided addresses in the dbfunc (s *Service) UpdateLastFilledAt(blockNumber uint64, fillAddresses []interface{}) {// Prepare the queryquery := "UPDATE eth_meta.watched_addresses SET last_filled_at=? WHERE address IN (?" + strings.Repeat(",?", len(fillAddresses)-1) + ")"Not sure I was part of that discussion
@@ -0,0 +171,4 @@// UpdateLastFilledAt updates the fill status for the provided addresses in the dbfunc (s *Service) UpdateLastFilledAt(blockNumber uint64, fillAddresses []interface{}) {// Prepare the queryquery := "UPDATE eth_meta.watched_addresses SET last_filled_at=? WHERE address IN (?" + strings.Repeat(",?", len(fillAddresses)-1) + ")"Curious what @ashwinphatak thinks, I just want to be cautious about adding more and more misc bells and whistles to this repo as the original intent was for it to have a focused and well-defined function that was encapsulated by its name. We already broke the convention with the addition of the validation command but imo that was supposed to be an exception to the rule and not meant to set a new precedent, and that validation command is at least read only.
@@ -0,0 +171,4 @@// UpdateLastFilledAt updates the fill status for the provided addresses in the dbfunc (s *Service) UpdateLastFilledAt(blockNumber uint64, fillAddresses []interface{}) {// Prepare the queryquery := "UPDATE eth_meta.watched_addresses SET last_filled_at=? WHERE address IN (?" + strings.Repeat(",?", len(fillAddresses)-1) + ")"And the designation that this binary is read-only on the DB is kind of nice from an ops perspective.
@@ -0,0 +171,4 @@// UpdateLastFilledAt updates the fill status for the provided addresses in the dbfunc (s *Service) UpdateLastFilledAt(blockNumber uint64, fillAddresses []interface{}) {// Prepare the queryquery := "UPDATE eth_meta.watched_addresses SET last_filled_at=? WHERE address IN (?" + strings.Repeat(",?", len(fillAddresses)-1) + ")"But on the otherhand, Shane not having to keep track of another binary has its benefits from the ops perspective.
Approved per our on-call discussions
@@ -0,0 +171,4 @@// UpdateLastFilledAt updates the fill status for the provided addresses in the dbfunc (s *Service) UpdateLastFilledAt(blockNumber uint64, fillAddresses []interface{}) {// Prepare the queryquery := "UPDATE eth_meta.watched_addresses SET last_filled_at=? WHERE address IN (?" + strings.Repeat(",?", len(fillAddresses)-1) + ")"The watched addresses fill service will be extracted to a separate repository.
See: https://github.com/vulcanize/ops/issues/156
Graceful shutdown implemented.