kaspad icon indicating copy to clipboard operation
kaspad copied to clipboard

getUTXOsByAddress() exposing orphans resulting in what looks like consensus desync

Open aspect opened this issue 3 years ago • 0 comments

We have a condition where getUTXOsByAddress() is returning different subsets of UTXOs on 2 different kaspad nodes. This stems from the problems that were experienced by miners in #help-wallet on Discord ... (please note that the addresses below have been used for mining).

We have nodes A and B; A (faulty) is kaspad running behind PWA (I can give access if desirable). B is a freshly synced local node.

For the given address: http://katnip.kaspanet.org/addr/kaspa:qr6y06f8q95tms6zgjr7p0zmrujlwn2y2w94ulpq0uwlx54th7ps7xq2lmduc

A is showing 15 UTXOs, while B is showing 1;

If we attempt to construct transactions from the 15 UTXOs on A, we get an error from Kaspad stating (for example) API error (100): Rejected transaction 4e3a1941c476c635a3e9b41743240486316d0ae79d5fcb25fcda28e84b6b05b6: Transaction 4e3a1941c476c635a3e9b41743240486316d0ae79d5fcb25fcda28e84b6b05b6 is an orphan, where allowOrphan = false

We've restarted A with no effect. It looks like A is supplying orphans in getUTXOByAddress().

Also, does Katnip show orphan transactions for an address? The following address: (be careful clicking here as I think katnip has difficulty handling this address due to a large number of transactions) http://katnip.kaspanet.org/addr/kaspa:qzezjr0d3lxat58ygc9uphxa4vk45stdwe8746prynmkeq468tcl6dgsr5j8s shows up as having a balance of 2,500 KAS in katnip, however on a local node, getUTXOsByAddress() shows 0 UTXOs. If katnip is meant to show orphans, it should maybe split balances. If not, then this further points to some mechanics where a set of transactions were received by the node and later became orphan (?), becoming not visible to other nodes (?), while the nodes that have received them are now stuck being unable to send.

One observation: If there are missing outpoints / orphans, perhaps they should be filtered out and not supplied in response to getUTXOsByAddress(). Orphan UTXOs could come in with all/orphan = true argument of the getUTXOsByAddress() API call or there could also be a whole separate API call like getAllUTXOsByAddress()...

aspect avatar Jan 21 '22 04:01 aspect