Page MenuHomePhabricator

[chronik-client] Support for broadcast-tx and broadcast-txs endpoints
ClosedPublic

Authored by bytesofman on Feb 14 2024, 01:47.

Details

Summary

Add support for broadcast-tx and broadcast-txs endpoints

Test Plan

CI or see test plan from D14915

Event Timeline

add a test for broadcastTxs with one bad tx

bytesofman retitled this revision from [chronik-client] Support for broadcast-tx endpoints to [chronik-client] Support for broadcast-tx and broadcast-txs endpoints.Feb 14 2024, 01:57
Fabien requested changes to this revision.Feb 14 2024, 08:46
Fabien added a subscriber: Fabien.
Fabien added inline comments.
modules/chronik-client/test/integration/broadcast_txs.ts
142 ↗(On Diff #45213)
192 ↗(On Diff #45213)

This doesn't do what you think it does

This revision now requires changes to proceed.Feb 14 2024, 08:46
PiRK added inline comments.
test/functional/setup_scripts/chronik-client_broadcast_txs.py
32 ↗(On Diff #45213)

Not needed for this one. The test does not use any of the wallet RPCs (see the wallet section https://www.bitcoinabc.org/doc/0.28.9/rpc/control/help/ + fundrawtransaction)

Here you are building the transactions by leveraging the fact that the coinbase output of coinblock is sent to a p2sh address that anyone can spend using the OP_TRUE script, so you don't need the wallet to manage any keys and addresses.

bytesofman marked 3 inline comments as done.

update test comments for rawtx with missing inputs, remove skip wallet checks from py script, clarify test comments

The build failed due to an unexpected infrastructure outage. The administrators have been notified to investigate. Sorry for the inconvenience.
The build failed due to an unexpected infrastructure outage. The administrators have been notified to investigate. Sorry for the inconvenience.
The build failed due to an unexpected infrastructure outage. The administrators have been notified to investigate. Sorry for the inconvenience.
The build failed due to an unexpected infrastructure outage. The administrators have been notified to investigate. Sorry for the inconvenience.
The build failed due to an unexpected infrastructure outage. The administrators have been notified to investigate. Sorry for the inconvenience.
The build failed due to an unexpected infrastructure outage. The administrators have been notified to investigate. Sorry for the inconvenience.
The build failed due to an unexpected infrastructure outage. The administrators have been notified to investigate. Sorry for the inconvenience.

pending infra back up for CI test

Fabien requested changes to this revision.Feb 14 2024, 15:03
Fabien added inline comments.
modules/chronik-client/test/integration/broadcast_txs.ts
194 ↗(On Diff #45234)

The comment is now correct, but the name is not

This revision now requires changes to proceed.Feb 14 2024, 15:03
bytesofman marked an inline comment as done.

correct var name

Failed tests logs:

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

------- Stdout: -------
2024-02-14T17:30:01.496000Z TestFramework (INFO): Initializing test directory /work/abc-ci-builds/build-debug/test/tmp/test_runner_₿₵_  _20240214_172550/interface_rest_57
2024-02-14T17:30:02.622000Z TestFramework (INFO): Mine blocks and send Bitcoin Cash to node 1
2024-02-14T17:30:06.923000Z TestFramework (INFO): Test the /tx URI
2024-02-14T17:30:06.924000Z TestFramework (INFO): Query an unspent TXO using the /getutxos URI
2024-02-14T17:30:06.935000Z TestFramework (INFO): Query a spent TXO using the /getutxos URI
2024-02-14T17:30:06.936000Z TestFramework (INFO): Query two TXOs using the /getutxos URI
2024-02-14T17:30:06.937000Z TestFramework (INFO): Query the TXOs using the /getutxos URI with a binary response
2024-02-14T17:30:06.937000Z TestFramework (INFO): Test the /getutxos URI with and without /checkmempool
2024-02-14T17:30:07.987000Z TestFramework (INFO): Test the /block, /blockhashbyheight and /headers URIs
2024-02-14T17:30:08.021000Z TestFramework (INFO): Test tx inclusion in the /mempool and /block URIs
2024-02-14T17:31:08.412000Z TestFramework (ERROR): Assertion failed
Traceback (most recent call last):
  File "/work/test/functional/test_framework/test_framework.py", line 148, in main
    self._run_test_internal()
  File "/work/test/functional/test_framework/test_framework.py", line 138, in _run_test_internal
    self.run_test()
  File "/work/test/functional/interface_rest.py", line 397, in run_test
    self.sync_all()
  File "/work/test/functional/test_framework/test_framework.py", line 821, in sync_all
    self.sync_mempools(nodes)
  File "/work/test/functional/test_framework/test_framework.py", line 793, in sync_mempools
    raise AssertionError(f"Mempool sync timed out after {timeout}s:{pool_str}")
AssertionError: Mempool sync timed out after 60s:
  {'55693c9e23c3b685186e4f1d56134099d4bc77a572f71165134b27638668daa0', '459f83e3df4296fd592c24556b66db24cf5c90371ea7eeafd389a38d430bd851', '5601e028250efc4d64fd7717e76f851b81561b714dfd3d85e5b8ef5842af618a'}
  set()
2024-02-14T17:31:08.463000Z TestFramework (INFO): Stopping nodes
2024-02-14T17:31:08.565000Z TestFramework (WARNING): Not cleaning up dir /work/abc-ci-builds/build-debug/test/tmp/test_runner_₿₵_  _20240214_172550/interface_rest_57
2024-02-14T17:31:08.565000Z TestFramework (ERROR): Test failed. Test logging available at /work/abc-ci-builds/build-debug/test/tmp/test_runner_₿₵_  _20240214_172550/interface_rest_57/test_framework.log
2024-02-14T17:31:08.565000Z TestFramework (ERROR): 
2024-02-14T17:31:08.565000Z TestFramework (ERROR): Hint: Call /work/test/functional/combine_logs.py '/work/abc-ci-builds/build-debug/test/tmp/test_runner_₿₵_  _20240214_172550/interface_rest_57' to consolidate all logs
2024-02-14T17:31:08.565000Z TestFramework (ERROR): 
2024-02-14T17:31:08.565000Z TestFramework (ERROR): If this failure happened unexpectedly or intermittently, please file a bug and provide a link or upload of the combined log.
2024-02-14T17:31:08.566000Z TestFramework (ERROR): https://github.com/Bitcoin-ABC/bitcoin-abc/issues
2024-02-14T17:31:08.566000Z TestFramework (ERROR):

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

need to review and run CI again

This revision is now accepted and ready to land.Feb 15 2024, 07:04