Page MenuHomePhabricator

[chronik] implement blockchain.transaction.get_merkle Electrum method
ClosedPublic

Authored by PiRK on Sat, Jan 11, 16:35.

Details

Summary
Test Plan

ninja check-functional

Check the results are identical (same values, same endianness for hashes in the merkle branch) with what Fulcrum returns for a handful of recent main-net transaction.

Diff Detail

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

Event Timeline

rebase on D17522, compute merkle branch, add test

PiRK published this revision for review.Mon, Jan 13, 12:25
PiRK edited the summary of this revision. (Show Details)
PiRK edited the test plan for this revision. (Show Details)

Tail of the build log:

    Checking url v2.5.4
    Checking toml_datetime v0.6.8
    Checking serde_spanned v0.6.8
   Compiling pyo3 v0.23.3
    Checking topo_sort v0.4.0
    Checking seahash v4.1.0
    Checking sync_wrapper v1.0.2
   Compiling chronik-proto v0.1.0 (/work/chronik/chronik-proto)
    Checking winnow v0.6.20
    Checking chronik-plugin-common v0.1.0 (/work/chronik/chronik-plugin-common)
    Checking axum-core v0.4.5
    Checking hyper v1.5.1
    Checking chronik-plugin v0.1.0 (/work/chronik/chronik-plugin)
    Checking karyon_core v0.2.1 (https://github.com/karyontech/karyon.git?rev=c019ca3273a89afb34e2aa429386851f45cfa5d1#c019ca32)
   Compiling karyon_jsonrpc_macro v0.2.1 (https://github.com/karyontech/karyon.git?rev=c019ca3273a89afb34e2aa429386851f45cfa5d1#c019ca32)
   Compiling chronik-bridge v0.1.0 (/work/chronik/chronik-bridge)
    Checking tower v0.5.1
    Checking hyper-util v0.1.10
    Checking tokio-tungstenite v0.24.0
    Checking memoffset v0.9.1
    Checking futures-executor v0.3.31
    Checking serde_urlencoded v0.7.1
    Checking serde_path_to_error v0.1.16
    Checking matchit v0.7.3
    Checking base64 v0.22.1
    Checking unicode-segmentation v1.12.0
    Checking unindent v0.2.3
    Checking tower-http v0.5.2
    Checking futures v0.3.31
    Checking toml_edit v0.22.22
    Checking convert_case v0.6.0
   Compiling librocksdb-sys v0.11.0+8.1.1
    Checking axum v0.7.9
   Compiling pyo3-macros v0.23.3
    Checking toml v0.8.19
    Checking chronik-plugin-impl v0.1.0 (/work/chronik/chronik-plugin-impl)
   Compiling aws-lc-rs v1.11.1
   Compiling rustls v0.23.19
    Checking rustls-webpki v0.102.8
    Checking tokio-rustls v0.26.1
    Checking karyon_async_rustls v0.2.1 (https://github.com/karyontech/karyon.git?rev=c019ca3273a89afb34e2aa429386851f45cfa5d1#c019ca32)
    Checking karyon_net v0.2.1 (https://github.com/karyontech/karyon.git?rev=c019ca3273a89afb34e2aa429386851f45cfa5d1#c019ca32)
    Checking karyon_jsonrpc v0.2.1 (https://github.com/karyontech/karyon.git?rev=c019ca3273a89afb34e2aa429386851f45cfa5d1#c019ca32)
    Checking rocksdb v0.21.0
    Checking chronik-db v0.1.0 (/work/chronik/chronik-db)
    Checking chronik-indexer v0.1.0 (/work/chronik/chronik-indexer)
    Checking chronik-http v0.1.0 (/work/chronik/chronik-http)
error: the borrowed expression implements the required traits
   --> chronik/chronik-http/src/electrum.rs:656:34
    |
656 |             .map(|h| hex::encode(&h.to_be_bytes()))
    |                                  ^^^^^^^^^^^^^^^^ help: change this to: `h.to_be_bytes()`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
    = note: `-D clippy::needless-borrows-for-generic-args` implied by `-D warnings`
    = help: to override `-D warnings` add `#[allow(clippy::needless_borrows_for_generic_args)]`

error: could not compile `chronik-http` (lib) due to 1 previous error
ninja: build stopped: cannot make progress due to previous errors.
Build build-chronik failed with exit code 1

Tail of the build log:

   Doc-tests chronik-bridge

running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s

   Doc-tests chronik-db

running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s

   Doc-tests chronik-http

running 1 test
test chronik/chronik-http/src/protobuf.rs - protobuf::Protobuf (line 29) ... ok

test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.36s

   Doc-tests chronik-indexer

running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s

   Doc-tests chronik-plugin

running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s

   Doc-tests chronik-plugin-common

running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s

   Doc-tests chronik-plugin-impl

running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s

   Doc-tests chronik-proto

running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s

   Doc-tests chronik-util

running 2 tests
test chronik/chronik-util/src/log.rs - log::log (line 65) ... ignored
test chronik/chronik-util/src/log.rs - log::log_chronik (line 87) ... ignored

test result: ok. 0 passed; 0 failed; 2 ignored; 0 measured; 0 filtered out; finished in 0.00s

ninja: build stopped: cannot make progress due to previous errors.
Build build-chronik-plugins failed with exit code 1
Fabien requested changes to this revision.Mon, Jan 13, 15:11
Fabien added a subscriber: Fabien.

clearing my queue

This revision now requires changes to proceed.Mon, Jan 13, 15:11
PiRK edited the test plan for this revision. (Show Details)

fix clippy error

Tail of the build log:

File                        | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s            
----------------------------|---------|----------|---------|---------|------------------------------
All files                   |   28.33 |     26.4 |   28.35 |   44.85 |                              
 ecash-lib                  |       0 |        0 |       0 |       0 |                              
  eslint.config.js          |       0 |        0 |       0 |       0 |                              
 ecash-lib/dist/ffi         |       0 |        0 |       0 |       0 |                              
  ecash_lib_wasm_browser.js |       0 |        0 |       0 |       0 | 3-336                        
  ecash_lib_wasm_nodejs.js  |       0 |        0 |       0 |       0 | 1-264                        
 ecash-lib/src              |   35.84 |     28.6 |   39.24 |   68.05 |                              
  consts.ts                 |       0 |      100 |     100 |       0 | 6-8                          
  ecc.ts                    |   30.76 |    83.33 |   22.22 |   57.14 | 23-31                        
  hash.ts                   |   47.05 |    83.33 |   44.44 |   88.88 | 14                           
  index.ts                  |       0 |        0 |       0 |       0 |                              
  indexBrowser.ts           |       0 |        0 |       0 |       0 |                              
  indexNodeJs.ts            |       0 |        0 |       0 |       0 |                              
  initBrowser.ts            |       0 |      100 |       0 |       0 | 11-13                        
  initNodeJs.ts             |   53.84 |      100 |   66.66 |   85.71 | 12                           
  op.ts                     |   20.13 |    23.33 |   36.36 |   39.47 | ...4,107,109,117-122,133-161 
  opcode.ts                 |    50.2 |    83.33 |     100 |     100 | 1                            
  script.ts                 |   28.97 |    20.58 |   31.03 |   51.78 | ...1-122,133,143,153,175-186 
  sigHashType.ts            |      40 |       25 |   46.15 |   78.94 | 26-38                        
  tx.ts                     |   47.25 |    45.23 |   47.61 |   87.23 | 110,114,123-125,144          
  txBuilder.ts              |   40.64 |    32.69 |   54.54 |   80.21 | ...4,157,176-181,186,256-260 
  unsignedTx.ts             |   25.27 |       16 |   30.76 |   46.15 | ...9,312,320,326-329,345,357 
 ecash-lib/src/address      |   11.35 |    15.15 |    5.12 |   22.41 |                              
  address.ts                |   10.95 |    11.36 |    3.22 |   21.05 | ...3,239-240,255-256,266-344 
  legacyaddr.ts             |   12.04 |    22.72 |    12.5 |      25 | 15-19,23-38,70-111,124-128   
 ecash-lib/src/ffi          |   28.26 |    15.94 |   16.98 |   28.98 |                              
  ecash_lib_wasm_browser.js |       0 |        0 |       0 |       0 | 3-336                        
  ecash_lib_wasm_nodejs.js  |    61.9 |       55 |   39.13 |   62.75 | ...1,197-215,237,250-251,255 
 ecash-lib/src/io           |   30.45 |       41 |    38.7 |   58.77 |                              
  bytes.ts                  |    3.77 |     62.5 |    6.66 |     7.4 | 13-64                        
  hex.ts                    |   41.55 |       50 |   44.44 |   82.35 | 41-45,50,58                  
  int.ts                    |       0 |        0 |       0 |       0 |                              
  str.ts                    |   46.15 |    83.33 |      40 |   85.71 | 15                           
  varsize.ts                |   16.32 |    21.05 |      40 |      32 | 14-24,40-47                  
  writer.ts                 |       0 |        0 |       0 |       0 |                              
  writerbytes.ts            |   42.37 |    40.62 |   53.33 |   83.33 | 33,43,53,63,79               
  writerlength.ts           |   53.33 |    83.33 |   53.84 |     100 | 1                            
 ecash-lib/src/test         |   44.93 |    36.23 |   47.05 |   86.84 |                              
  testRunner.ts             |   44.93 |    36.23 |   47.05 |   86.84 | 73-75,87-89,112,123,166,203  
 ecash-lib/src/token        |   31.48 |    28.44 |   28.57 |   60.11 |                              
  alp.ts                    |    42.5 |    53.12 |   43.47 |   82.92 | 110-123,142                  
  common.ts                 |   54.54 |    83.33 |     100 |     100 | 1                            
  empp.ts                   |   52.17 |       60 |   57.14 |   91.66 | 12                           
  slp.ts                    |   14.76 |     7.35 |       4 |    28.2 | ...7,174-178,185-197,201-211 
----------------------------|---------|----------|---------|---------|------------------------------

##teamcity[blockOpened name='Code Coverage Summary']
##teamcity[buildStatisticValue key='CodeCoverageAbsBCovered' value='796']
##teamcity[buildStatisticValue key='CodeCoverageAbsBTotal' value='2809']
##teamcity[buildStatisticValue key='CodeCoverageAbsRCovered' value='239']
##teamcity[buildStatisticValue key='CodeCoverageAbsRTotal' value='905']
##teamcity[buildStatisticValue key='CodeCoverageAbsMCovered' value='129']
##teamcity[buildStatisticValue key='CodeCoverageAbsMTotal' value='455']
##teamcity[buildStatisticValue key='CodeCoverageAbsLCovered' value='776']
##teamcity[buildStatisticValue key='CodeCoverageAbsLTotal' value='1730']
##teamcity[blockClosed name='Code Coverage Summary']
mv: cannot stat 'test_results/ecash-lib-integration-tests-junit.xml': No such file or directory
Build ecash-lib-integration-tests failed with exit code 1
This revision is now accepted and ready to land.Mon, Jan 13, 16:43
This revision was landed with ongoing or failed builds.Mon, Jan 13, 19:19
This revision was automatically updated to reflect the committed changes.