Bitcoin SON on mainnet - deposit not identified #312

Closed
opened 2022-03-04 13:15:21 +00:00 by bobinson · 6 comments
bobinson commented 2022-03-04 13:15:21 +00:00 (Migrated from gitlab.com)

environment:

  • Mainnet version 1.5.16
  • 7 active mainnet SONs

Expected Result:

Bitcoin deposit to deposit address must succeed

Observations and result:

  • Bitcoin deposit address creation succeeded

  • enabled debug-rpc-calls option in the config

  • the BTC node is fully synced and receiving blocks

  • the BTC node is publishing ZMQ messages

  • the SON node is fully synced, active, producing heartbeats, and scheduling SONs

  • the SON node sees the BTC blocks and produces an RPC call to get the blocks using the bitcoin-cli

The Bitcoin deposit is not identified.

We need to test and verify this in detail

**environment:** - Mainnet version 1.5.16 - 7 active mainnet SONs **Expected Result:** Bitcoin deposit to deposit address must succeed **Observations and result:** - Bitcoin deposit address creation succeeded - enabled debug-rpc-calls option in the config - the BTC node is fully synced and receiving blocks - the BTC node is publishing ZMQ messages - the SON node is fully synced, active, producing heartbeats, and scheduling SONs - the SON node sees the BTC blocks and produces an RPC call to get the blocks using the bitcoin-cli The Bitcoin deposit is not identified. We need to test and verify this in detail
bobinson commented 2022-03-04 13:15:24 +00:00 (Migrated from gitlab.com)

assigned to @Hiltos1

assigned to @Hiltos1
bobinson commented 2022-03-04 13:16:23 +00:00 (Migrated from gitlab.com)

assigned to @serkixenos and unassigned @Hiltos1

assigned to @serkixenos and unassigned @Hiltos1
bobinson commented 2022-03-04 13:27:20 +00:00 (Migrated from gitlab.com)

changed the description

changed the description
Hiltos1 commented 2022-03-16 22:06:16 +00:00 (Migrated from gitlab.com)

@serkixenos

The Problem

I've been trying to send some BTC to my Peerplays account (using SONs) by sending some small BTC balances to my BTC deposit address on Peerplays. So far, the BTC makes it to the deposit address on the Bitcoin chain but then the SONs don't do anything. The BTC is never issued on the Peerplays chain to my account.

Details

  • My Peerplays account: hiltos1
  • BTC deposit address: bc1qvlg9lmdej9fn3ywp4f4lc924kwz648j9xcyfcdz6m42kash9sspse36m33

We can see this using the cli_wallet:

get_sidechain_address_by_account_and_sidechain hiltos1 bitcoin
{
  "id": "1.38.4",
  "sidechain_address_account": "1.2.9615",
  "sidechain": "bitcoin",
  "deposit_public_key": "02eb168313f558d07e204a8a3a6b13789a595e5311dca32038ec18b7ac0fb0f4df",
  "deposit_address": "bc1qvlg9lmdej9fn3ywp4f4lc924kwz648j9xcyfcdz6m42kash9sspse36m33",
  "deposit_address_data": "{ \"redeemScript\": \"2102eb168313f558d07e204a8a3a6b13789a595e5311dca32038ec18b7ac0fb0f4dfac635167007c2102f2be7c0784fdc2d379a3925e6408925c70f357e909c28ff6fb93e7f567b6af7fac635193687c2103a6e5b2b38d4d562f4c9fee983edb7555976c6450223203090da4765402f09197ac635193687c2103c1ffea0de5b23496bd7c1430e24be37a25487e9f1828a452fdcd95fcadf95264ac635193687c2102ce50b8836bb7b816015cad14736eb69d2e37de4fb417772f8d59ccf811179c92ac635193687c2103df4cfbe4aeb07bd1b9b633bf8053acef2e348d2de971ca513aa6f32fac8bfa93ac635193687c2103bcebb9e68c63d08385f47f6d01db88eaa321da60d3b71f7465e0d2e0c640dee1ac635193687c2103b3867b37f38f74c024d00bbd3bff091ec5b8300e9012111e686213d9197ae3ceac6351936855a268\", \"witnessScript\": \"002067d05fedb991533891c1aa6bfc1555b385aa9e4536089c345add556ec2e58403\" }",
  "withdraw_public_key": "0228437e93e45ab818232f0c61eea221bdfa5e027e02c4acc9db359763855ee3eb",
  "withdraw_address": "bc1q4yvyvrm6fet0qcyuxyjlvavn75607s6v3rxqd4",
  "valid_from": "2022-01-20T21:15:15",
  "expires": "2106-02-07T06:28:15"
}

I've tried sending BTC to the address, which will make it to a block and be confirmed on the Bitcoin chain. So to check if my SON can find the transaction:

  • I ran the ZMQ subscription app I built earlier.
  • I ran the Bitcoin node in the foreground to be able to view the output.
  • I turned on the debug-rpc-calls option in the SON config.

A Test with Results

  1. I send 0.0001 BTC to address bc1qvlg9lmdej9fn3ywp4f4lc924kwz648j9xcyfcdz6m42kash9sspse36m33 at March 16th, 2022 5:14pm EDT. The BTC Transaction is c05480e5da3b3e27126c15357057fd468ae990335d4e6cb10b90b1c4ff957ecc.
  2. The transaction is included in block 727,650 (block hash 00000000000000000008bd48055281773d6e2bc6308777ca40981b873c20670a).
  3. The ZMQ Subscriber program reads the published ZMQ message from the bitcoin node:
3|subscrib | --New Message--
3|subscrib | Topic: hashblock
3|subscrib | Message: 00000000000000000008bd48055281773d6e2bc6308777ca40981b873c20670a

This proves that the ZMQ messages are being published, and can be read.

  1. The SON logs show the RPC getBlock command (truncated here for convenience, see attached log file):
2022-03-16 22:19:51: 1191971ms th_q       sidechain_net_handler_bitcoin.cpp:852 send_post_request    ] ### Request URL:    http://127.0.0.1:8332/wallet/son-wallet
2022-03-16 22:19:51: 1191971ms th_q       sidechain_net_handler_bitcoin.cpp:853 send_post_request    ] ### Request:        {"jsonrpc": "1.0", "id":"getblock", "method": "getblock", "params": ["00000000000000000008BD48055281773D6E2BC6308777CA40981B873C20670A", 2] }
2022-03-16 22:19:51: 1191979ms th_q       sidechain_net_handler_bitcoin.cpp:855 send_post_request    ] ### Response:       {"result":{"hash":"00000000000000000008bd48055281773d6e2bc6308777ca40981b873c20670a","confirmations":1,"height":727650,"version":641548292,"versionHex":"263d4004","merkleroot":"40ef145bf900b5ea5d6cc5bb71e35ae9eeb63b6c64db30962e4ae55b87a3334a","time":1647465568,"mediantime":1647459560,"nonce":1416818015,"bits":"170a3773","difficulty":27550332084343.84,"chainwork":"00000000000000000000000000000000000000002a615e5026b616154cd0a849","nTx":3322,"previousblockhash":"0000000000000000000a1c2c0ecdb37d8beb1dd9a797358ab9225267fa31e0c7","strippedsize":834539,"size":1489449,"weight":3993066,"tx":[{"txid":"8ca28d950767dae8a5c47571f71559150c7880760c36811ca7775fb148b845db","hash":"8354e0213d6ebb28f0c15e24df819ebe1519826dec4380090554dd4278593a33","version":1,"size":296,"vsize":269,"weight":1076,"locktime":0,"vin":[{"coinbase":"03621a0bfabe6d6d49ccd43afef84e0391c9bd80013902a83610889792b2b15c64b4f1101d25a7f8010000000000000004650300be70f4e5000000000000009e339ee1112f736c7573682f","txinwitness":["0000000000000000000000000000000000000000000000000000000000000000"],"sequence":0}],"vout":[{"value":6.37084605,"n":0,"scriptPubKey":{"asm":"OP_DUP OP_HASH160 7c154ed1dc59609e3d26abb2df2ea3d587cd8c41 OP_EQUALVERIFY OP_CHECKSIG","hex":"76a9147c154ed1dc59609e3d26abb2df2ea3d587cd8c4188ac","address":"1CK6KHY6MHgYvmRQ4PAafKYDrg1ejbH1cE","type":"pubkeyhash"}},{"value":0.00000000,"n":1,"scriptPubKey":{"asm":"OP_RETURN 52534b424c4f434b3a4295608730cd7042205fb112e6c28f341aa3c57be9ce886633e88526003f7f92","hex":"6a4c2952534b424c4f434b3a4295608730cd7042205fb112e6c28f341aa3c57be9ce886633e88526003f7f92","type":"nulldata"}},{"value":0.00000000,"n":2,"scriptPubKey":{"asm":"OP_RETURN aa21a9ed019343d5dd9427088c82cb23f90ddabead81910a0d9516e2fde2f57c42d45727","hex":"6a24aa21a9ed019343d5dd9427088c82cb23f90ddabead81910a0d9516e2fde2f57c42d45727","type":"nulldata"}}],"hex":"010000000001010000000000000000000000000000000000000000000000000000000000000000ffffffff4b03621a0bfabe6d6d49ccd43afef84e0391c9bd80013902a83610889792b2b15c64b4f1101

Including my deposit address:

{"value":0.00010000,"n":60,"scriptPubKey":{"asm":"067d05fedb991533891c1aa6bfc1555b385aa9e4536089c345add556ec2e58403","hex":"002067d05fedb991533891c1aa6bfc1555b385aa9e4536089c345add556ec2e58403","address":"bc1qvlg9lmdej9fn3ywp4f4lc924kwz648j9xcyfcdz6m42kash9sspse36m33","type":"witness_v0_scripthash"}}

This Proves that the SON can see the transaction, and the deposit account.

  1. There are no errors. The SONs should create a proposal and handle this transaction, but that's not happening. It fails silently and stops here. I don't have any more visibility into the problem.dab-error__2022-03-16_22-19-57.zip
@serkixenos ## The Problem I've been trying to send some BTC to my Peerplays account (using SONs) by sending some small BTC balances to my BTC deposit address on Peerplays. So far, the BTC makes it to the deposit address on the Bitcoin chain but then the SONs don't do anything. The BTC is never issued on the Peerplays chain to my account. ## Details - My Peerplays account: `hiltos1` - BTC deposit address: `bc1qvlg9lmdej9fn3ywp4f4lc924kwz648j9xcyfcdz6m42kash9sspse36m33` We can see this using the cli_wallet: ``` get_sidechain_address_by_account_and_sidechain hiltos1 bitcoin { "id": "1.38.4", "sidechain_address_account": "1.2.9615", "sidechain": "bitcoin", "deposit_public_key": "02eb168313f558d07e204a8a3a6b13789a595e5311dca32038ec18b7ac0fb0f4df", "deposit_address": "bc1qvlg9lmdej9fn3ywp4f4lc924kwz648j9xcyfcdz6m42kash9sspse36m33", "deposit_address_data": "{ \"redeemScript\": \"2102eb168313f558d07e204a8a3a6b13789a595e5311dca32038ec18b7ac0fb0f4dfac635167007c2102f2be7c0784fdc2d379a3925e6408925c70f357e909c28ff6fb93e7f567b6af7fac635193687c2103a6e5b2b38d4d562f4c9fee983edb7555976c6450223203090da4765402f09197ac635193687c2103c1ffea0de5b23496bd7c1430e24be37a25487e9f1828a452fdcd95fcadf95264ac635193687c2102ce50b8836bb7b816015cad14736eb69d2e37de4fb417772f8d59ccf811179c92ac635193687c2103df4cfbe4aeb07bd1b9b633bf8053acef2e348d2de971ca513aa6f32fac8bfa93ac635193687c2103bcebb9e68c63d08385f47f6d01db88eaa321da60d3b71f7465e0d2e0c640dee1ac635193687c2103b3867b37f38f74c024d00bbd3bff091ec5b8300e9012111e686213d9197ae3ceac6351936855a268\", \"witnessScript\": \"002067d05fedb991533891c1aa6bfc1555b385aa9e4536089c345add556ec2e58403\" }", "withdraw_public_key": "0228437e93e45ab818232f0c61eea221bdfa5e027e02c4acc9db359763855ee3eb", "withdraw_address": "bc1q4yvyvrm6fet0qcyuxyjlvavn75607s6v3rxqd4", "valid_from": "2022-01-20T21:15:15", "expires": "2106-02-07T06:28:15" } ``` I've tried sending BTC to the address, which will make it to a block and be confirmed on the Bitcoin chain. So to check if my SON can find the transaction: - I ran the ZMQ subscription app I built earlier. - I ran the Bitcoin node in the foreground to be able to view the output. - I turned on the `debug-rpc-calls` option in the SON config. ## A Test with Results 1. I send `0.0001 BTC` to address `bc1qvlg9lmdej9fn3ywp4f4lc924kwz648j9xcyfcdz6m42kash9sspse36m33` at `March 16th, 2022 5:14pm EDT`. The BTC Transaction is `c05480e5da3b3e27126c15357057fd468ae990335d4e6cb10b90b1c4ff957ecc`. 2. The transaction is included in block `727,650` (block hash `00000000000000000008bd48055281773d6e2bc6308777ca40981b873c20670a`). 3. The ZMQ Subscriber program reads the published ZMQ message from the bitcoin node: ``` 3|subscrib | --New Message-- 3|subscrib | Topic: hashblock 3|subscrib | Message: 00000000000000000008bd48055281773d6e2bc6308777ca40981b873c20670a ``` **This proves that the ZMQ messages are being published, and can be read.** 4. The SON logs show the RPC getBlock command (truncated here for convenience, see attached log file): ``` 2022-03-16 22:19:51: 1191971ms th_q sidechain_net_handler_bitcoin.cpp:852 send_post_request ] ### Request URL: http://127.0.0.1:8332/wallet/son-wallet 2022-03-16 22:19:51: 1191971ms th_q sidechain_net_handler_bitcoin.cpp:853 send_post_request ] ### Request: {"jsonrpc": "1.0", "id":"getblock", "method": "getblock", "params": ["00000000000000000008BD48055281773D6E2BC6308777CA40981B873C20670A", 2] } 2022-03-16 22:19:51: 1191979ms th_q sidechain_net_handler_bitcoin.cpp:855 send_post_request ] ### Response: {"result":{"hash":"00000000000000000008bd48055281773d6e2bc6308777ca40981b873c20670a","confirmations":1,"height":727650,"version":641548292,"versionHex":"263d4004","merkleroot":"40ef145bf900b5ea5d6cc5bb71e35ae9eeb63b6c64db30962e4ae55b87a3334a","time":1647465568,"mediantime":1647459560,"nonce":1416818015,"bits":"170a3773","difficulty":27550332084343.84,"chainwork":"00000000000000000000000000000000000000002a615e5026b616154cd0a849","nTx":3322,"previousblockhash":"0000000000000000000a1c2c0ecdb37d8beb1dd9a797358ab9225267fa31e0c7","strippedsize":834539,"size":1489449,"weight":3993066,"tx":[{"txid":"8ca28d950767dae8a5c47571f71559150c7880760c36811ca7775fb148b845db","hash":"8354e0213d6ebb28f0c15e24df819ebe1519826dec4380090554dd4278593a33","version":1,"size":296,"vsize":269,"weight":1076,"locktime":0,"vin":[{"coinbase":"03621a0bfabe6d6d49ccd43afef84e0391c9bd80013902a83610889792b2b15c64b4f1101d25a7f8010000000000000004650300be70f4e5000000000000009e339ee1112f736c7573682f","txinwitness":["0000000000000000000000000000000000000000000000000000000000000000"],"sequence":0}],"vout":[{"value":6.37084605,"n":0,"scriptPubKey":{"asm":"OP_DUP OP_HASH160 7c154ed1dc59609e3d26abb2df2ea3d587cd8c41 OP_EQUALVERIFY OP_CHECKSIG","hex":"76a9147c154ed1dc59609e3d26abb2df2ea3d587cd8c4188ac","address":"1CK6KHY6MHgYvmRQ4PAafKYDrg1ejbH1cE","type":"pubkeyhash"}},{"value":0.00000000,"n":1,"scriptPubKey":{"asm":"OP_RETURN 52534b424c4f434b3a4295608730cd7042205fb112e6c28f341aa3c57be9ce886633e88526003f7f92","hex":"6a4c2952534b424c4f434b3a4295608730cd7042205fb112e6c28f341aa3c57be9ce886633e88526003f7f92","type":"nulldata"}},{"value":0.00000000,"n":2,"scriptPubKey":{"asm":"OP_RETURN aa21a9ed019343d5dd9427088c82cb23f90ddabead81910a0d9516e2fde2f57c42d45727","hex":"6a24aa21a9ed019343d5dd9427088c82cb23f90ddabead81910a0d9516e2fde2f57c42d45727","type":"nulldata"}}],"hex":"010000000001010000000000000000000000000000000000000000000000000000000000000000ffffffff4b03621a0bfabe6d6d49ccd43afef84e0391c9bd80013902a83610889792b2b15c64b4f1101 ``` Including my deposit address: ``` {"value":0.00010000,"n":60,"scriptPubKey":{"asm":"067d05fedb991533891c1aa6bfc1555b385aa9e4536089c345add556ec2e58403","hex":"002067d05fedb991533891c1aa6bfc1555b385aa9e4536089c345add556ec2e58403","address":"bc1qvlg9lmdej9fn3ywp4f4lc924kwz648j9xcyfcdz6m42kash9sspse36m33","type":"witness_v0_scripthash"}} ``` **This Proves that the SON can see the transaction, and the deposit account.** 5. There are no errors. The SONs should create a proposal and handle this transaction, but that's not happening. It fails silently and stops here. I don't have any more visibility into the problem.[dab-error__2022-03-16_22-19-57.zip](/uploads/89af8546c8a44229bfdc94e6fef9d65d/dab-error__2022-03-16_22-19-57.zip)
serkixenos commented 2022-03-18 17:11:08 +00:00 (Migrated from gitlab.com)
@Hiltos1 @hbelakon We identified root causes for this problem, and we are addressing them in the following tickets: https://gitlab.com/PBSA/peerplays/-/issues/313 https://gitlab.com/PBSA/peerplays/-/issues/314 https://gitlab.com/PBSA/peerplays/-/issues/324 https://gitlab.com/PBSA/peerplays/-/issues/325
hbelakon commented 2022-03-18 19:20:48 +00:00 (Migrated from gitlab.com)

T h a n k s

T h a n k s
serkixenos (Migrated from gitlab.com) closed this issue 2022-03-22 12:35:05 +00:00
Sign in to join this conversation.
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: Peerplays_Blockchain/peerplays_migrated#312
No description provided.