Closed fridary closed 3 months ago
We prefer to use issues to track our work. If you have implementation or usage questions, please refer to our documentation and/or check out the Ethereum Python community on discord.
If you find a bug somewhere, please be more specific and either ask to re-open this or raise a more targeted issue so we can track it. Best of luck.
What happened?
I am testing websockets and
get_new_entries()
and trying to understand which way works:Here is code:
So, let's gather pending transactions. If I set
poll_seconds=0.1
, I will get output like this:the speed will be more or less fast. If I understand right, in len(gne) we get transactions number that appeared from the last request to node for pending transactions. I'm getting this number not more than 5.
Now, let's increase
poll_seconds=3
. Each new line will be appeared obviously every 3 seconds and slow speed:We can see, that
len(gne)
remains the same! It does not collect more transactions infor
loop. How that possible? That means that we simply losing and missing a lot of transactions. What if we also lose transactions with0.1
interval?Let's do experiment. Here is Uniswap v2 Router https://etherscan.io/address/0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D It's around every 30 seconds new operation. I rewrite
log_loop()
function to catch Uniswaps transactions and setpoll_interval=0.1
:Result: I was waiting at least 2 minutes to catch first Uniswap transaction, although on etherscan I saw some. That means even with short polling I miss transactions. How to fix it? Why it happens?
I use Erigon local node with powerful CPU, a lot of RAM, high Internet connection and fast NVMe disk. If I check latest block on my node and etherscan - it equals.
Code that produced the error
No response
Full error output
No response
Fill this section in if you know how this could or should be fixed
No response
web3 Version
6.16.0
Python Version
3.11.7
Operating System
Ubuntu 20.04.6 LTS
Output from
pip freeze