ethereum / web3.py

A python interface for interacting with the Ethereum blockchain and ecosystem.
http://web3py.readthedocs.io
MIT License
5.04k stars 1.71k forks source link

Add flag to turn off ABI validation #3536

Open kclowes opened 4 days ago

kclowes commented 4 days ago

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 commented 4 days ago

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