Regtest does not reject dust transactions #98

Closed
opened 2018-02-22 19:55:27 +01:00 by jackrobison · 4 comments
jackrobison commented 2018-02-22 19:55:27 +01:00 (Migrated from github.com)

This transaction is rejected as being dust on lbrycrd_main:

{ 
  "txid": "6a78ecf9cc7ed8ce700075ebc0f6598aec0e3d969703c5d8ec3dbc6d115fb2fc",
  "size": 192,
  "version": 1,
  "locktime": 0,
  "vin": [
    {
      "txid": "7992634f28066c38a89b6e44ae81db23eceed663180bd2bd2604c6c7db351a10",
      "vout": 0,
      "scriptSig": {
        "asm": "3045022100dc3fc3d565ef852e94d05f69b852c1d36b1079603a5f42aaff2cae49a08495a402205530fe6170096e7d33ab6e44d88836824bebe787e0780b52c6d0eec3b6de9bef[ALL] 03be327adddbf705c863115dfaad45f3dceab48bccf58406b74a33595695867d0a",
        "hex": "483045022100dc3fc3d565ef852e94d05f69b852c1d36b1079603a5f42aaff2cae49a08495a402205530fe6170096e7d33ab6e44d88836824bebe787e0780b52c6d0eec3b6de9bef012103be327adddbf705c863115dfaad45f3dceab48bccf58406b74a33595695867d0a"
      },
      "sequence": 4294967295
    }
  ],
  "vout": [
    {
      "value": 0.00000000,
      "n": 0,
      "scriptPubKey": {
        "asm": "OP_DUP OP_HASH160 81a05dc24d35355bc880ed9998e1cc57e191bca0 OP_EQUALVERIFY OP_CHECKSIG",
        "hex": "76a91481a05dc24d35355bc880ed9998e1cc57e191bca088ac",
        "reqSigs": 1,
        "type": "pubkeyhash",
        "addresses": [
          "bQYfyRFjJ1xwx3qqtdb9htdHuv45KE8dAT"
        ]
      }
    }
  ]
}

while this regtest transaction is accepted:

  "txid": "4d9a274b782bb97bc685f6115e8eb8deaf873e4e9018e5d0ec832c8063d0400b",
  "size": 192,
  "version": 1,
  "locktime": 0,
  "vin": [
    {
      "txid": "0ad723f58eb5687c1ea8ff7f4c61a46167432012bf5f167d2b8e0a269e895874",
      "vout": 0,
      "scriptSig": {
        "asm": "3045022100b57b72c009bfa1e4bc84e67db045aa59383832328ac1a32261bcaabeaab0cb590220447778474c1b7edf97301dc22ba83ee44ca9cb497d505e3cc99e48bdd183ac9f[ALL] 02588081807c5a7e6f1486e99ba53dade8b80139e154a93f8d1a574df91cd4fbc1",
        "hex": "483045022100b57b72c009bfa1e4bc84e67db045aa59383832328ac1a32261bcaabeaab0cb590220447778474c1b7edf97301dc22ba83ee44ca9cb497d505e3cc99e48bdd183ac9f012102588081807c5a7e6f1486e99ba53dade8b80139e154a93f8d1a574df91cd4fbc1"
      },
      "sequence": 4294967295
    }
  ],
  "vout": [
    {
      "value": 0.00000000,
      "n": 0,
      "scriptPubKey": {
        "asm": "OP_DUP OP_HASH160 2c2f6e664a3c59565b4bb5e271962ecdecfbddbb OP_EQUALVERIFY OP_CHECKSIG",
        "hex": "76a9142c2f6e664a3c59565b4bb5e271962ecdecfbddbb88ac",
        "reqSigs": 1,
        "type": "pubkeyhash",
        "addresses": [
          "mjYar5L8Re5JJvY5JwVQkvPuzJi5F4jsCR"
        ]
      }
    }
  ]
}

This makes testing the transactions produced by lbryum difficult since the dust rules for the test environment do not match the live network.

This transaction is rejected as being dust on lbrycrd_main: ``` { "txid": "6a78ecf9cc7ed8ce700075ebc0f6598aec0e3d969703c5d8ec3dbc6d115fb2fc", "size": 192, "version": 1, "locktime": 0, "vin": [ { "txid": "7992634f28066c38a89b6e44ae81db23eceed663180bd2bd2604c6c7db351a10", "vout": 0, "scriptSig": { "asm": "3045022100dc3fc3d565ef852e94d05f69b852c1d36b1079603a5f42aaff2cae49a08495a402205530fe6170096e7d33ab6e44d88836824bebe787e0780b52c6d0eec3b6de9bef[ALL] 03be327adddbf705c863115dfaad45f3dceab48bccf58406b74a33595695867d0a", "hex": "483045022100dc3fc3d565ef852e94d05f69b852c1d36b1079603a5f42aaff2cae49a08495a402205530fe6170096e7d33ab6e44d88836824bebe787e0780b52c6d0eec3b6de9bef012103be327adddbf705c863115dfaad45f3dceab48bccf58406b74a33595695867d0a" }, "sequence": 4294967295 } ], "vout": [ { "value": 0.00000000, "n": 0, "scriptPubKey": { "asm": "OP_DUP OP_HASH160 81a05dc24d35355bc880ed9998e1cc57e191bca0 OP_EQUALVERIFY OP_CHECKSIG", "hex": "76a91481a05dc24d35355bc880ed9998e1cc57e191bca088ac", "reqSigs": 1, "type": "pubkeyhash", "addresses": [ "bQYfyRFjJ1xwx3qqtdb9htdHuv45KE8dAT" ] } } ] } ``` while this regtest transaction is accepted: ```{ "txid": "4d9a274b782bb97bc685f6115e8eb8deaf873e4e9018e5d0ec832c8063d0400b", "size": 192, "version": 1, "locktime": 0, "vin": [ { "txid": "0ad723f58eb5687c1ea8ff7f4c61a46167432012bf5f167d2b8e0a269e895874", "vout": 0, "scriptSig": { "asm": "3045022100b57b72c009bfa1e4bc84e67db045aa59383832328ac1a32261bcaabeaab0cb590220447778474c1b7edf97301dc22ba83ee44ca9cb497d505e3cc99e48bdd183ac9f[ALL] 02588081807c5a7e6f1486e99ba53dade8b80139e154a93f8d1a574df91cd4fbc1", "hex": "483045022100b57b72c009bfa1e4bc84e67db045aa59383832328ac1a32261bcaabeaab0cb590220447778474c1b7edf97301dc22ba83ee44ca9cb497d505e3cc99e48bdd183ac9f012102588081807c5a7e6f1486e99ba53dade8b80139e154a93f8d1a574df91cd4fbc1" }, "sequence": 4294967295 } ], "vout": [ { "value": 0.00000000, "n": 0, "scriptPubKey": { "asm": "OP_DUP OP_HASH160 2c2f6e664a3c59565b4bb5e271962ecdecfbddbb OP_EQUALVERIFY OP_CHECKSIG", "hex": "76a9142c2f6e664a3c59565b4bb5e271962ecdecfbddbb88ac", "reqSigs": 1, "type": "pubkeyhash", "addresses": [ "mjYar5L8Re5JJvY5JwVQkvPuzJi5F4jsCR" ] } } ] } ``` This makes testing the transactions produced by lbryum difficult since the dust rules for the test environment do not match the live network.
kaykurokawa commented 2018-02-23 17:03:54 +01:00 (Migrated from github.com)

I think we can change this. There are likely some unit tests that need to be changed because they use regtest rules.

I think we can change this. There are likely some unit tests that need to be changed because they use regtest rules.
kaykurokawa commented 2018-02-23 21:43:27 +01:00 (Migrated from github.com)

Actually the dust amount should be the same regardless of whether its main net or reg test, the default dust amount 0.00001. You can set these variables manually so maybe its set somewhere either on the main net client or regtest client?
( set by -minrelaytxfee , can check it via ./lbrycrd-cli getinfo in the field relayfee )

If that looks good, it must be rejected for some other reason. Can you describe how you generated these transactions?

Actually the dust amount should be the same regardless of whether its main net or reg test, the default dust amount 0.00001. You can set these variables manually so maybe its set somewhere either on the main net client or regtest client? ( set by -minrelaytxfee , can check it via ./lbrycrd-cli getinfo in the field relayfee ) If that looks good, it must be rejected for some other reason. Can you describe how you generated these transactions?
eukreign commented 2018-02-23 22:00:17 +01:00 (Migrated from github.com)

The accepted transaction done through regtest can be replicated by this integration test (message me on slack if you want help setting things up to run it):
https://github.com/lbryio/lbrytest/blob/master/tests/test_abandon.py#L20

As far as the real mainnet transaction, this was generated by @tzarebczan . See convo here: https://lbryians.slack.com/archives/C81K0BM9A/p1519158521000395

The accepted transaction done through regtest can be replicated by this integration test (message me on slack if you want help setting things up to run it): https://github.com/lbryio/lbrytest/blob/master/tests/test_abandon.py#L20 As far as the real mainnet transaction, this was generated by @tzarebczan . See convo here: https://lbryians.slack.com/archives/C81K0BM9A/p1519158521000395
kaykurokawa commented 2018-03-19 03:19:51 +01:00 (Migrated from github.com)

Please use this flag when running lbrycrdd in regtest mode : -acceptnonstdtxn=0
(run ./lbrycrdd -acceptnonstdtxn=0 )

Behavior is documented here: https://github.com/lbryio/lbrycrd/blob/master/src/init.cpp#L461

IsStandardTx is not used when running in regtest mode, thus dust transactions are not rejected. Using the above flag will enable the use of IsStandardTx and will reject dust transactions.

Please use this flag when running lbrycrdd in regtest mode : -acceptnonstdtxn=0 (run ./lbrycrdd -acceptnonstdtxn=0 ) Behavior is documented here: https://github.com/lbryio/lbrycrd/blob/master/src/init.cpp#L461 IsStandardTx is not used when running in regtest mode, thus dust transactions are not rejected. Using the above flag will enable the use of IsStandardTx and will reject dust transactions.
Sign in to join this conversation.
No milestone
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: LBRYCommunity/lbrycrd#98
No description provided.