gcash / bchd

An alternative full node bitcoin cash implementation written in Go (golang)
ISC License
279 stars 101 forks source link

Please increase ReadTimeout (& Write too) in gw.go #510

Closed TinosNitso closed 1 year ago

TinosNitso commented 2 years ago

Hi, in /bchrpc/proxy/gw.go could you please change lines 95 & 96 to something like:

    ReadTimeout:  5 * time.Minute,
    WriteTimeout: 5 * time.Minute,

I've tested these exact lines & they work, with flexUSD test address qrg7e8p3m8zh5h6mf4xrqxppkr4kguzf8y68plu2tz imported into Electron-Cash-SLP-3.6.7dev8. I know a minute won't necessarily work (EC-SLP itself has a 1 minute limit which probably needs to increase) so 2 minutes is minimum, & I figure 5 is safer. To switch from 30 seconds to 30 minutes (by just changing "Second" to "Minute") might be risky since it could conceivably create an attack vector against the server.

The test address I chose at random has a difficult TXID de913be01a98fbe78ee0ea4cfd349142dfec9728cec1b47c003d6ab8fcae9304 which requires a graph search of more than 800 thousand txns, in under the Timeout limits. It takes approx a minute for me to do it from RAM, but the EC-SLP executable failed (I had to run Electron-Cash from source because that's slightly more efficient & got it done in under a minute).

The matter may be considered urgent because flexUSD SLP is being used (supposedly) to back another token on another blockchain (sBUSD). However the bchd-mainnet.electroncash.de server doesn't work with the current Timeouts with 100% success. I've created my own server at https://bchd.tk but that's just my home PC with Windows 10 (via Google Cloud reverse ssh tunnel). All my timing measurements were fully local, loading graphsearch from RAM.

Btw, none of the other graphsearch servers work, at all. I couldn't get SLPDB in EC-SLP working either. Basically the only two things which work within EC-SLP are my own bchd.tk & the electroncash.de server.