-
Notifications
You must be signed in to change notification settings - Fork 140
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
indexer-common: Avoid using createdAt field for pagination #914
Conversation
b3fc232
to
999c7c0
Compare
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.
lgtm! thanks
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.
Just nitpicking on adhering to the subgraph's schema, though graph-node may currently allow these things.
Also, somewhat unrelated, I found a few places in the code where pagination isn't implemented at all. In particular that could cause issues if somehow an indexer managed to open more than 1000 allocations. We know that some indexers are already indexing more than 1000 subgraphs at a time, so it's not completely impossible.
Removing my approval as I've made changes now. |
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.
One of the comments was not addressed. GitHub won't let me explicitly select the piece of code....
So here's the issue:
packages/indexer-common/src/indexer-management/monitor.ts:1139
$createdAt: Int!
should be $lastId: ID!
326a9be
to
5204c99
Compare
Thanks for catching this. |
5204c99
to
d895371
Compare
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 to me.
d895371
to
bcd5776
Compare
bcd5776
to
9b87b0c
Compare
Changes
NetworkMonitor
functions to paginate byid
instead of bycreatedAt
. Functions updated: subgraphs(), subgraphDeployments() and disputableAllocations().Background
On L2 networks, like arbitrum-one,
createdAt
is not necessarily unique, so paginating based oncreatedAt
can lead to missing items.