ApeWorX / ApeWorX/web3.py

Differentiation '0x' and NULL response - timeout handling

Open
#1,549 2 comments 0 reactions 0 assignees View on GitHub
priority: p2 normal
Dominant language
Python
Stars
5.5k
Forks
1.7k
Avg merge
3d 10h
Merged PRs (30d)
2

Description

* Version: 5.0.2
* Python: 3.7

### What was wrong?

I am not sure if I am correct but I think there is some issue which is very important for me. I am running Web3.py on Spark cluster where I am sending thousands of request to Node per second. I am using archive node to get states on different block number and this is why node sometimes return timeout.

Following this 2 Geth issues:
https://github.com/ethereum/go-ethereum/issues/19186
https://github.com/ethereum/go-ethereum/pull/19737

We can see that if timeout is happen body in NULL. In the same time some smart contract have implemented functions like name() without any value - response here from node probably is "0x" but function call_contract_function https://github.com/ethereum/web3.py/blob/d883ad0d2e6501f38aa12290a0dce88360b7b5eb/web3/contract.py#L1395 in both cases will just return NULL

### How can it be fixed?

I would like to have separate error handling / message / information if body from node was just NULL

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.