ark-network / ark

Ark is a layer-two protocol designed to scale Bitcoin transactions
https://arkdev.info
MIT License
58 stars 16 forks source link

GetRound takes 19 seconds #179

Closed bordalix closed 3 months ago

bordalix commented 4 months ago

Possible related to #177

The following query (on testnet) takes about 19 seconds to return.

curl 'https://asp.arkdev.info/v1/round/c4ec2fc62a8fd8ba70768169cb04909e57bc584e249341557a3f0cded52f4d90' \
  -H 'accept: */*' \
  -H 'accept-language: en-US,en;q=0.9,pt;q=0.8,la;q=0.7' \
  -H 'cache-control: no-cache' \
  -H 'content-type: application/json' \
  -H 'origin: http://localhost:3001' \
  -H 'pragma: no-cache' \
  -H 'priority: u=1, i' \
  -H 'referer: http://localhost:3001/' \
  -H 'sec-ch-ua: "Google Chrome";v="125", "Chromium";v="125", "Not.A/Brand";v="24"' \
  -H 'sec-ch-ua-mobile: ?0' \
  -H 'sec-ch-ua-platform: "macOS"' \
  -H 'sec-fetch-dest: empty' \
  -H 'sec-fetch-mode: cors' \
  -H 'sec-fetch-site: cross-site' \
  -H 'user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36'
altafan commented 3 months ago

@bordalix we migrated the db used by the ASP to sqlite, the issue should be fixed, can you double-check?

bordalix commented 3 months ago

@bordalix we migrated the db used by the ASP to sqlite, the issue should be fixed, can you double-check?

@altafan I'm getting internal server error when replaying the curl command above, or even with a simple query to the actual round:

$ curl 'https://asp.arkdev.info/v1/round'
Internal Server Error
tiero commented 3 months ago

Not urgent, but we SHOULD have an integration tests where we test hundreds of concurrent users trying to join a round

bordalix commented 3 months ago

Everything seems to be working fine now.

Having said that, it seems if have a new behaviour (notice the trailing slash on the url)

$ curl 'https://asp.arkdev.info/v1/round'

{"code":5, "message":"Not Found", "details":[]}
$ curl 'https://asp.arkdev.info/v1/round/'

{"round":{"id":"7c0c742b-137a-4d70-a665-948fa00cf94b", "start":"1719225736", "end":"0", "poolTx":"", "congestionTree":{"levels":[]}, "forfeitTxs":[], "connectors":[]}}
tiero commented 3 months ago

@altafan @louisinger

altafan commented 3 months ago

we didn't really change anything related to grpc-gateway, are you 100% sure the behavior was different before?

bordalix commented 3 months ago

we didn't really change anything related to grpc-gateway, are you 100% sure the behavior was different before?

No, not 100% sure.

bordalix commented 3 months ago

UPDATE: tested with commits way back in time, and the behaviour was the same. False alarm, move on, nothing to see here.

altafan commented 3 months ago

Thanks for the verification.