hathor-core icon indicating copy to clipboard operation
hathor-core copied to clipboard

Unhandled exception when decoding unknown transaction

Open obiyankenobi opened this issue 4 years ago • 3 comments

image

Got this when trying to decode a tx that is not in the mainnet, using the explorer decode tool. I created it on my local testnet. I actually thought that I'd be able to decode it using the tool on the explorer, but it seems the full node gets info from the storage.

The used hex:

0001000100000003f168ad1f537576a94ca1e841a63de48e03c966bd8e8c7731b249b50fab02006a473045022100ab50341f66d59f0981e30be074df25aae15288bde6e139d916ecac50056b405e02205705a1b6dc39a039976246292126b4c998bda219548c6e2d8df66237c273a6c121037c64ba2ee99d4352e4f5902ff9ae895e1d0e1ab096e4514fea6086f16d0e6dae403085db5e33a91d5f233c0102000003e280e391ca31e58856509a54f9cd459b9f09ce3d5adf0fe1f31552b80500000cafb17528e2af824d413ab00a1088146f7abaab110f910c8e41359947940002ac1e

obiyankenobi avatar Jul 30 '20 21:07 obiyankenobi

Yeah, it's weird that the full node is returning 500.

About not being able to decode a random tx, this is the expected behaviour because we wanted the decode tx page to be exactly like a transaction detail screen, so we need to access the storage to get metadata information. I like the screen as it is but we could discuss changing that, maybe create a 'decode' and a 'full decode', I don't know. But we definitely should fix this unhandled exception on the full node.

pedroferreira1 avatar Jul 31 '20 00:07 pedroferreira1

Yeah, I actually opened the issue so we handle the Unhandled Exception on the full node.

The other thing is another discussion and we should do it in a separate place.

obiyankenobi avatar Jul 31 '20 09:07 obiyankenobi

I've made hathor.util.api_catch_exceptions decorator a while ago. If we just decorate the resource's handler method and add a status_code = 404 (or 400) on TransactionDoesNotExist it will work much more sanely.

jansegre avatar Aug 04 '20 15:08 jansegre