Skip to content
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

perf: break early on proxy detection when realize can't get storage #2514

Conversation

antazoey
Copy link
Member

@antazoey antazoey commented Feb 18, 2025

What I did

It breaks early instead of continues when it realized getting storage is not implemented by the provider.
I think all providers these days implement this RPC but if you find yourself in this situation, this would save you a few failing requests.

How I did it

How to verify it

Checklist

  • All changes are completed
  • Change is covered in tests
  • Documentation is complete

@antazoey antazoey changed the title perf: break early on proxy detection when realize can perf: break early on proxy detection when realize can't get storage Feb 18, 2025
@antazoey antazoey marked this pull request as ready for review February 18, 2025 00:47
networks.active_provider = init_provider

assert actual is None # Because of provider.
assert my_provider.times_get_storage_was_called == 1
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is 4 on the main branch, so this test would fail without the fix

call `get_storage()` more than once.
"""

class MyProvider(LocalProvider):
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had to make a new provider because EthTester supports getting storage now, which is a good thing

@antazoey antazoey requested a review from fubuloubu February 18, 2025 00:49
@antazoey antazoey force-pushed the perf/avoid-checking-many-proxies-on-not-impl-error branch from 24980c6 to 41572a6 Compare February 18, 2025 00:49
@antazoey antazoey force-pushed the perf/avoid-checking-many-proxies-on-not-impl-error branch from 41572a6 to 5648920 Compare February 18, 2025 00:50
@antazoey antazoey enabled auto-merge (squash) February 19, 2025 14:59
@antazoey antazoey merged commit 7e5e462 into ApeWorX:main Feb 19, 2025
18 checks passed
@antazoey antazoey deleted the perf/avoid-checking-many-proxies-on-not-impl-error branch February 19, 2025 18:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants