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

Add flag to turn off ABI validation #3536

Open
kclowes opened this issue Nov 22, 2024 · 4 comments
Open

Add flag to turn off ABI validation #3536

kclowes opened this issue Nov 22, 2024 · 4 comments

Comments

@kclowes
Copy link
Collaborator

kclowes commented Nov 22, 2024

What feature should we add?

ABI Validation here: https://github.com/ethereum/web3.py/blob/main/web3/utils/abi.py#L605 takes a long time (90s) for lots (~800) of contracts that get loaded in up front. See conversation in the Discord that starts here It would be nice to be able to turn that off for advanced use cases. One API proposed is something like w3.eth.contract(address=addr, abi=abi, validate_abi=False). Extra credit for beefing up benchmarking at the same time.

@alb2001
Copy link

alb2001 commented Nov 22, 2024

On doing the same operation, 7.5.0 is faster. In my example:

7.5.0: 4.154691696166992 seconds

7.6.0: 48.58938956260681 seconds
7.6.0 with validate_abi commented out: 7.506614685058594 seconds

7.5.0 is pretty much faster

yabirgb added a commit to yabirgb/rotki that referenced this issue Dec 9, 2024
7.6.0 seems to have a performance issue related to abi validation ethereum/web3.py#3536
7.5.0 is fine. I created an issue that describes how it hits us in one place ethereum/web3.py#3553

When a patch gets released we can check again to update
LefterisJP pushed a commit to rotki/rotki that referenced this issue Dec 9, 2024
7.6.0 seems to have a performance issue related to abi validation ethereum/web3.py#3536
7.5.0 is fine. I created an issue that describes how it hits us in one place ethereum/web3.py#3553

When a patch gets released we can check again to update
@reedsa
Copy link
Contributor

reedsa commented Jan 22, 2025

I think this can be closed now that the ABI code is optimized. If there's other ideas here, please call them out and I can work to address them! @fselmo @kclowes

@fselmo
Copy link
Collaborator

fselmo commented Jan 22, 2025

@reedsa I'm for closing this

@kclowes
Copy link
Collaborator Author

kclowes commented Jan 22, 2025

Yep, I think we are good to close. Thanks @reedsa!

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 a pull request may close this issue.

4 participants