-
-
Notifications
You must be signed in to change notification settings - Fork 74
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
autoload: AutoloadResult.ContractResult #131
Merged
Merged
Changes from 2 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
902ab40
autoload: AutoloadResult{ContractResult} and AutoloadConfig{loadContr…
shazow bb9f2c9
auto: Dont follow DiamondProxies unless followProxies is set
shazow 3dc8f52
src/proxies.ts: Add typedoc example for DiamondProxyResolver.facets
shazow fe8fa90
src/auto.ts: Undo respecting followProxies for DiamondProxy
shazow File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
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.
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.
@yohamta What do you think of this if there is a single DiamondProxy but followProxies is false?
I'm not too happy with it because it'll rerun
getCode
again, but not sure if this is an edge case that is important?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.
Thank you very much! It looks good to me :) As you mentioned, the redundant execution of getCode doesn’t seem too critical in this case.
One thing I've been thinking about is that, for DiamondProxy, the
resolve()
method requires aselector
argument. This makes it seem a bit challenging to retrieve the implementation addresses for thefacets
externally. What are your thoughts on this? WhenfollowProxy: false
is set and facets aren't being tracked, it would be helpful if users could easily get a list of facet addresses. Another potential solution could be to automatically resolve facets for DiamondProxy, even whenfollowProxy: false
is used. That said, I’m not sure which approach would be suitable right 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.
Correct, with this fix if you want to get all possible selectors, you'd need to do something like:
But just doing
followProxies()
should automagically do that for you and look them up and return the abi as it used to.This was the original behaviour we're trying to fix, 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.
Thank you for the code snippet, it's very helpful!
Yes, that's true. On the other hand, some user might want to retrieve
ContractResult
for each facet individually. In that case, they can follow the method you've described above, which I think works well.Yes, exactly. I’m still unsure of the best way to handle DiamondProxy in this context, which is why I brought it up.
I’m also a bit curious if there could be cases where a deeper hierarchy of proxies exists under the DiamondProxy facets. However, I believe this would be a rare case and shouldn’t prevent this PR from being merged.
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'll add it to the docs! Thanks for the prompt. :)
Hmm are individual facet addresses typically verified? We should look at some examples of DiamondProxies in the wild to see how they're treated.
That's fair. I'd like to do a release today or tomorrow, so I might just merge the ContractResult work and revert the changes to the followProxies for now, and we can think about it more after the release. :)
That's a good question! I'm skeptical this is used in practice, but it's certainly possible to do!
Someone should deploy a weird fractal multi-proxy monstrosity just so we have something to test against. 😅
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.
Sounds great, and thank you very much! Looking forward to the next release.