-
Notifications
You must be signed in to change notification settings - Fork 196
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
feat(store-sync,store-indexer): sync from getLogs indexer endpoint #1973
Conversation
🦋 Changeset detectedLatest commit: 74921c7 The changes in this PR will be included in the next version bump. This PR includes changesets to release 30 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
d271213
to
26635c0
Compare
99b0d04
to
5795a3d
Compare
.orderBy( | ||
asc(tables.recordsTable.lastUpdatedBlockNumber), | ||
// TODO: add logIndex and use that to sort instead of address/tableId? (https://github.com/latticexyz/mud/issues/1979) | ||
asc(tables.recordsTable.address), | ||
asc(tables.recordsTable.tableId) | ||
); |
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.
for context, why do we have to order the result here?
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.
it was an attempt to fix the e2e tests having inconsistent results between rpc and indexer as far how data is populated, but ended up not being enough
I fixed the e2e test here and need to bring this commit over: 74611df
ultimately we lose some fidelity/ordering when hydrating from the indexer because everything is done at the block level, so records pulled from the DB within the same block may not be exactly the same order as records created from a list of logs from the RPC (mostly due to a lack of logIndex
)
this isn't really an issue practically speaking, but felt like it would be nice to have some consistency between rpc and indexer in terms of data returned and its ordering
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.
do we still need the sorting now? unclear if it affects performance at 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.
we should still prob order by block number, but maybe not others
I think these will still take advantage of the index, but will remove for 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.
lgtm, only question i have is if we can skip the overhead of sorting if it doesn't solve a problem
No description provided.