-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Retrieve Attestations from Operation Service #1606
Conversation
if err != nil { | ||
return err | ||
} | ||
attestations = append(attestations, attestation) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why don't we cap it off at max attestations here? What if we have a million records in the db, this method will fetch them all
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd rather keep this function as generic as possible so anyone can use it w/o having to worry it's capped or not. I think the clear separation of responsibility is nice (DB retrieves it, and Operation service caps it).
In terms of millions records in the DB, we have clean up routines that deletes attestation after it's seen from the block, and we only keep attestations up to last finalized block.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will update comment to be more explicit, these are the attestations that have not been included on chain
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair enough, I see the use case where we might want to fetch all of them perhaps for visualizations or metrics gathering
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, just a comment
Codecov Report
@@ Coverage Diff @@
## master #1606 +/- ##
=======================================
Coverage 71.61% 71.61%
=======================================
Files 94 94
Lines 6568 6568
=======================================
Hits 4704 4704
Misses 1463 1463
Partials 401 401 |
This is part of #1565
Key changes:
What's left:
func (s *Service) Attestations() ([]*pb.Attestation, error)