Page MenuHomePhabricator

[chronik] add blockchain.transaction.broadcast electrum method
Needs RevisionPublic

Authored by PiRK on Wed, Dec 18, 15:43.

Details

Reviewers
tobias_ruck
Group Reviewers
Restricted Project
Summary

A rpc to broadcast a raw hex transaction. No checks of any kind are done before broadcasting (tx may burn funds or tokens).

Test Plan

ninja check-functional

Event Timeline

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.38s

   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 failed with exit code 1

Tail of the build log:

    Checking chronik-plugin v0.1.0 (/work/chronik/chronik-plugin)
    Checking toml_datetime v0.6.8
    Checking serde_spanned v0.6.8
   Compiling pyo3 v0.23.3
    Checking mime v0.3.17
    Checking sync_wrapper v1.0.2
    Checking seahash v4.1.0
    Checking winnow v0.6.20
    Checking sync_wrapper v0.1.2
    Checking topo_sort v0.4.0
    Checking axum-core v0.4.5
    Checking tower v0.5.1
    Checking hyper-util v0.1.10
    Checking memoffset v0.9.1
    Checking tokio-tungstenite v0.24.0
    Checking serde_urlencoded v0.7.1
    Checking futures-executor v0.3.31
    Checking serde_path_to_error v0.1.16
    Checking unicode-segmentation v1.12.0
   Compiling karyon_jsonrpc_macro v0.1.8
    Checking matchit v0.7.3
    Checking base64 v0.22.1
    Checking unindent v0.2.3
    Checking futures v0.3.31
    Checking tower-http v0.5.2
    Checking convert_case v0.6.0
   Compiling chronik-bridge v0.1.0 (/work/chronik/chronik-bridge)
   Compiling librocksdb-sys v0.11.0+8.1.1
    Checking toml_edit v0.22.22
    Checking axum v0.7.9
    Checking toml v0.8.19
   Compiling pyo3-macros v0.23.3
    Checking chronik-plugin-impl v0.1.0 (/work/chronik/chronik-plugin-impl)
   Compiling aws-lc-rs v1.11.1
    Checking rustls-webpki v0.102.8
   Compiling rustls v0.23.19
    Checking futures-rustls v0.26.0
    Checking karyon_async_rustls v0.1.8
    Checking karyon_net v0.1.8
    Checking karyon_jsonrpc v0.1.8
    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: using `Result.or_else(|x| Err(y))`, which is more succinctly expressed as `map_err(|x| y)`
   --> chronik/chronik-http/src/electrum.rs:394:20
    |
394 |           let txid = self.node.bridge.broadcast_tx(&raw_tx, max_fee).or_else(
    |  ____________________^
395 | |             |_err| Err(RPCError::CustomError(1, "Failed to broadcast")),
396 | |         )?;
    | |_________^ help: try: `self.node.bridge.broadcast_tx(&raw_tx, max_fee).map_err(|_err| RPCError::CustomError(1, "Failed to broadcast"))`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bind_instead_of_map
    = note: `-D clippy::bind-instead-of-map` implied by `-D warnings`
    = help: to override `-D warnings` add `#[allow(clippy::bind_instead_of_map)]`

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-plugins failed with exit code 1

try to return useful error messages (as used by Electrum ABC)

Tail of the build log:

Build 'Bitcoin ABC Diffs / Diff Testing' #88580, branch 'refs/tags/phabricator/diff/51666'
Triggered 2024-12-18 16:29:24 by 'Phabricator Staging (phabricator-staging)'
Started 2024-12-18 16:29:32 on agent 'buildagent1'
Finished 2024-12-18 16:29:32 with status FAILURE 'Unable to collect changes'
VCS revisions: 'BitcoinABC_BitcoinAbcStaging' (Git, instance id 22): 'N/A' (checkout rules: '+:. => ./bitcoin-abc')
TeamCity URL https://build.bitcoinabc.org/buildConfiguration/BitcoinABC_BitcoinAbcStaging/872354 
TeamCity server version is 2024.12 (build 174331), server timezone: GMT (UTC)

[16:29:24]E: bt15 (7s)
[16:29:24]i: TeamCity server version is 2024.12 (build 174331)
[16:29:24] : Finalize build settings
[16:29:24] : Collecting changes in 2 VCS roots
[16:29:24] :	 [Collecting changes in 2 VCS roots] VCS Root details
[16:29:24] :		 [VCS Root details] "Bitcoin ABC Staging" {instance id=22, parent internal id=3, parent id=BitcoinABC_BitcoinAbcStaging, description: "ssh://vcs@reviews.bitcoinabc.org:2221/source/bitcoin-abc-staging.git#refs/heads/master"}
[16:29:24] :		 [VCS Root details] "abc-infrastructure" {instance id=24, parent internal id=7, parent id=AutomatedDeployments_BitcoinAbcDeveloperTools_AbcInfrastructure, description: "ssh://vcs@reviews.bitcoinabc.org:2221/source/infrastructure.git#refs/heads/master"}
[16:29:24]i: Loading current repository state for VCS root 'Bitcoin ABC Staging' (running for 7s)
[16:29:24]i:	 [Loading current repository state for VCS root 'Bitcoin ABC Staging'] Loading current repository state for VCS root 'abc-infrastructure' (running for 7s)
[16:29:24]i:		 [Loading current repository state for VCS root 'abc-infrastructure'] VCS root 'Bitcoin ABC Staging': git -c credential.helper= -c credential.helper=/opt/teamcity/temp/credHelper11748910532441627410.sh ls-remote origin
[16:29:24]i:		 [Loading current repository state for VCS root 'abc-infrastructure'] VCS root 'abc-infrastructure': git -c credential.helper= -c credential.helper=/opt/teamcity/temp/credHelper4930506229229572848.sh ls-remote origin
[16:29:24]i:		 [Loading current repository state for VCS root 'abc-infrastructure'] VCS root 'Bitcoin ABC Staging': kex_exchange_identification: read: Connection reset by peer
[16:29:24]i:		 [Loading current repository state for VCS root 'abc-infrastructure'] VCS root 'Bitcoin ABC Staging': Connection reset by 51.161.87.173 port 2221
[16:29:24]i:		 [Loading current repository state for VCS root 'abc-infrastructure'] VCS root 'Bitcoin ABC Staging': fatal: Could not read from remote repository.
[16:29:24]i:		 [Loading current repository state for VCS root 'abc-infrastructure'] VCS root 'Bitcoin ABC Staging': 
[16:29:24]i:		 [Loading current repository state for VCS root 'abc-infrastructure'] VCS root 'Bitcoin ABC Staging': Please make sure you have the correct access rights
[16:29:24]i:		 [Loading current repository state for VCS root 'abc-infrastructure'] VCS root 'Bitcoin ABC Staging': and the repository exists.
[16:29:24]i:		 [Loading current repository state for VCS root 'abc-infrastructure'] VCS root 'abc-infrastructure': Warning: Permanently added '[reviews.bitcoinabc.org]:2221' (ED25519) to the list of known hosts.
[16:29:25]i:		 [Loading current repository state for VCS root 'abc-infrastructure'] Detecting changes in VCS root 'abc-infrastructure' (used in 'Bitcoin-ABC Infra Checkout', 'Extract Electrum ABC from ABC' and 5 other configurations)
[16:29:25]i:		 [Loading current repository state for VCS root 'abc-infrastructure'] Will collect changes for 'abc-infrastructure' starting from revision 12d41b310f3393c8558065adbfa98f1a09578d1c
[16:29:25] : Compute revision for 'abc-infrastructure' in Automated Deployments / Bitcoin ABC Infra / Bitcoin-ABC Infra Checkout
[16:29:25] :	 [Compute revision for 'abc-infrastructure' in Automated Deployments / Bitcoin ABC Infra / Bitcoin-ABC Infra Checkout] Upper limit revision: 12d41b310f3393c8558065adbfa98f1a09578d1c
[16:29:25]i:	 [Compute revision for 'abc-infrastructure' in Automated Deployments / Bitcoin ABC Infra / Bitcoin-ABC Infra Checkout] MaxModId = 74135
[16:29:25] :	 [Compute revision for 'abc-infrastructure' in Automated Deployments / Bitcoin ABC Infra / Bitcoin-ABC Infra Checkout] Computed revision: 12d41b310f3393c8558065adbfa98f1a09578d1c
[16:29:32] : The build is removed from the queue to be prepared for the start
[16:29:32]E: Failed to collect changes, error: git -c credential.helper= -c credential.helper=/opt/teamcity/temp/credHelper11748910532441627410.sh ls-remote origin command failed.
exit code: 128
stderr: kex_exchange_identification: read: Connection reset by peer
Connection reset by 51.161.87.173 port 2221
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists., VCS root: "Bitcoin ABC Staging" {instance id=22, parent internal id=3, parent id=BitcoinABC_BitcoinAbcStaging, description: "ssh://vcs@reviews.bitcoinabc.org:2221/source/bitcoin-abc-staging.git#refs/heads/master"}
[16:29:32]E: Failed to collect changes, error: git -c credential.helper= -c credential.helper=/opt/teamcity/temp/credHelper11748910532441627410.sh ls-remote origin command failed.
exit code: 128
stderr: kex_exchange_identification: read: Connection reset by peer
Connection reset by 51.161.87.173 port 2221
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists., VCS root: "Bitcoin ABC Staging" {instance id=22, parent internal id=3, parent id=BitcoinABC_BitcoinAbcStaging, description: "ssh://vcs@reviews.bitcoinabc.org:2221/source/bitcoin-abc-staging.git#refs/heads/master"}
[16:29:32] : Build finished

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.39s

   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 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.37s

   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

add tests for success and most errors

test/functional/chronik_electrum_blockchain.py
165 ↗(On Diff #51669)

Using the wallet rather than using directly the node to generate blocks ensures that the utxo set in the wallet is kept up to date

PiRK published this revision for review.Wed, Dec 18, 21:10
PiRK retitled this revision from [chronik] add blockchain.transaction.boradcast electrum method to [chronik] add blockchain.transaction.broadcast electrum method.
PiRK edited the test plan for this revision. (Show Details)

Tail of the build log:

    Checking toml_datetime v0.6.8
    Checking serde_spanned v0.6.8
   Compiling pyo3 v0.23.3
    Checking winnow v0.6.20
    Checking mime v0.3.17
    Checking sync_wrapper v1.0.2
    Checking topo_sort v0.4.0
    Checking sync_wrapper v0.1.2
    Checking seahash v4.1.0
    Checking tower v0.5.1
    Checking axum-core v0.4.5
    Checking hyper-util v0.1.10
    Checking memoffset v0.9.1
    Checking tokio-tungstenite v0.24.0
    Checking serde_urlencoded v0.7.1
    Checking futures-executor v0.3.31
    Checking serde_path_to_error v0.1.16
    Checking matchit v0.7.3
   Compiling karyon_jsonrpc_macro v0.1.8
    Checking base64 v0.22.1
    Checking unindent v0.2.3
    Checking unicode-segmentation v1.12.0
    Checking futures v0.3.31
    Checking tower-http v0.5.2
    Checking convert_case v0.6.0
    Checking toml_edit v0.22.22
   Compiling chronik-bridge v0.1.0 (/work/chronik/chronik-bridge)
   Compiling librocksdb-sys v0.11.0+8.1.1
    Checking axum v0.7.9
    Checking toml v0.8.19
   Compiling pyo3-macros v0.23.3
    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 futures-rustls v0.26.0
    Checking karyon_async_rustls v0.1.8
    Checking karyon_net v0.1.8
    Checking karyon_jsonrpc v0.1.8
    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 loop variable `i` is only used to index `POSSIBLE_MSG_FRAGMENTS`
   --> chronik/chronik-http/src/electrum.rs:443:22
    |
443 |             for i in 0..POSSIBLE_MSG_FRAGMENTS.len() {
    |                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop
    = note: `-D clippy::needless-range-loop` implied by `-D warnings`
    = help: to override `-D warnings` add `#[allow(clippy::needless_range_loop)]`
help: consider using an iterator
    |
443 |             for <item> in &POSSIBLE_MSG_FRAGMENTS {
    |                 ~~~~~~    ~~~~~~~~~~~~~~~~~~~~~~~

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

remove unneeded rehash and wrong comment

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.37s

   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

improve for loop as per clippy's advice

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.39s

   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 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.39s

   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

I updated the diff a bit too fast, so some of these recent errors are from previous versions of the diff.

Failed tests logs:

====== Bitcoin ABC functional tests: rpc_psbt.py ======

------- Stdout: -------
2024-12-18T21:28:49.969000Z TestFramework (INFO): Initializing test directory /work/abc-ci-builds/build-diff/test/tmp/test_runner_₿₵_🏃_20241218_212848/rpc_psbt_2
2024-12-18T21:28:52.980000Z TestFramework (INFO): Test walletcreatefundedpsbt feeRate of 100,000 XEC/kB produces a total fee at or slightly below -maxtxfee
2024-12-18T21:28:53.032000Z TestFramework (INFO): Test walletcreatefundedpsbt feeRate of 10,000,000 XEC/kB  produces a total fee well above -maxtxfee and raises RPC error
2024-12-18T21:28:53.092000Z TestFramework (INFO): Test various PSBT operations
2024-12-18T21:29:59.679000Z TestFramework (ERROR): Assertion failed
Traceback (most recent call last):
  File "/work/test/functional/test_framework/test_framework.py", line 149, in main
    self._run_test_internal()
  File "/work/test/functional/test_framework/test_framework.py", line 139, in _run_test_internal
    self.run_test()
  File "/work/test/functional/rpc_psbt.py", line 275, in run_test
    self.sync_mempools()
  File "/work/test/functional/test_framework/test_framework.py", line 800, in sync_mempools
    raise AssertionError(f"Mempool sync timed out after {timeout}s:{pool_str}")
AssertionError: Mempool sync timed out after 60s:
  {'e7c320bda107acdba9697d7c622f7528fa7b0e8dd486fd6eb9ab21f4b08021a5'}
  {'e7c320bda107acdba9697d7c622f7528fa7b0e8dd486fd6eb9ab21f4b08021a5'}
  set()
2024-12-18T21:29:59.731000Z TestFramework (INFO): Stopping nodes
2024-12-18T21:30:00.133000Z TestFramework (WARNING): Not cleaning up dir /work/abc-ci-builds/build-diff/test/tmp/test_runner_₿₵_🏃_20241218_212848/rpc_psbt_2
2024-12-18T21:30:00.134000Z TestFramework (ERROR): Test failed. Test logging available at /work/abc-ci-builds/build-diff/test/tmp/test_runner_₿₵_🏃_20241218_212848/rpc_psbt_2/test_framework.log
2024-12-18T21:30:00.134000Z TestFramework (ERROR): 
2024-12-18T21:30:00.134000Z TestFramework (ERROR): Hint: Call /work/test/functional/combine_logs.py '/work/abc-ci-builds/build-diff/test/tmp/test_runner_₿₵_🏃_20241218_212848/rpc_psbt_2' to consolidate all logs
2024-12-18T21:30:00.134000Z TestFramework (ERROR): 
2024-12-18T21:30:00.134000Z TestFramework (ERROR): If this failure happened unexpectedly or intermittently, please file a bug and provide a link or upload of the combined log.
2024-12-18T21:30:00.134000Z TestFramework (ERROR): https://github.com/Bitcoin-ABC/bitcoin-abc/issues
2024-12-18T21:30:00.134000Z TestFramework (ERROR):

Each failure log is accessible here:
Bitcoin ABC functional tests: rpc_psbt.py

PiRK planned changes to this revision.Thu, Dec 19, 07:53

investigating build failure

rebase to restart CI. I can't figure out why rpc_psbt.py failed, but it is clearly unrelated (nodes[2] never received an inv for the transaction)

Fabien added inline comments.
chronik/chronik-http/src/electrum.rs
445 ↗(On Diff #51679)

I don't understand. Why not simply RPCError::CustomError(1, err.what()) ?

chronik/chronik-http/src/electrum.rs
445 ↗(On Diff #51679)

As discussed in zoom, we will probably need to contribute some code upstream to be able to pass non-static strings to these RPCError::* errors.

error[E0597]: `err` does not live long enough
   --> chronik/chronik-http/src/electrum.rs:445:57
    |
398 |             let err = txid.err().unwrap();
    |                 --- binding `err` declared here
...
445 |                     return Err(RPCError::CustomError(1, err.what()));
    |                                                         ^^^-------
    |                                                         |
    |                                                         borrowed value does not live long enough
    |                                                         argument requires that `err` is borrowed for `'static`
...
455 |         }
    |         - `err` dropped here while still borrowed

leak, complete error messages

use a match no that the Err branch is a single liner

Tail of the build log:

  File "/work/abc-ci-builds/ecash-lib-integration-tests/test/functional/test_runner.py", line 361, in main
    os.makedirs(tmpdir)
  File "<frozen os>", line 225, in makedirs
FileExistsError: [Errno 17] File exists: '/work/abc-ci-builds/ecash-lib-integration-tests/test/tmp/test_runner_₿₵_🏃_20241220_083822'
Test runner completed with code 1
----------------------------|---------|----------|---------|---------|------------------------------
File                        | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s            
----------------------------|---------|----------|---------|---------|------------------------------
All files                   |   62.23 |     50.4 |   62.78 |   62.37 |                              
 ecash-lib                  |       0 |        0 |       0 |       0 |                              
  eslint.config.js          |       0 |        0 |       0 |       0 |                              
 ecash-lib/src              |   70.01 |     50.2 |   71.26 |    70.1 |                              
  consts.ts                 |       0 |      100 |     100 |       0 | 6-8                          
  ecc.ts                    |   57.14 |    83.33 |      40 |   57.14 | 23-31                        
  hash.ts                   |   88.88 |    83.33 |      80 |   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             |     100 |      100 |     100 |     100 |                              
  op.ts                     |      40 |    44.44 |   66.66 |      40 | ...4,107,109,117-122,133-161 
  opcode.ts                 |     100 |    83.33 |     100 |     100 | 1                            
  script.ts                 |   52.63 |    38.09 |      60 |    50.9 | ...4-135,146,156,166,188-199 
  sigHashType.ts            |   78.94 |       44 |   85.71 |   78.94 | 26-38                        
  tx.ts                     |   93.47 |    79.16 |    90.9 |   93.18 | 123-125                      
  txBuilder.ts              |   81.72 |    58.62 |   85.71 |   81.11 | ...1,154,173-178,183,253-257 
  unsignedTx.ts             |   49.27 |    30.18 |      60 |   50.38 | ...1,279,287,312,320,326-329 
 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           |   59.55 |    60.29 |   70.58 |   58.77 |                              
  bytes.ts                  |     7.4 |    71.42 |    12.5 |     7.4 | 13-64                        
  hex.ts                    |   82.05 |     62.5 |      80 |   82.35 | 41-45,50,58                  
  int.ts                    |       0 |        0 |       0 |       0 |                              
  str.ts                    |   85.71 |    83.33 |   66.66 |   85.71 | 15                           
  varsize.ts                |      32 |    36.36 |   66.66 |      32 | 14-24,40-47                  
  writer.ts                 |       0 |        0 |       0 |       0 |                              
  writerbytes.ts            |   83.33 |    68.42 |     100 |   83.33 | 33,43,53,63,79               
  writerlength.ts           |     100 |    83.33 |     100 |     100 | 1                            
 ecash-lib/src/test         |   89.02 |    54.16 |   89.47 |   89.47 |                              
  testRunner.ts             |   89.02 |    54.16 |   89.47 |   89.47 | 73-75,88-89,112,123,166      
 ecash-lib/src/token        |   87.15 |    72.85 |   93.33 |   87.07 |                              
  alp.ts                    |   82.92 |    89.47 |   83.33 |   82.92 | 110-123,142                  
  common.ts                 |     100 |    83.33 |     100 |     100 | 1                            
  empp.ts                   |    92.3 |       75 |     100 |   91.66 | 12                           
  slp.ts                    |   89.74 |    62.16 |     100 |   89.74 | ...9,161,167,175,178,197,202 
----------------------------|---------|----------|---------|---------|------------------------------

##teamcity[blockOpened name='Code Coverage Summary']
##teamcity[buildStatisticValue key='CodeCoverageAbsBCovered' value='819']
##teamcity[buildStatisticValue key='CodeCoverageAbsBTotal' value='1316']
##teamcity[buildStatisticValue key='CodeCoverageAbsRCovered' value='249']
##teamcity[buildStatisticValue key='CodeCoverageAbsRTotal' value='494']
##teamcity[buildStatisticValue key='CodeCoverageAbsMCovered' value='140']
##teamcity[buildStatisticValue key='CodeCoverageAbsMTotal' value='223']
##teamcity[buildStatisticValue key='CodeCoverageAbsLCovered' value='799']
##teamcity[buildStatisticValue key='CodeCoverageAbsLTotal' value='1281']
##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
tobias_ruck added a subscriber: tobias_ruck.
tobias_ruck added inline comments.
chronik/chronik-http/src/electrum.rs
398–399

This can be dangerous as it allows a slow memory exhaustion. I think instead we should log the error on the console and return a fixed string in the meantime to avoid this.

Also, we should consider changing karyon to support String custom errors...

This revision now requires changes to proceed.Fri, Dec 20, 09:52