lbryio / herald.go

MIT License
19 stars 10 forks source link

standardize on errors / codes #39

Open tzarebczan opened 2 years ago

tzarebczan commented 2 years ago

Old: the transaction was rejected by network rules.\n\nMissing inputs\n... New: ejected: orphan transaction 7e27725626174a5e19ebab2dd3fcafce1ca68971bd5710d0a0112f46bee90246 references outputs of unknown or fully-spent transaction fbdb1ce2c895c4bd82fef905b35a10a7bcef68972f260c7be1dbab02f239000d\n[0

Old: 'the transaction was rejected by network rules.\n\ntxn-mempool-conflict (code 18)\n[01 New: ?

Old: 'bad-txns-claimscriptsize-toolarge (code 16)'; New: ?

Not sure about this one, but recently creeped up on YT sync:

Old: Not enough funds to cover this transaction. New: insufficient funds available to construct transaction'

Old: ? New: -32603: double spend: -26: TX rejected: output a7472451be1236a891193c2ba97becaf97898e64f7f4c805f16c8cd837af0d78:0 already spent by transaction 9b8d1d53fcad953f80e7925a3a5fe7898644f1b511f16b446b04f88d1f207d3c in the memory pool

old: 'the transaction was rejected by network rules.\n\ntx-size (code new: TX rejected: transaction 0f47f0fbfced417587bc1e7ad1f78c09d8af204199b644e114a70ac27c03df81 is not standard: weight of transaction 602540 is larger than max allowed weight of 400000

moodyjon commented 2 years ago

I tracked several of these down, and the cause is the mixing of lbrycrd and lbcd. You can find these new messages in the code of lbcd and lbcwallet.

@roylee17 How do you want to handle this? It's caused by the upstream ancestors btcsuite/btcd and btcsuite/btcwallet.

[edit] Exception would be "claimscriptsize-toolarge" which would be LBRY code.

roylee17 commented 2 years ago

More context, please?

What are the RPCs being used, and who uses them? Herald or app?

moodyjon commented 2 years ago

The last one (YTsync) is referenced here: https://github.com/lbryio/ytsync/blob/master/shared/shared.go

Possibly all of them are seen in the context of YT sync. Having to update the error code matching is causing distress?

tzarebczan commented 2 years ago

Yeah, we pretty much never had standardized codes across the board and various apps had to read output results and infer them. Some errors would come from the SDK, some from lbrycrd, etc. So now that we're using lbcd, the errors are different. It would be best if the SDK/hub (not sure where exactly) standardized them with error codes based on some full node standardization.. there aren't too many.

Edit, I added another one to the list: -32603: double spend: -26: TX rejected: output a7472451be1236a891193c2ba97becaf97898e64f7f4c805f16c8cd837af0d78:0 already spent by transaction 9b8d1d53fcad953f80e7925a3a5fe7898644f1b511f16b446b04f88d1f207d3c in the memory pool