Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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(cross-chain-indexing): enable multiple concurrent plugins #24
feat(cross-chain-indexing): enable multiple concurrent plugins #24
Changes from 2 commits
618e8d3
7d8f978
76754e4
0ffa78c
b118dfb
c71479f
ceb03cc
fa57a34
3b2c07b
748dfa4
5365dd6
43b1dc7
ac141f5
46ab32d
273cd63
5e1b695
f63ba6a
8d2bb1b
c478ad5
6e19c7d
38e9c15
fd2d567
6da8beb
b6e75af
7334d9d
dc94a32
eb7aa6b
e18f392
7a7a70b
a42be85
03529a3
19394cb
b0575f5
141e57c
77cc78b
f35a828
7d060be
b3f5146
4b586eb
a7099a4
b7704f4
ba17d36
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Could you please document why we are calling
upsertAccount
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.
This is directly reflecting the reference subgraph implementation. I've just moved it couple lines up, compared to the previous version of the
src/plugins/base.eth/handlers/Registrar.ts
file.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.
@tk-o Thanks for the background info.
I'm still not clear here however.
The reason why is because I see the call to
handleNameRegistered
at the end of this function. My understanding is thathandleNameRegistered
will perform thisupsertAccount
to match the subgraph equivalency you linked in your reply above.So my question is still open: Why are we calling
upsertAccount
again 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.
@tk-o This is still an open question for me. Can you please clarify?
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.
@shrugs, please confirm:
When we insert a record into
domains
table, we set itsownerId
to some value (as it isnotNull
column). Because of how we have the ponder schema relations defined, theownerId
must have a reference in theaccounts
table.That's why we first insert a record into
accounts
table, followed by a record added intodomains
table. The later must point to the former.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.
correct.
side note: ponder doesn't enforce foreign key constraints in the postgres schema, so technically either order works but we should prefer the order you've suggested here, since domain records should depend on account record existing.