simpleledger / Electron-Cash-SLP

Electron Cash for SLP Tokens
https://simpleledger.cash/project/electron-cash-slp-edition/
MIT License
64 stars 53 forks source link

Please increase graph-search read timeout from 60 secs, on line 415 of slp_graph_search.py #242

Open TinosNitso opened 1 year ago

TinosNitso commented 1 year ago

Hi, in slp_graph_search.py I'd set line 415 to:

    with requests.post(url, data=json.dumps(query_json), headers=headers, stream=True, timeout=1800) as r:

i.e. timeout 1800 instead of 60. Why? Because the timeout on line 65 (GraphSearchTxnFetchCache) is 1800, so 1800 is for consistency. At first I guessed 600, but 1800 seems to fit in better.

Unfortunately the BCHD software needs an update too, where I've raised Issue #510. It's current timeout of 30s should also be increased. However for the server I imagine there could be a danger in setting it to half an hour if just 5 mins is sufficient, if there's only one server. A 2nd server could try half an hour.

The problem is that 60s will fail, even when full node, slpgraphsearch grpc server & EC-SLP wallet are all on the same computer - if the .exe binary is used in Win10 & the sync wallet is flexUSD test address qrg7e8p3m8zh5h6mf4xrqxppkr4kguzf8y68plu2tz. One of its graph-searches requires over 800k txns within the timeout. However by chance running the code from source was quick enough, so even 65 seconds might work, just not exactly 60. EC-SLP wallet will use up to 7GB RAM as it validates the SLP history (I'm using a NVMe SSD pagefile as RAM). The Status error users could get is

Exited (HTTPSConnectionPool(host='bchd.tk', port=443): Read timed out. (read timeout=60))

if the BCHD server is updated with timeout greater than 60s (as I've done on my home PC bchd.tk). To test this theory you can set it to 10 seconds to see what that does (with the above SLP address). I just finished syncing that address by running from source with timeout 1800 (but even 120 would work, for me).