Page MenuHomePhabricator

[explorer] Don't fail to render invalid token txs with non existing token id
ClosedPublic

Authored by Fabien on Mon, Jan 6, 09:51.

Details

Summary

The tx 9f938f1c670fbcee7980c53d7b5a059ab64f5c93dc8290a8d10068b6dd696316 is an invalid mint vault mint tx with missing genesis. The explorer currently tries to retrieve the token from the token id, which doesn't exists and so it returns an error. Handle this case instead so we can still show transaction data.
Note that the rendered tx is not very good. Chronik correctly decoded that this is a SLPv2 invalid transaction but because of the template this data is not shown in the explorer page. This can be improved but will be done in another diff.

Depends on D17474 for the preview.

Test Plan

cargo run and open the tx page then the block containing that tx (000000000000000014a1f6b82d89fdd65339a0e6a263ac052bdf03285b736bea)

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Fabien requested review of this revision.Mon, Jan 6, 09:51
Fabien planned changes to this revision.Mon, Jan 6, 10:02

Handle the block page as well

Fabien retitled this revision from [explorer] Don't fail to render invalid token txs with missing genesis to [explorer] Don't fail to render invalid token txs with non existing token id.Mon, Jan 6, 11:35
Fabien edited the test plan for this revision. (Show Details)

Tail of the build log:

#11 4.299   Downloaded icu_locid_transform v1.5.0
#11 4.302   Downloaded httparse v1.9.5
#11 4.304   Downloaded futures-channel v0.3.31
#11 4.306   Downloaded displaydoc v0.2.5
#11 4.309   Downloaded async-trait v0.1.84
#11 4.312   Downloaded askama_shared v0.11.2
#11 4.314   Downloaded want v0.3.1
#11 4.315   Downloaded iana-time-zone v0.1.61
#11 4.317   Downloaded httpdate v1.0.3
#11 4.318   Downloaded crc32fast v1.4.2
#11 4.320   Downloaded cfg-if v1.0.0
#11 4.320   Downloaded bs58 v0.4.0
#11 4.323   Downloaded ipnet v2.10.1
#11 4.324   Downloaded hyper-tls v0.5.0
#11 4.325   Downloaded humansize v1.1.1
#11 4.326   Downloaded http-range-header v0.3.1
#11 4.327   Downloaded html-escape v0.2.13
#11 4.329   Downloaded hex v0.4.3
#11 4.330   Downloaded getrandom v0.2.15
#11 4.333   Downloaded futures-sink v0.3.31
#11 4.334   Downloaded futures-macro v0.3.31
#11 4.335   Downloaded futures-executor v0.3.31
#11 4.336   Downloaded funty v1.1.0
#11 4.337   Downloaded errno v0.3.10
#11 4.338   Downloaded either v1.13.0
#11 4.339   Downloaded crypto-common v0.1.6
#11 4.340   Downloaded convert_case v0.6.0
#11 4.341   Downloaded chrono-humanize v0.1.2
#11 4.342   Downloaded block-buffer v0.10.4
#11 4.343   Downloaded bech32 v0.7.3
#11 4.344   Downloaded axum-core v0.2.9
#11 4.345   Downloaded autocfg v1.4.0
#11 4.347   Downloaded askama_escape v0.10.3
#11 4.348   Downloaded http-body v0.4.6
#11 4.350   Downloaded hex-literal v0.3.4
#11 4.351   Downloaded heck v0.4.1
#11 4.352   Downloaded futures-task v0.3.31
#11 4.353   Downloaded futures-io v0.3.31
#11 4.353   Downloaded futures-core v0.3.31
#11 4.355   Downloaded form_urlencoded v1.2.1
#11 4.355   Downloaded fnv v1.0.7
#11 4.356   Downloaded digest v0.10.7
#11 4.358   Downloaded cpufeatures v0.2.16
#11 4.359   Downloaded byteorder v1.5.0
#11 4.361   Downloaded utf16_iter v1.0.5
#11 4.362   Downloaded fixedbitset v0.4.2
#11 4.363   Downloaded fastrand v2.3.0
#11 4.364   Downloaded askama_derive v0.10.5
#11 4.365   Downloaded foreign-types v0.3.2
#11 4.365   Downloaded equivalent v1.0.1
#11 4.406 error: package `home v0.5.11` cannot be built because it requires rustc 1.81 or newer, while the currently active rustc version is 1.72.1
#11 4.406 Either upgrade to rustc 1.81 or newer, or use
#11 4.406 cargo update -p home@0.5.11 --precise ver
#11 4.406 where `ver` is the latest version of `home` supporting rustc 1.72.1
#11 ERROR: executor failed running [/bin/sh -c cargo build --release]: exit code: 101
------
 > [7/7] RUN cargo build --release:
------
executor failed running [/bin/sh -c cargo build --release]: exit code: 101
Build preview-explorer failed with exit code 1
PiRK requested changes to this revision.Tue, Jan 7, 07:24
PiRK added a subscriber: PiRK.
PiRK added inline comments.
web/explorer/explorer-server/src/server.rs
579 ↗(On Diff #51987)

can be removed

This revision now requires changes to proceed.Tue, Jan 7, 07:24

Rebase, remove commented out code

This revision is now accepted and ready to land.Tue, Jan 7, 10:40