Skip to content

bitcoin-mine segfault when receiving SubmitSolution on release sv2-tp-0.1.11-ipc #72

Description

@plebhash

after moving on from #71 by building release tag sv2-tp-0.1.11-ipc, I was able to successfully launch bitcoin-node and bitcoin-mine and connect a SRI Pool to it

then, I launched a tProxy with config-examples/tproxy-config-local-pool-example.toml config file, while changing the following:

-min_individual_miner_hashrate=10_000_000_000_000.0
+min_individual_miner_hashrate=12_000.0 # CPU mining on a Macbook Pro M2 doing 12 kH/s

only a few seconds after launching minerd, I could see that MULTIPLE blocks were found on Pool logs, and then Pool lost connection with TP:

2024-11-30T04:58:12.429275Z  INFO pool_sv2::lib::template_receiver: Connected to template distribution server at 127.0.0.1:8442
2024-11-30T04:58:12.431489Z  INFO roles_logic_sv2::handlers::common: Received SetupConnectionSuccess: version=2, flags=0
2024-11-30T04:58:12.431641Z  INFO pool_sv2::lib::mining_pool: PUB KEY: Ok([TxOut { value: 0, script_pubkey: Script(OP_0 OP_PUSHBYTES_20 ebe1b7dcc293ccaa0ee743a86f89df8258c208fc) }])
2024-11-30T04:58:12.431699Z  INFO pool_sv2::lib::mining_pool: Starting up pool listener
2024-11-30T04:58:12.431867Z  INFO pool_sv2::lib::mining_pool: Listening for encrypted connection on: 0.0.0.0:34254
2024-11-30T04:58:15.651875Z  INFO roles_logic_sv2::handlers::template_distribution: Received NewTemplate with id: 1, is future: true
2024-11-30T04:58:15.652165Z  INFO roles_logic_sv2::handlers::template_distribution: Received SetNewPrevHash for template: 1
2024-11-30T04:58:23.975206Z  INFO roles_logic_sv2::handlers::common: Received SetupConnection: version=2, flags=100
2024-11-30T04:58:23.975749Z  INFO roles_logic_sv2::handlers::mining: Received OpenExtendedMiningChannel from: ABC with id: 0
2024-11-30T04:58:29.996117Z ERROR roles_logic_sv2::channel_logic::channel_factory: Share does not meet any target: Extended(SubmitSharesExtended { channel_id: 1, sequence_number: 0, job_id: 1, nonce: 2667577408, ntime: 1732942692, version: 536870912, extranonce: Owned([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0]) })
2024-11-30T04:58:30.027898Z  INFO roles_logic_sv2::channel_logic::channel_factory: Share hash meet bitcoin target: "000002caa6e0a78d276e2d691a4dd04a7e0a0dc4ddbe0377177afaf87726e28a"
2024-11-30T04:58:30.028031Z ERROR roles_logic_sv2::channel_logic::channel_factory: Share does not meet any target: Extended(SubmitSharesExtended { channel_id: 1, sequence_number: 0, job_id: 1, nonce: 836676202, ntime: 1732942692, version: 536870912, extranonce: Owned([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0]) })
2024-11-30T04:58:30.028058Z ERROR roles_logic_sv2::channel_logic::channel_factory: Share does not meet any target: Extended(SubmitSharesExtended { channel_id: 1, sequence_number: 0, job_id: 1, nonce: 3483456789, ntime: 1732942692, version: 536870912, extranonce: Owned([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0]) })
2024-11-30T04:58:30.028132Z  INFO pool_sv2::lib::template_receiver: Sending Solution to TP: SubmitSolution { template_id: 1, version: 536870912, header_timestamp: 1732942692, header_nonce: 2262608490, coinbase_tx: Owned([2, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 255, 55, 2, 139, 1, 0, 83, 116, 114, 97, 116, 117, 109, 32, 118, 50, 32, 83, 82, 73, 32, 80, 111, 111, 108, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 255, 2, 0, 242, 5, 42, 1, 0, 0, 0, 22, 0, 20, 235, 225, 183, 220, 194, 147, 204, 170, 14, 231, 67, 168, 111, 137, 223, 130, 88, 194, 8, 252, 0, 0, 0, 0, 0, 0, 0, 0, 38, 106, 36, 170, 33, 169, 237, 226, 246, 28, 63, 113, 209, 222, 253, 63, 169, 153, 223, 163, 105, 83, 117, 92, 105, 6, 137, 121, 153, 98, 180, 139, 235, 216, 54, 151, 78, 140, 249, 1, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]) }
2024-11-30T04:58:30.128245Z ERROR roles_logic_sv2::channel_logic::channel_factory: Share does not meet any target: Extended(SubmitSharesExtended { channel_id: 1, sequence_number: 0, job_id: 1, nonce: 2833820778, ntime: 1732942692, version: 536870912, extranonce: Owned([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0]) })
...
2024-11-30T04:58:30.533451Z  INFO roles_logic_sv2::channel_logic::channel_factory: Share hash meet bitcoin target: "0000020be23be74ac923aa5c4993507e0a73dc25b8e5a0869163d571fa43afa3"
2024-11-30T04:58:30.533532Z  INFO pool_sv2::lib::template_receiver: Sending Solution to TP: SubmitSolution { template_id: 1, version: 536870912, header_timestamp: 1732942692, header_nonce: 929368576, coinbase_tx: Owned([2, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 255, 55, 2, 139, 1, 0, 83, 116, 114, 97, 116, 117, 109, 32, 118, 50, 32, 83, 82, 73, 32, 80, 111, 111, 108, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 255, 2, 0, 242, 5, 42, 1, 0, 0, 0, 22, 0, 20, 235, 225, 183, 220, 194, 147, 204, 170, 14, 231, 67, 168, 111, 137, 223, 130, 88, 194, 8, 252, 0, 0, 0, 0, 0, 0, 0, 0, 38, 106, 36, 170, 33, 169, 237, 226, 246, 28, 63, 113, 209, 222, 253, 63, 169, 153, 223, 163, 105, 83, 117, 92, 105, 6, 137, 121, 153, 98, 180, 139, 235, 216, 54, 151, 78, 140, 249, 1, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]) }
2024-11-30T04:58:30.540348Z ERROR roles_logic_sv2::channel_logic::channel_factory: Share does not meet any target: Extended(SubmitSharesExtended { channel_id: 1, sequence_number: 0, job_id: 1, nonce: 3756263808, ntime: 1732942692, version: 536870912, extranonce: Owned([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0]) })
...
2024-11-30T04:58:33.812914Z ERROR network_helpers_sv2::noise_connection_tokio: Disconnected from client while reading : Connection reset by peer (os error 54) - 127.0.0.1:8442
2024-11-30T04:58:33.813122Z ERROR pool_sv2::lib: SHUTDOWN from Upstream: Channel recv failed: `RecvError`
Try to reconnecting or connecting to a new upstream

and bitcoin-mine broke with a segfault:

./build/src/bitcoin-mine -debug=sv2 -loglevel=sv2:trace -signet -sv2port=8442
2024-11-30T04:47:37Z Ignoring unknown configuration value server
2024-11-30T04:47:37Z Ignoring unknown configuration value signet.connect
2024-11-30T04:47:37Z Ignoring unknown configuration value signet.server
2024-11-30T04:47:37Z Ignoring unknown configuration value signet.rpcuser
2024-11-30T04:47:37Z Ignoring unknown configuration value signet.rpcpassword
2024-11-30T04:47:37Z Signet with challenge 51
2024-11-30T04:47:37Z Default data directory /Users/plebhash/Library/Application Support/Bitcoin
2024-11-30T04:47:37Z Using data directory /Users/plebhash/Library/Application Support/Bitcoin/signet
2024-11-30T04:47:37Z Config file: /Users/plebhash/Library/Application Support/Bitcoin/bitcoin.conf
2024-11-30T04:47:37Z Config file arg: [signet] debug="rpc"
2024-11-30T04:47:37Z Config file arg: [signet] debug="sv2"
2024-11-30T04:47:37Z Config file arg: [signet] loglevel="sv2:debug"
2024-11-30T04:47:37Z Config file arg: [signet] signetchallenge="51"
2024-11-30T04:47:37Z Config file arg: [signet] sv2port="8442"
2024-11-30T04:47:37Z Command-line arg: debug="sv2"
2024-11-30T04:47:37Z Command-line arg: loglevel="sv2:trace"
2024-11-30T04:47:37Z Command-line arg: signet=""
2024-11-30T04:47:37Z Command-line arg: sv2port="8442"
Connected to bitcoin-node
2024-11-30T04:47:37Z [sv2] Generated static key, saved to /Users/plebhash/Library/Application Support/Bitcoin/signet/sv2_static_key
2024-11-30T04:47:37Z [sv2:info] Static key: 036cb18488d0b3e5f05bc20ce26d182d06fbc65ae86f18f67c78eb3b5f5c8eeace
2024-11-30T04:47:37Z [sv2] Generated authority key, saved to /Users/plebhash/Library/Application Support/Bitcoin/signet/sv2_authority_key
2024-11-30T04:47:37Z Template Provider authority key: 9bn6KvBNmp29GJ1WZvCwGm7HuACHQc8Uniq9gR6rPWeFeoL3oem
2024-11-30T04:47:37Z [sv2:info] Template Provider listening on 127.0.0.1:8442
2024-11-30T04:47:37Z net thread start
2024-11-30T04:47:37Z sv2 thread start
2024-11-30T04:47:40Z [sv2] Received 0x00 SetupConnection from client id=0
2024-11-30T04:47:40Z [sv2] Send 0x01 SetupConnection.Success to client id=0
2024-11-30T04:47:40Z [sv2] Received 0x70 CoinbaseOutputDataSize from client id=0
2024-11-30T04:47:40Z [sv2] coinbase_output_max_additional_size=1 bytes
2024-11-30T04:47:41Z [sv2] Send 0x71 NewTemplate id=1 future=1 to client id=0
2024-11-30T04:47:41Z [sv2] Send 0x72 SetNewPrevHash to client id=0
2024-11-30T04:49:01Z [sv2] Received 0x76 SubmitSolution from client id=0
[1]    91293 segmentation fault  ./build/src/bitcoin-mine -debug=sv2 -loglevel=sv2:trace -signet -sv2port=8442

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions