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
Fix event emission of AToken and DebtToken events #682
Fix event emission of AToken and DebtToken events #682
Changes from 16 commits
251c052
b64ec22
a31a16a
617facd
4ae5648
449a28c
ee58f15
8d0af95
e353c29
7d22082
80c6e5d
86aff28
2b4f336
89eca28
a85c48b
8152611
629d887
c54ce21
b9ad0be
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.
Changing this parameter name will likely break the subgraph
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.
The subgraph will need to differentiate pre and post patch versions
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 doesn't seem reasonable only due to a name change. Unless the subgraph breaks anyway or there is some major reason
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.
The subgraph will need to differentiate either way. However, this change will affect the subgraph logic so It may be interesting to revert it back. Thoughts @defispartan ?
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.
Last month we implemented a fix for the current V3 subgraphs, so now these subgraphs correctly handle mint and burn events. With this change we would need to add versioning throughout each V3 subgraph to say:
Since we have a working version already and handling this would be quite ugly, I would be in favor of reverting the event change
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.
Makes sense to me. Reverting the change in order to make the subgraph's logic less painful
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.
Would it be possible to add
amount
as another field to this event? It won't be used for anything, but this way the subgraph can differentiate which logic to use based on a different event signature.The alternative is that we'd need to store the exact block that each market was updated to 3.0.1, and decide which logic to use based on the market and blockNumber.
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 does not make much sense to add another param if its not needed tbh.
Are not we using blockNumber already to differentiate? I think there is no other way
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.
No, there's nowhere else in the subgraphs where events need to be differentiated between contract versions using block number. It's extremely ugly, and prone to errors if tokens have events in this same block as the update, or if not all tokens are updated in the exact same 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.
Probably better to simplify the operation to only do 1
rayMul
, no?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.
Agree, but we are using this approach on other parts throughout the code
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.
@miguelmtzinf Given that this code operates on
_userState[sender]
(or recipient) after and being 1 slot packed withadditionalData
, is not more gas-efficient to do aUserState memory senderState = _userState[sender];
and then just operate with the fields in memory?
Unless the compiler takes this into account already
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.
Not worth to do what you suggest because we need to update storage sender/recipient 's state later on