Comments (8)
I second this. Experiencing same issue on my laptop
from ape-alchemy.
more findings:
Contract("0x4d224452801ACEd8B2F0aebE155379bb5D594381").Transfer.query("transaction_hash", start_block=15000000)
runs fine when connecting through geth uri, but when running that with default provider set to alchemy, again it freezes with no output/errors.
is there an inherent different way of connecting through ape-alchemy
than through the normal, non-plugin geth way? i guess especially for get_contract_logs
, does it behave differently using this plugin?
edit: ok wow looks like it came through after all! just suuuuper slow
from ape-alchemy.
@gosuto-inzasheru I believe these are symptoms of ApeWorX/ape#1119, just with a different provider causing the issue. when you don't restrict queries by block number, currently it queries all possible blocks for events in each transaction which is.... extremely slow, yes. will definitely want to refactor it to using filters and paging to make it speed up
@Ninjagod1251 let's confirm this is indeed the same behavior, and then we can close this in favor of the ape core issue because I don't think it's alchemy causing the problem here
from ape-alchemy.
ApeWorX/ape#1119 is definitely related, but i believe there is something inherently different about the way a .query
gets made when ape-alchemy
is installed:
$ ape plugins list
Installed Plugins:
arbitrum 0.5.1
etherscan 0.5.4
$ ape console -v INFO
In [1]: import timeit;timeit.timeit('from ape import Contract;Contract("0x4d224452801ACEd8B2F0aeb
...: E155379bb5D594381").Transfer.query("transaction_hash", start_block=15000000)', number=3)
INFO: Cache database has not been initialized
Out[1]: 375.95413874601945
$ ape plugins list
Installed Plugins:
alchemy 0.5.3
arbitrum 0.5.1
etherscan 0.5.4
$ ape console -v INFO
In [1]: import timeit;timeit.timeit('from ape import Contract;Contract("0x4d224452801ACEd8B2F0aeb
...: E155379bb5D594381").Transfer.query("transaction_hash", start_block=15000000)', number=3)
INFO: Cache database has not been initialized
Out[1]: 3181.283465335029
from ape-alchemy.
ApeWorX/ape#1119 is definitely related, but i believe there is something inherently different about the way a
.query
gets made whenape-alchemy
is installed:$ ape plugins list Installed Plugins: arbitrum 0.5.1 etherscan 0.5.4 $ ape console -v INFO In [1]: import timeit;timeit.timeit('from ape import Contract;Contract("0x4d224452801ACEd8B2F0aeb ...: E155379bb5D594381").Transfer.query("transaction_hash", start_block=15000000)', number=3) INFO: Cache database has not been initialized Out[1]: 375.95413874601945
$ ape plugins list Installed Plugins: alchemy 0.5.3 arbitrum 0.5.1 etherscan 0.5.4 $ ape console -v INFO In [1]: import timeit;timeit.timeit('from ape import Contract;Contract("0x4d224452801ACEd8B2F0aeb ...: E155379bb5D594381").Transfer.query("transaction_hash", start_block=15000000)', number=3) INFO: Cache database has not been initialized Out[1]: 3181.283465335029
This is very strange indeed! Are you using alchemy
as your default network when executing example 2?
from ape-alchemy.
indeed, in both examples my ape config looks like this:
ethereum:
default_network: mainnet
mainnet:
default_provider: alchemy
geth:
ethereum:
mainnet:
uri: https://eth-mainnet.g.alchemy.com/v2/XXX
which in the first run gives ERROR: Failed setting default provider: Provider 'alchemy' not found in network 'mainnet'.
right before connecting to the geth configured url. in the second run it connects to alchemy successfully (using the WEB3_ETHEREUM_MAINNET_ALCHEMY_API_KEY=XXX
in my .env
).
from ape-alchemy.
Gotcha, okay that makes more sense
from ape-alchemy.
Ah, reading this now it seems like this provider either needs to override Web3Provider.get_contract_logs
to use the 2k block chunks:
or change block_page_size: int = 100
to block_page_size: int = 2000
from ape-alchemy.
Related Issues (11)
- Add Flashbots RPC HOT 1
- Add doc strings
- Should add PoA middleware even if began as PoA
- Fix typo in README
- Fail to get Uniswapv3 on alchemy mainnet. ERROR: (ChainError) Failed to get contract type for address '0x3416cF6C708Da44DB2624D63ea0AAef7113527C6' [APE-813] HOT 1
- Use alchemy_getTransactionReceipts for querying [APE-1081]
- bug: rate limiting not being handled
- Use gZip compression HOT 2
- Configure from configuration HOT 2
- Support all Alchemy networks HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ape-alchemy.