Page MenuHomePhabricator

[explorer] Patch issue where slp v2 txs crash explorer
AbandonedPublic

Authored by bytesofman on Sep 27 2023, 18:44.

Details

Reviewers
None
Group Reviewers
Restricted Project
Summary

T3214

TODO: learn basic rust implementations

slp v2 txs are returned as chronik with an slpTxData key, so the isToken bool is true in templates/pages/transaction.html

However we can't generate the token_info_table because an error is thrown in defining token in server.rs. chronik gives these unrecognized slp v2 txs a tokenId of 0000000000000000000000000000000000000000000000000000000000000000 -- which chronik is then unable to find in its chronik.token(token_id) call. So we get an error, and the error is rendered instead of the tx page.

To start, we should just render slp v2 txs as normal eCash txs. Then we can flag them as slp v2 txs.

This diff "fixes" the problem by simply breaking every single token tx in the explorer. However, it is hoped that the correct syntax may be discovered to

  • Give some boilerplate assignment to token in the event of an all-zero tokenId, avoiding the chronik call which will error

or

  • Set isToken to false if all-zero tokenId

or some other solution

Current implementation does not really work but does point to a likely candidate of where this fix should be implemented.

Test Plan

review available patching methods, choose the best, learn rust syntax to implement, implement, test

Diff Detail

Repository
rABC Bitcoin ABC
Branch
explorer-tolerate-opreturn-processing-issues
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 25188
Build 49964: Build Diff
Build 49963: arc lint + arc unit

Event Timeline

Issue has already been patched in explorer.be.cash, in the future should check this first ... though good exercise and all to find where the issue is arising here