Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect sidechain deposit payout amounts #4

Open
MurrMcK opened this issue Oct 2, 2018 · 7 comments
Open

Incorrect sidechain deposit payout amounts #4

MurrMcK opened this issue Oct 2, 2018 · 7 comments
Labels
Sidechain This is a bug that specifically effects the sidechain code

Comments

@MurrMcK
Copy link

MurrMcK commented Oct 2, 2018

Using DriveNet 7, making a 10 BTC deposit to the sidechain caused me to receive 993.43923620 BTC on the sidechain (classified as mined). This is slightly below the 1 031.42929440 BTC that was classified as ¨Watch-only" on the main chain at the time.

There were similar results for the 10 BTC and 5 BTC deposits i made shortly afterwards (~1013 and ~1028 BTC received respectively). After that, however, a 2 BTC deposit successfully gave me 1.99981960 BTC on the sidechain, before the next 2 BTC deposit gave ~1037 BTC.

@CryptAxe CryptAxe changed the title Often receiving excess funds on sidechain after depositing from mainchain Incorrect sidechain deposit payout amounts Oct 7, 2018
@CryptAxe
Copy link
Contributor

CryptAxe commented Oct 7, 2018

An example of a deposit which paid out the incorrect amount on the sidechain:

Main chain rawtx:

030000003f000102ba6b3d80d2b445ca39fd3bc86e91bae2c1aa6541de4abc0a7b53237cc36c44c200000000171600141e893c049ed1be8f77ce11571dd0b94d26dabf5cfeffffffba6b3d80d2b445ca39fd3bc86e91bae2c1aa6541de4abc0a7b53237cc36c44c2020000006b483045022100bfdfc132e7584201c4c568850fd1bf0bf950baf9c520a78969155da2d12b393c0220766f462e2abc08ea05068cc8952a751acdce992bf8548e15fc4a727aa9364de10121028c43630c9bd8072758e6cfaab61e6605eac4408754a053975555fb6c86ed6160feffffff030000000000000000176a00147a3c9408d5902b5da1b0e0dc6adaf89a3f5a4482707d94230000000017a914624a69b27a0d33f5693b7819fab4b6250412f5a58770f87f02e90100001976a914d9c0818d6e69fdb64ccd1968788ad73c4cb490f788ac02483045022100c94da96abcc3c074027eb59b798ec3b895c07c59b9ab8b67554a01e98a53af4702203474e70c55336e79a0e741393a9946b43cd2b48ad4fdd9f5f1b30a94d8e83de4012102e8f8d521f2ebe7ec6d6293f209521c7769acf4aa5e63ecc71bfcc5ebed8bae65000c1a0000
{
  "txid": "570a40619627429b805ca2cb130cdd97ca2a2e2d50c94a1ac70bee1bc2bc0fe7",
  "hash": "20707247c1afddfb46591617d60bd49aaf2db2b2d2425394cb1ff6b19b018b16",
  "version": 3,
  "size": 432,
  "vsize": 349,
  "locktime": 6668,
  "vin": [
    {
      "txid": "c2446cc37c23537b0abc4ade4165aac1e2ba916ec83bfd39ca45b4d2803d6bba",
      "vout": 0,
      "scriptSig": {
        "asm": "00141e893c049ed1be8f77ce11571dd0b94d26dabf5c",
        "hex": "1600141e893c049ed1be8f77ce11571dd0b94d26dabf5c"
      },
      "txinwitness": [
        "3045022100c94da96abcc3c074027eb59b798ec3b895c07c59b9ab8b67554a01e98a53af4702203474e70c55336e79a0e741393a9946b43cd2b48ad4fdd9f5f1b30a94d8e83de401",
        "02e8f8d521f2ebe7ec6d6293f209521c7769acf4aa5e63ecc71bfcc5ebed8bae65"
      ],
      "sequence": 4294967294
    },
    {
      "txid": "c2446cc37c23537b0abc4ade4165aac1e2ba916ec83bfd39ca45b4d2803d6bba",
      "vout": 2,
      "scriptSig": {
        "asm": "3045022100bfdfc132e7584201c4c568850fd1bf0bf950baf9c520a78969155da2d12b393c0220766f462e2abc08ea05068cc8952a751acdce992bf8548e15fc4a727aa9364de1[ALL] 028c43630c9bd8072758e6cfaab61e6605eac4408754a053975555fb6c86ed6160",
        "hex": "483045022100bfdfc132e7584201c4c568850fd1bf0bf950baf9c520a78969155da2d12b393c0220766f462e2abc08ea05068cc8952a751acdce992bf8548e15fc4a727aa9364de10121028c43630c9bd8072758e6cfaab61e6605eac4408754a053975555fb6c86ed6160"
      },
      "sequence": 4294967294
    }
  ],
  "vout": [
    {
      "value": 0.00000000,
      "n": 0,
      "scriptPubKey": {
        "asm": "OP_RETURN 0 7a3c9408d5902b5da1b0e0dc6adaf89a3f5a4482",
        "hex": "6a00147a3c9408d5902b5da1b0e0dc6adaf89a3f5a4482",
        "type": "nulldata"
      }
    },
    {
      "value": 5.96934000,
      "n": 1,
      "scriptPubKey": {
        "asm": "OP_HASH160 624a69b27a0d33f5693b7819fab4b6250412f5a5 OP_EQUAL",
        "hex": "a914624a69b27a0d33f5693b7819fab4b6250412f5a587",
        "reqSigs": 1,
        "type": "scripthash",
        "addresses": [
          "3AejHe7QCYQKFHyFQBoBbGJ31LjjDYEyhL"
        ]
      }
    },
    {
      "value": 21002.80948848,
      "n": 2,
      "scriptPubKey": {
        "asm": "OP_DUP OP_HASH160 d9c0818d6e69fdb64ccd1968788ad73c4cb490f7 OP_EQUALVERIFY OP_CHECKSIG",
        "hex": "76a914d9c0818d6e69fdb64ccd1968788ad73c4cb490f788ac",
        "reqSigs": 1,
        "type": "pubkeyhash",
        "addresses": [
          "1LrNFBckAQSfxxs5jfjK6SsUW1GB1s8W8h"
        ]
      }
    }
  ]
}

sidechain deposit payout rawtx:

030000003f0001010000000000000000000000000000000000000000000000000000000000000000ffffffff0502e1060101ffffffff0500000000000000002321032fde58f43896cb564535a6378308f06d0fe4063aef01f45c994229439b7a3ee3acb8cf09cde80100001976a9147a3c9408d5902b5da1b0e0dc6adaf89a3f5a448288ac40420f00000000001976a914497f7d6b59281591c50b5e82fb4730adf0fbc10988ac0000000000000000fd4d024d490244007a3c9408d5902b5da1b0e0dc6adaf89a3f5a4482a0d309cde8010000030000003f022fc2ebdf8cdf99aecc46cfa0813dab7e32a88af30c81022a7241df9b3f71717e000000006b483045022100ac5f557facd94c9dbe13e41ebd18f44b353f22245847e536e2d8ad966213641102206026c5ea4d51d6a0c6cde9cede71940a9bb3eb39124ce44da1ed2ae5dc7ee45b0121024675084c1e31d42df9217061790c75a7b7f897f530ce4192297bb85a8df2ad89feffffff35e6c9c132bbe896b75b7ed7ce683db21b20c3f86cf5c2b25a8b2336905fab10020000006a473044022001f5e990332b92c2bc388f10b210dbf7932910914293f3adcdc92e5be3b53d46022035c32f138d283f0f33190d88ac23fc42b3105e9d7be4d02552a8164ed722a1cc0121028c43630c9bd8072758e6cfaab61e6605eac4408754a053975555fb6c86ed6160feffffff03705e8a290000000017a9140bfeea2457e5d41de4a83bc0163f048a417b8298870000000000000000176a00147a3c9408d5902b5da1b0e0dc6adaf89a3f5a4482b4328afce80100001976a914d9c0818d6e69fdb64ccd1968788ad73c4cb490f788ac0a1a000000000020745c4506c587171c555851a2f381a8ee007b113ee2ab55ecb0de62d42ff419c8185cbc3603a9bd1094bf4f7f83cce0a78cca22d9add5377957c7256159287261065db95bff7f011d91ab60070300000002dfd6d5e26df3356b0c945504b76af69ffe55d7017e9fde771a0563d529a1693aba6b3d80d2b445ca39fd3bc86e91bae2c1aa6541de4abc0a7b53237cc36c44c2010dc10000000000000000266a24aa21a9ede2f61c3f71d1defd3fa999dfa36953755c690689799962b48bebd836974e8cf90120000000000000000000000000000000000000000000000000000000000000000000000000
{
  "txid": "082795ff292f8adb1c7927bddf3fc08aa97b4370774161d3dead9db747264e65",
  "hash": "448e60afaf2967ba17a5917a953c854786668f9f2e01a611650bb572c0e2582b",
  "version": 3,
  "size": 852,
  "vsize": 825,
  "locktime": 0,
  "vin": [
    {
      "coinbase": "02e1060101",
      "sequence": 4294967295
    }
  ],
  "vout": [
    {
      "value": 0.00000000,
      "n": 0,
      "scriptPubKey": {
        "asm": "032fde58f43896cb564535a6378308f06d0fe4063aef01f45c994229439b7a3ee3 OP_CHECKSIG",
        "hex": "21032fde58f43896cb564535a6378308f06d0fe4063aef01f45c994229439b7a3ee3ac",
        "reqSigs": 1,
        "type": "pubkey",
        "addresses": [
          "12y7isSyuR9Pr2aFL5irt2DxTG7BYwqgbN"
        ]
      }
    },
    {
      "value": 20993.84012728,
      "n": 1,
      "scriptPubKey": {
        "asm": "OP_DUP OP_HASH160 7a3c9408d5902b5da1b0e0dc6adaf89a3f5a4482 OP_EQUALVERIFY OP_CHECKSIG",
        "hex": "76a9147a3c9408d5902b5da1b0e0dc6adaf89a3f5a448288ac",
        "reqSigs": 1,
        "type": "pubkeyhash",
        "addresses": [
          "1C9L1TNFJBSM7JepBeTDA6vAT4UvS4JMH7"
        ]
      }
    },
    {
      "value": 0.01000000,
      "n": 2,
      "scriptPubKey": {
        "asm": "OP_DUP OP_HASH160 497f7d6b59281591c50b5e82fb4730adf0fbc109 OP_EQUALVERIFY OP_CHECKSIG",
        "hex": "76a914497f7d6b59281591c50b5e82fb4730adf0fbc10988ac",
        "reqSigs": 1,
        "type": "pubkeyhash",
        "addresses": [
          "17hd4ACD6bXtebvENedo7C2sFsZUmJzYKQ"
        ]
      }
    },
    {
      "value": 0.00000000,
      "n": 3,
      "scriptPubKey": {
        "asm": "44007a3c9408d5902b5da1b0e0dc6adaf89a3f5a4482a0d309cde8010000030000003f022fc2ebdf8cdf99aecc46cfa0813dab7e32a88af30c81022a7241df9b3f71717e000000006b483045022100ac5f557facd94c9dbe13e41ebd18f44b353f22245847e536e2d8ad966213641102206026c5ea4d51d6a0c6cde9cede71940a9bb3eb39124ce44da1ed2ae5dc7ee45b0121024675084c1e31d42df9217061790c75a7b7f897f530ce4192297bb85a8df2ad89feffffff35e6c9c132bbe896b75b7ed7ce683db21b20c3f86cf5c2b25a8b2336905fab10020000006a473044022001f5e990332b92c2bc388f10b210dbf7932910914293f3adcdc92e5be3b53d46022035c32f138d283f0f33190d88ac23fc42b3105e9d7be4d02552a8164ed722a1cc0121028c43630c9bd8072758e6cfaab61e6605eac4408754a053975555fb6c86ed6160feffffff03705e8a290000000017a9140bfeea2457e5d41de4a83bc0163f048a417b8298870000000000000000176a00147a3c9408d5902b5da1b0e0dc6adaf89a3f5a4482b4328afce80100001976a914d9c0818d6e69fdb64ccd1968788ad73c4cb490f788ac0a1a000000000020745c4506c587171c555851a2f381a8ee007b113ee2ab55ecb0de62d42ff419c8185cbc3603a9bd1094bf4f7f83cce0a78cca22d9add5377957c7256159287261065db95bff7f011d91ab60070300000002dfd6d5e26df3356b0c945504b76af69ffe55d7017e9fde771a0563d529a1693aba6b3d80d2b445ca39fd3bc86e91bae2c1aa6541de4abc0a7b53237cc36c44c2010d OP_SIDECHAIN",
        "hex": "4d490244007a3c9408d5902b5da1b0e0dc6adaf89a3f5a4482a0d309cde8010000030000003f022fc2ebdf8cdf99aecc46cfa0813dab7e32a88af30c81022a7241df9b3f71717e000000006b483045022100ac5f557facd94c9dbe13e41ebd18f44b353f22245847e536e2d8ad966213641102206026c5ea4d51d6a0c6cde9cede71940a9bb3eb39124ce44da1ed2ae5dc7ee45b0121024675084c1e31d42df9217061790c75a7b7f897f530ce4192297bb85a8df2ad89feffffff35e6c9c132bbe896b75b7ed7ce683db21b20c3f86cf5c2b25a8b2336905fab10020000006a473044022001f5e990332b92c2bc388f10b210dbf7932910914293f3adcdc92e5be3b53d46022035c32f138d283f0f33190d88ac23fc42b3105e9d7be4d02552a8164ed722a1cc0121028c43630c9bd8072758e6cfaab61e6605eac4408754a053975555fb6c86ed6160feffffff03705e8a290000000017a9140bfeea2457e5d41de4a83bc0163f048a417b8298870000000000000000176a00147a3c9408d5902b5da1b0e0dc6adaf89a3f5a4482b4328afce80100001976a914d9c0818d6e69fdb64ccd1968788ad73c4cb490f788ac0a1a000000000020745c4506c587171c555851a2f381a8ee007b113ee2ab55ecb0de62d42ff419c8185cbc3603a9bd1094bf4f7f83cce0a78cca22d9add5377957c7256159287261065db95bff7f011d91ab60070300000002dfd6d5e26df3356b0c945504b76af69ffe55d7017e9fde771a0563d529a1693aba6b3d80d2b445ca39fd3bc86e91bae2c1aa6541de4abc0a7b53237cc36c44c2010dc1",
        "type": "nonstandard"
      }
    },
    {
      "value": 0.00000000,
      "n": 4,
      "scriptPubKey": {
        "asm": "OP_RETURN aa21a9ede2f61c3f71d1defd3fa999dfa36953755c690689799962b48bebd836974e8cf9",
        "hex": "6a24aa21a9ede2f61c3f71d1defd3fa999dfa36953755c690689799962b48bebd836974e8cf9",
        "type": "nulldata"
      }
    }
  ]
}

@CryptAxe
Copy link
Contributor

CryptAxe commented Oct 7, 2018

@MurrMcK Did you use a modified version of the deposit code or the "official" binary? At least one (and perhaps all?) of the incorrectly processed deposits seem to use segwit transactions (which at least one person modified the code to do that I know) while our code does not.

@CryptAxe CryptAxe added the Sidechain This is a bug that specifically effects the sidechain code label Oct 7, 2018
@MurrMcK
Copy link
Author

MurrMcK commented Oct 8, 2018

@CryptAxe I did not change any code at all. I tested some deposits with DriveNet-8 though, and did not run into any problems.

@CryptAxe
Copy link
Contributor

@MurrMcK thank you! So you've had a deposit actually go through correctly for you now?

@MurrMcK
Copy link
Author

MurrMcK commented Oct 14, 2018

@CryptAxe Yes. I made one deposit by itself and I got the correct amount on the sidechain. Then I also tried 2 deposits in the same block and both of those also came through correctly. So DriveNet-8 has had no problems with deposits for me.

@CryptAxe
Copy link
Contributor

👍

@CryptAxe
Copy link
Contributor

Leaving this open until I actually figure out exactly what went wrong but that is good.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Sidechain This is a bug that specifically effects the sidechain code
Projects
None yet
Development

No branches or pull requests

2 participants