Page MenuHomePhabricator

[Explorer] Add support for BURN tx type
ClosedPublic

Authored by tobias_ruck on Feb 18 2023, 09:40.

Details

Reviewers
johnkuney
Fabien
Group Reviewers
Restricted Project
Commits
rABC4811d9c42b21: [Explorer] Add support for BURN tx type
Summary

Currently, these throw an error (after an update to Chronik's proto).

We fix this error and also add a nice page for BURNs.

  1. bitcoinsuite in 6f3e392 adds support for Chronik's new BURN tx type, so update the rev of all bitcoinsuite-* deps
  2. Update Server::tx to handle BURN tx type

Depends on D13145.

Test Plan
  1. Run the explorer locally, pointing to a sync'd Chronik instance
  2. Visit http://127.0.0.1:3035/tx/a3488ed3aabb706a280fc81be4dc456f39f93f294f2cdf96bb705695516b7fcf
  3. It should show "BUX Transaction" and "Token Details (BURN Transaction)"

Diff Detail

Repository
rABC Bitcoin ABC
Branch
explorer-burn-tx-type
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 22033
Build 43701: Build Diff
Build 43700: arc lint + arc unit

Event Timeline

Update the Rust version to 1.67.1.

Update install-dependencies-bullseye.sh, as well as all the Cargo.toml files' rust-version.

Tail of the build log:

    Checking bitflags v1.3.2
    Checking httpdate v1.0.2
    Checking mime v0.3.16
    Checking stable_deref_trait v1.2.0
    Checking librocksdb-sys v0.8.0+7.4.4
    Checking sync_wrapper v0.1.1
    Checking matchit v0.6.0
    Checking hex v0.4.3
    Checking tokio v1.21.2
    Checking cobs v0.2.3
   Compiling chronik-lib v0.1.0 (/work/chronik/chronik-lib)
    Checking rocksdb v0.19.0
    Checking bitcoinsuite-core v0.1.0 (/work/chronik/bitcoinsuite-core)
    Checking http-body v0.4.5
error: the borrowed expression implements the required traits
   --> chronik/bitcoinsuite-core/src/hash.rs:173:21
    |
173 |         hex::encode(&self.to_be_vec())
    |                     ^^^^^^^^^^^^^^^^^ help: change this to: `self.to_be_vec()`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
    = note: `-D clippy::needless-borrow` implied by `-D warnings`

error: could not compile `bitcoinsuite-core` due to previous error
warning: build failed, waiting for other jobs to finish...
[5/6] cd /work && /usr/bin/cmake -E env CARGO_TARGET_DIR="/work/abc-ci-builds/build-chronik/cargo/build" CARGO_BUILD_RUSTC="/root/.rustup/toolchains/1.67.1-x86_64-unknown-linux-gnu/bin/rustc" CARGO_BUILD_RUSTDOC="/root/.rustup/toolchains/1.67.1-x86_64-unknown-linux-gnu/bin/rustdoc" /root/.rustup/toolchains/1.67.1-x86_64-unknown-linux-gnu/bin/cargo clippy --package bitcoinsuite-* -- -D warnings
FAILED: chronik/CMakeFiles/check-crate-bitcoinsuite-clippy 
cd /work && /usr/bin/cmake -E env CARGO_TARGET_DIR="/work/abc-ci-builds/build-chronik/cargo/build" CARGO_BUILD_RUSTC="/root/.rustup/toolchains/1.67.1-x86_64-unknown-linux-gnu/bin/rustc" CARGO_BUILD_RUSTDOC="/root/.rustup/toolchains/1.67.1-x86_64-unknown-linux-gnu/bin/rustdoc" /root/.rustup/toolchains/1.67.1-x86_64-unknown-linux-gnu/bin/cargo clippy --package bitcoinsuite-* -- -D warnings
    Blocking waiting for file lock on package cache
    Blocking waiting for file lock on package cache
    Blocking waiting for file lock on package cache
    Blocking waiting for file lock on package cache
    Blocking waiting for file lock on build directory
    Checking thiserror v1.0.31
    Checking bitcoinsuite-core v0.1.0 (/work/chronik/bitcoinsuite-core)
error: the borrowed expression implements the required traits
   --> chronik/bitcoinsuite-core/src/hash.rs:173:21
    |
173 |         hex::encode(&self.to_be_vec())
    |                     ^^^^^^^^^^^^^^^^^ help: change this to: `self.to_be_vec()`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
    = note: `-D clippy::needless-borrow` implied by `-D warnings`

error: could not compile `bitcoinsuite-core` due to previous error
[6/6] cd /work && /usr/bin/cmake -E env CARGO_TARGET_DIR="/work/abc-ci-builds/build-chronik/cargo/build" CARGO_BUILD_RUSTC="/root/.rustup/toolchains/1.67.1-x86_64-unknown-linux-gnu/bin/rustc" CARGO_BUILD_RUSTDOC="/root/.rustup/toolchains/1.67.1-x86_64-unknown-linux-gnu/bin/rustdoc" /root/.rustup/toolchains/1.67.1-x86_64-unknown-linux-gnu/bin/cargo clippy --package abc-rust-* -- -D warnings
    Blocking waiting for file lock on package cache
    Blocking waiting for file lock on package cache
    Blocking waiting for file lock on package cache
    Blocking waiting for file lock on build directory
    Checking memchr v2.5.0
    Checking addr2line v0.17.0
    Checking libc v0.2.126
    Checking object v0.29.0
    Checking backtrace v0.3.66
    Checking stable-eyre v0.2.2
    Checking abc-rust-error v0.1.0 (/work/chronik/abc-rust-error)
    Finished dev [unoptimized + debuginfo] target(s) in 2m 06s
ninja: build stopped: cannot make progress due to previous errors.
Build build-chronik failed with exit code 1

Go back, don't update Rust, this is now done in D13145.

This revision is now accepted and ready to land.Feb 18 2023, 10:29
This revision was automatically updated to reflect the committed changes.