-
Notifications
You must be signed in to change notification settings - Fork 0
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: migrate SpokePoolIndexer to new Indexer #64
feat: migrate SpokePoolIndexer to new Indexer #64
Conversation
this.insertWithFinalisationCheck( | ||
entities.FilledV3Relay, | ||
eventsChunk, | ||
["depositId", "originChainId"], |
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 think this could override invalid fills that are stored in the database, should we use another set of keys? Maybe the relayHash
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.
👍
this.insertWithFinalisationCheck( | ||
entities.RequestedSpeedUpV3Deposit, | ||
eventsChunk, | ||
["depositId", "originChainId"], |
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.
Should we add updatedOutputAmount, updatedMessage and updatedRecipient? Taking into account there could be more than one speedUp event for a single deposit.
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 added the transaction hash as the 3rd component of the unique key 👍
this.insertWithFinalisationCheck( | ||
entities.TokensBridged, | ||
eventsChunk, | ||
["chainId", "leafId", "l2TokenAddress", "transactionHash"], |
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.
If transactionHash
changes due to the reorg, I'm thinking we might end having both the first event we saw and the finalised one in the database. But the delete unfinalised query should handle this case, right?
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.
But the delete unfinalised query should handle this case, right?
Good observation. and yes, the delete unfinalised query should handle it
configStoreClient.eventSearchConfig.toBlock = blockRange.to; | ||
hubPoolClient.eventSearchConfig.toBlock = blockRange.to; |
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.
this toBlock refers to the SpokePool's chain? Should we somehow translate that to mainnet block numbers?
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.
Ah, you're right. I removed the to
blocks for the config client and hub client
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! 😄
No description provided.