Add a service (v3) to fill indexing gap for watched addresses #149
No reviewers
Labels
No Label
bug
critical
documentation
duplicate
enhancement
Epic
good first issue
help wanted
Integration tests
invalid
question
v5
wontfix
Copied from Github
Kind/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: cerc-io/ipld-eth-server#149
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "ng-watched-addresses-v3"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Part of https://github.com/vulcanize/go-ethereum/issues/127
v3.0.1
and eth-ipfs-state-validator tov3.0.0
v1.10.17-statediff-3.2.1
github.com/vulcanize/ipld-eth-server
togithub.com/vulcanize/ipld-eth-server/v3
Code 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 db
func (s *Service) UpdateLastFilledAt(blockNumber uint64, fillAddresses []interface{}) {
// Prepare the query
query := "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 db
func (s *Service) UpdateLastFilledAt(blockNumber uint64, fillAddresses []interface{}) {
// Prepare the query
query := "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 db
func (s *Service) UpdateLastFilledAt(blockNumber uint64, fillAddresses []interface{}) {
// Prepare the query
query := "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 db
func (s *Service) UpdateLastFilledAt(blockNumber uint64, fillAddresses []interface{}) {
// Prepare the query
query := "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 db
func (s *Service) UpdateLastFilledAt(blockNumber uint64, fillAddresses []interface{}) {
// Prepare the query
query := "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 db
func (s *Service) UpdateLastFilledAt(blockNumber uint64, fillAddresses []interface{}) {
// Prepare the query
query := "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 db
func (s *Service) UpdateLastFilledAt(blockNumber uint64, fillAddresses []interface{}) {
// Prepare the query
query := "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.