vtnerd / monero-lws

Monero Light Wallet Server (scans monero viewkeys and implements mymonero API). Fast LMDB backend.
BSD 3-Clause "New" or "Revised" License
72 stars 25 forks source link

`transaction_height` and `scanned_height` use block height instead of tx count #24

Open j-berman opened 2 years ago

j-berman commented 2 years ago

From the light wallet REST API spec: transaction_height = Total txes sent in Monero scanned_height = Current tx scan progress

These are in contrast to: blockchain_height = Current blockchain height scanned_block_height = Current scan progress

But can see here the response for all 4 is always in terms of block height, not tx count

Should be a simple fix, marking for later


Side note: I'm not sure if start_height is correct in monero-lws or in MyMonero, but MyMonero seems to be returning a tx count for start_height rather than block height (monero-lws returns block height). Worth a deeper investigation into this discrepancy I think.

vtnerd commented 2 years ago

MyMonero has a mechanism for tracking transaction numbers, but this is not (or was not at time of monero-lws conception) tracked/returned by monerod. This should require changes to monerod OR monero-lws will have to fetch transactions during first init to count them manually.

start_height should be "correct" in MyMonero since the API originated with that backend. I transitioned everything to block height because I was fairly confident the front-ends would work "well enough" with those values. The biggest issue is that the frontend likely states in the UI "transactions remaining" or something.

I'll take a look at what OpenMonero is doing, I looked at when I wrote monero-lws, but I don't remember whats its doing either. Changing the API to "outputs" remaining is actually the "most" ideal since I think you can get it to work with monerod right now, and is even closer approximation to the amount of work that needs to be done for scanning (when compared to transaction or block count).

ndorf commented 2 years ago

The biggest issue is that the frontend likely states in the UI "transactions remaining" or something.

It shows blocks remaining, not txs.

j-berman commented 2 years ago

@ndorf I can't tell why MyMonero needs these values as tx counts.. Can we just get rid of them at the API level and consolidate to only use block height everywhere?

AFAICT "blocks remaining" fits the expected UX across wallets so makes sense to just consolidate around that

(Sorry for assuming this was a mistake @vtnerd, I should've known better lol)