-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Feature/ens asyncify #2501
Feature/ens asyncify #2501
Conversation
hey @dbfreem... I had a chance to review most of this yesterday. I was on a plane so I just kind of made the changes locally and it was mostly cleanup except a few missing awaits so I just pushed it as a separate commit since the work was done already. Open for discussion on anything I moved around though. My reasoning behind the nit / reorganizing the code style is since these are all new lines of code, it sets it up a bit nicer for cleaner git blame / commit history in the future. Other than that I just silenced some warnings that were already present in the previous code base that may have been copied over and added the two missing awaits. I also chose to cast to This is a great addition and a really nice example of how we should end up splitting our sync + async modules in the future so there were some pretty crucial convention choices solidified here 🎉 I think it'd be nice to add the rest of the async tests such as for |
I'd like to talk a bit about using the factory approach. I think the factory approach is a good way to handle the async init and I think I'm OK with the async setup being a bit different than sync since it was unavoidable really. I don't mind not adding an ENS factory for sync if it's not necessary... but curious to hear what you guys think @dbfreem, @kclowes, @pacrob. Thoughts? edit: We spoke in person and it seems fine to just have async be setup differently, so let's roll with that. |
I totally welcome the collaboration so your changes are fine. I will take a look at adding those additional test. |
@fselmo I added the test. It was a copy and paste of some of the existing test that were in those wildcard and offchain. |
nevermind, still some work to do around the test. |
ok @fselmo now this is ready. It was a lot of copy and paste of the existing test. |
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.
one spelling nit, otherwise lgtm
770cc3b
to
0337f36
Compare
0337f36
to
7f6b8fc
Compare
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.
Hey @dbfreem, thanks so much for all your work on async. It has really helped get the ball rolling on so much of what was left.
I'm approving this here but I just did an ultimate wrap up, added all the missing tests for async, and squashed your commits into one and both of mine into one with some good commit messages over at #2526.
Let me know if you have any remaining input.
The reason for another PR again (as was the case with Async Contract) is mostly due to the merge commits. In the future, if a (ultimately wasn't necessary, see edit)git rebase upstream/master
is done on the branch and the differences are resolved (instead of git merge upstream/master
and fixing the differences), this allows for us to squash commits much easier when cleaning up the PR since the commits don't have multiple parents as is sometimes the case.
Thanks again 👌
edit: In the end that wasn't necessary since I force-pushed my local cleaned up branch with the cherry-picked commits here which effectively got rid of the merge commits and was rebased against master
locally... d'oh! Going to close that one instead and squash here so we can keep the conversation in one place.
PS: I'll squash once we get another approval so we can see the history a bit better.
7f6b8fc
to
4854897
Compare
I am all good. |
4854897
to
b2e44c8
Compare
* Change ``ens.main`` to ``ens.ens`` * Added AsyncENSFactory to handle async creation of AsyncENS * Reorganize ENS, AsyncENS, and BaseENS into separate modules * Added async ENS tests * Updated docs * newsfragment
94e4850
to
02e0dc3
Compare
* Add some missing awaits * Add a lot more testing around AsyncENS. We can think about splitting async ENS tests off into their own CI job if they get too big but we should provide ample testing around the async implementation to make sure it's all wired up correctly. * Cleanup for better readability and consistency across ENS and AsyncENS * Keep async_ens_setup as module scope with a module-scoped event_loop fixture and add a module-scoped async_w3 for ens module * Fix some minor warnings with optionals where ``None`` is being passed in * nit: Since we are adding so many new lines, match code style to ideal rest of library for consistency. Trailing commas with new arguments allow for a cleaner git blame / git history since the next bit of code added would only touch the new line that is created, etc. (``black`` formatting PRs are coming in now though so this wasn't very important after the first commit that was squashed here).
02e0dc3
to
2e35c85
Compare
Hey @dbfreem, I played around with this a bit and was able to remove the I put that into a separate PR (#2547) since that's a concrete divergence from this PR. I'm still going to do a bit of cleanup there but curious on any feedback. Anything we're missing? |
That is awesome that you were able to remove the need for AsyncENSFactory. I have been busy lately and haven't had a chance to look over the full PR. Sorry. |
closed by #2547 |
Here is AsyncENS. Still needs docs and cleanup
There was A LOT of copy and paste here from ENS since ENS is so dependent on Eth, and Contract there wasn't much code that could be put in BaseENS.
Todo: