-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Erorr in websockets.py: '<=' not supported between instances of 'int' and 'NoneType' #913
Comments
I have confirmed that if I alter the filter to include very few blocks (around 10), and the result is a transaction list with around 10 entries and things are fine. A filter which reproduces the error: A filter which works smoothly: And again, everything is fine with |
This comment has been minimized.
This comment has been minimized.
cc @voith |
@carver my bad. I've updated the comment. |
@davehcker I can replicate the issue with infura. from web3 import Web3
w3 = Web3(Web3.WebsocketProvider('wss://mainnet.infura.io/_ws'))
new_block_filter = w3.eth.filter({"fromBlock":hex(5235798),"toBlock":"latest", "address":"0xef68e7c694f40c8202821edf525de3782458639f"})
w3.eth.getFilterLogs(new_block_filter.filter_id) Firstly, failing on
However, I need to investigate what is causing the connection to close! |
@davehcker The problem was that the filter returned a lot of data(more than the default size that a websocket connection allows). On my re attempt to fetch data from the filter I got the following error:
The @davehcker Can you help me check if increasing the value of from web3 import Web3
w3 = Web3(Web3.WebsocketProvider('wss://mainnet.infura.io/_ws', max_size=999999999))
new_block_filter = w3.eth.filter({"fromBlock":hex(5235798),"toBlock":"latest", "address":"0xef68e7c694f40c8202821edf525de3782458639f"})
w3.eth.getFilterLogs(new_block_filter.filter_id) However, I have no idea why it was giving that random Also, A suggestion for you: Instead of fetching such big chunks of data, break |
@voith just guessing but ws client default timeout is ten seconds, i believe, and explains the None for large requests. the first time around, no infura cache in place, i presume, the client times out. second time around, infura cache is primed, you get the size issue. passing a (much) larger timeout value with the kwargs should solve the issue client side. |
@boneyard93501 I know what happened. I have two different virtualenv's on my machine. One with with
That was not the issue here. Here, data was being received continuously. It was just beyond the @carver I think It's time to cut a minor release if @davehcker can confirm that #914 fixes the issue for them. |
Sounds good. Once we get #914 in, I'll cut a release. |
@voith |
What was wrong?
web3 = Web3(Web3.WebsocketProvider("ws://10.224.12.6:8546"))
web3.eth.syncing //returns data
The websocket is clearly open but when I run a filter which is supposed to have many entries, I get the following error trace:
Upon running:
data = web3.eth.getFilterLogs(new_block_filter.filter_id)
, I get:The same filter runs fine (albeit a bit slow) using
Web3.HTTPProvider()
The text was updated successfully, but these errors were encountered: