Repository navigation
broken IPC on release tag sv2-tp-0.1.10-ipc #71
Copy link
Copy link
Closed
Description
I launched bitcoin-node via:
$ ./build/src/bitcoin-node -ipcbind=unix -testnet4
it seems to be running ok
then I launch bitcoin-mine, which breaks as soon as I try to connect a SRI pool to it:
$ ./build/src/bitcoin-mine -debug=sv2 -loglevel=sv2:trace -testnet4 -sv2port=8442
2024-11-29T15:23:43Z Ignoring unknown configuration value server
2024-11-29T15:23:43Z Default data directory /Users/plebhash/Library/Application Support/Bitcoin
2024-11-29T15:23:43Z Using data directory /Users/plebhash/Library/Application Support/Bitcoin/testnet4
2024-11-29T15:23:43Z Config file: /Users/plebhash/Library/Application Support/Bitcoin/bitcoin.conf
2024-11-29T15:23:43Z Command-line arg: debug="sv2"
2024-11-29T15:23:43Z Command-line arg: loglevel="sv2:trace"
2024-11-29T15:23:43Z Command-line arg: sv2port="8442"
2024-11-29T15:23:43Z Command-line arg: testnet4=""
Connected to bitcoin-node
2024-11-29T15:23:43Z [sv2] Reading cached static key from /Users/plebhash/Library/Application Support/Bitcoin/testnet4/sv2_static_key
2024-11-29T15:23:43Z [sv2:info] Static key: 031d7b82ac689a0b87e12b0abe927e878fb68136563dfab3e2df9da6e0dfb4dd69
2024-11-29T15:23:43Z Template Provider authority key: 9bq1mqn8BqfQmEMwsAKohN77s7YSS5K5hxw36TMBBKfAWKKpJye
2024-11-29T15:23:43Z [sv2:trace] Authority key: 9dacf485fc07a940224466ef013bec1232e630b0e61ef1c0d64048c5c183ad59
2024-11-29T15:23:43Z [sv2:trace] Certificate hashed data: 00006fce4967ffffffff1d7b82ac689a0b87e12b0abe927e878fb68136563dfab3e2df9da6e0dfb4dd69
2024-11-29T15:23:43Z [sv2:info] Template Provider listening on 127.0.0.1:8442
2024-11-29T15:23:43Z net thread start
2024-11-29T15:23:43Z sv2 thread start
2024-11-29T15:24:01Z [sv2:trace] Noise session receive state -> HANDSHAKE_STEP_1
2024-11-29T15:24:01Z [sv2:trace] New client id=0 connected
2024-11-29T15:24:01Z [sv2:trace] Read their ephemeral key
2024-11-29T15:24:01Z [sv2:trace] Mix hash: a22d2f324275944ae8237afd3d00b5d52d6f0573f0a73a62f9425c64ee3ca88e
2024-11-29T15:24:01Z [sv2:trace] Noise session receive state -> HANDSHAKE_STEP_2
2024-11-29T15:24:01Z [sv2:trace] Generate ephemeral key
2024-11-29T15:24:01Z [sv2:trace] Write our ephemeral key
2024-11-29T15:24:01Z [sv2:trace] Mix hash: 81a0a0fcc3158ed1ea1de56acde870f285047fc740c6891c5bdc948e4e0b36ad
2024-11-29T15:24:01Z [sv2:trace] Perform ECDH with the remote ephemeral key
2024-11-29T15:24:01Z [sv2:trace] Mix key with ECDH result: ephemeral ours -- remote ephemeral
2024-11-29T15:24:01Z [sv2:trace] Chaining key: 1bf1826e42479cc3d271f6845247a02193b612de6cea2b6689a8e56998e54ef0
2024-11-29T15:24:01Z [sv2:trace] Encrypt and write our static key
2024-11-29T15:24:01Z [sv2:trace] Mix hash: 323e8f710d6a28b53bc69338a0f33c4c5a47b7216383facada3108ff02898bc4
2024-11-29T15:24:01Z [sv2:trace] Perform ECDH between our static and remote ephemeral key
2024-11-29T15:24:01Z [sv2:trace] ECDH result: b2145d79410c79f7e6bcea690e8970144d7c6a6ea57e68f6a38a87f69fb3add6
2024-11-29T15:24:01Z [sv2:trace] Mix key with ECDH result: static ours -- remote ephemeral
2024-11-29T15:24:01Z [sv2:trace] Chaining key: 3fe3bc65efb2cbb76273643a6dba9b2cc6079e0809f72fbd3d569061fbb40d23
2024-11-29T15:24:01Z [sv2:trace] Encrypt certificate: 00006fce4967ffffffffeee1f11ae3181a0feefb90b409f1f1d32d7eccea0d87f56e47f4b8b32a600ff1afa780efb651dd06bb5970bfb7c2845e5287d3aed9230f0a4e648935d16c68ce
2024-11-29T15:24:01Z [sv2:trace] Mix hash: 4dc1082994eaa63737c7bfcb684385ca918e86b63fee3cf48e0425b5e0bea1ea
2024-11-29T15:24:01Z [sv2:trace] Noise session send state -> READY
2024-11-29T15:24:01Z [sv2:trace] Noise session receive state -> APP
2024-11-29T15:24:01Z [sv2:trace] Send 234 bytes to client id=0
2024-11-29T15:24:01Z [sv2:trace] Header: 000000190000
2024-11-29T15:24:01Z [sv2:trace] Expecting 25 bytes payload (plain)
2024-11-29T15:24:01Z [sv2:trace] Payload: 020200020000000000093132372e302e302e31fa2000000000
2024-11-29T15:24:01Z [sv2:trace] Noise session receive state -> APP_READY
2024-11-29T15:24:01Z [sv2:trace] Noise session receive state -> APP
2024-11-29T15:24:01Z [sv2] Received 0x00 SetupConnection from client id=0
2024-11-29T15:24:01Z [sv2] Send 0x01 SetupConnection.Success to client id=0
2024-11-29T15:24:01Z [sv2:trace] Header: 000001060000
2024-11-29T15:24:01Z [sv2:trace] Send 44 bytes to client id=0
2024-11-29T15:24:01Z [sv2:trace] Header: 000070040000
2024-11-29T15:24:01Z [sv2:trace] Expecting 4 bytes payload (plain)
2024-11-29T15:24:01Z [sv2:trace] Payload: 01000000
2024-11-29T15:24:01Z [sv2:trace] Noise session receive state -> APP_READY
2024-11-29T15:24:01Z [sv2:trace] Noise session receive state -> APP
2024-11-29T15:24:01Z [sv2] Received 0x70 CoinbaseOutputDataSize from client id=0
2024-11-29T15:24:01Z [sv2] coinbase_output_max_additional_size=1 bytes
2024-11-29T15:24:01Z
************************
EXCEPTION: N3ipc9ExceptionE
kj::Exception: (remote):0: failed: remote exception: std::exception: SpanReader::read(): end of data: unspecified iostream_category error
stack: 10369f7d0 102aa5e04 102aa6544
bitcoin in sv2
************************
EXCEPTION: N3ipc9ExceptionE
kj::Exception: (remote):0: failed: remote exception: std::exception: SpanReader::read(): end of data: unspecified iostream_category error
stack: 10369f7d0 102aa5e04 102aa6544
bitcoin in sv2
libc++abi: terminating due to uncaught exception of type ipc::Exception: kj::Exception: (remote):0: failed: remote exception: std::exception: SpanReader::read(): end of data: unspecified iostream_category error
stack: 10369f7d0 102aa5e04 102aa6544
[1] 87756 abort ./build/src/bitcoin-mine -debug=sv2 -loglevel=sv2:trace -testnet4
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Activity
Sjors commentedon Nov 29, 2024
Both
bitcoin-nodeandbitcoin-minewere built from the same commit? To be on the safe side, can you try deleting thebuilddir and re-compiling?(this kind of error can happen if the versions don't match, because the interface isn't stable yet)
I'll try to reproduce.
Sjors commentedon Nov 29, 2024
I get the same... will debug.
plebhash commentedon Nov 29, 2024
the logs above were generated after building a fresh clone, which was checked out at the release tag from the issue title
sv2-tp-0.1.10-ipcSjors commentedon Nov 29, 2024
Running the node with
-debug=ipcreveals a crash on receivingcreateNewBlock:I narrowed it down to the
scriptPubKeyargument, because it still crashed when I dropped the options argument:I then "solved" the issue by including bitcoin#31318 in the sv2-ipc branch (#48), which for unrelated reasons drops that argument. Will bake a new release.
Sjors commentedon Nov 29, 2024
@plebhash I'm still baking the binaries, but you should be able to test by building the new
sv2-tp-0.1.11-ipctag from source.plebhash commentedon Nov 30, 2024
fixed on release
sv2-tp-0.1.11-ipcmaflcko commentedon Dec 2, 2024
Is there a reason why passing empty data leads to a crash? And why does bitcoin#31318 fix it, given that the argument is merely made an option, so the same crash could still be triggered, no?
Sjors commentedon Dec 2, 2024
@maflcko it always crashes, even with a regular
scriptPubKey.I haven't tried passing a
scriptPubKeyoption through the interface. There's currently no use case for that. It's only used by unit tests that don't use the interface and by the RPC internally which also don't use it.Hence my suggestion in bitcoin#30437 (comment) that we have the demo util cover all methods (and arguments).
maflcko commentedon Dec 2, 2024
For reference, the traceback seems to be:
This indicates that the error likely happens when (not) writing the compact size of the script/prevector.
move: add mp/type-data.h
move: add mp/type-data.h
test: Add test for IPC serialization bug
test: Add test for IPC serialization bug
test: Add test for IPC serialization bug
Squashed 'src/ipc/libmultiprocess/' changes from 3c69d12..27ada40809
test: Add test for IPC serialization bug
test: Add test for IPC serialization bug
test: Add test for IPC serialization bug
move: add mp/type-data.h