ssadler / zeno

Multiprotocol cross chain daemon
BSD 3-Clause "New" or "Revised" License
12 stars 4 forks source link

mandatory-script-verify-flag-failed (Script evaluated without error but finished with a false/empty top stack element) #19

Open Alrighttt opened 4 years ago

Alrighttt commented 4 years ago
[11:33:21][Debug] Proposer is: 0xc268dd444cd76d4a203acddbb8a235c7dac59bcb
[11:33:22][Info] Broadcast transaction: "bbbcc13c2fe5bc35d73f62b3d86036670eace759123dbc97e60c16a48dc2f6ed"
[11:33:22][Error] Json RPC: (http://127.0.0.1:26784/,"{\"jsonrpc\":\"2.0\",\"params\":[\"0400008085202f8904d0e4e3486ea970daa1cb3c97216f96ea5ff6257a71ac2d43c7cb7e37d04dbc4b0b0000004847304402207a21d81ef7ae31fdb5c6aa1ef1e255db30da05fbc0a79fbf7594bcade7867b6802202acd7b154f0ff3e422621c99229a93319eb1d8e2559a2f3e1a05ca877bb8fe5801ffffffffadc794c003fb63b4c1fd3e16c58a7056961d39bf73bcd4805d9f6d0910d2e9370200000049483045022100b1fc3878a851565fc7f77f0cd58007181b4dc3572b2922522266d683dd8e3be10220717da620c69756d385e8e1998cea6c540075716ac6248318ac6d62b78f95dda501ffffffffc7eb8403b264e00a26eb12f7da32eaec6cf1e9c5aea45ad3af55bdc682b24ecc0700000049483045022100c228003fc4756ac7e1fd7ba98bfacac7c8510e67a3326ad4a8e5f59a432b420b02202c88749297fb8c425c445127b5b0cf2aaafe219fa0ca9b0cc26744b0674987ee01ffffffffc26d4f623ce94a88c59fbcec3a8386cf6bf5d18ef7111943050174181755045e080000004847304402202fec611cb1633a3e4baf777be0fabcc54bc41b9277efac141f3c6ede5ee2b61f02203dec00147053e6126abff07b5f6a19e1a352e4f3252e7986884b06a2df71f15701ffffffff027a260000000000002321020e46e79a2a8d12b9b5d12c7a91adb4e454edfae43c0a0cb805427d2ac7613fd9ac0000000000000000736a4c7036d359ed61aca65e663911df53e2d21eb39e41cb6c826f7bcbc35baa4312ca00fc300000007be60200000000000000000000000000000000000000000000000000000000545853434c5a330000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\"],\"method\":\"sendrawtransaction\",\"id\":1}")
[11:33:22][Error] Thread "Round c4487523801e (ROPSTEN.8119810 ⇒  TXSCLZ3)" died with: RPCException "{\"code\":-26,\"message\":\"16: mandatory-script-verify-flag-failed (Script evaluated without error but finished with a false/empty top stack element)\"}"
[11:33:22][Warn] RPCException "{\"code\":-26,\"message\":\"16: mandatory-script-verify-flag-failed (Script evaluated without error but finished with a false/empty top stack element)\"}"

I experienced this on my TXSCLZ3 node. I believe it indicates an issue with one of the signatures.

ssadler commented 4 years ago

@Alrighttt could you post the output of zeno version?

Alrighttt commented 4 years ago

zeno 0.2.3.0 master@c97e6a44 Jun 17 (commit 189) (dirty)

It may be that one of the other participating nodes is on an older version. I will do some research and figure out which signature is bad.

Alrighttt commented 4 years ago

The second vin of the transaction from Tony's node returns with a false stack element, indicating the signature is malformed. Doesn't really tell us how or why.

    {
      "txid": "37e9d210096d9f5d80d4bc73bf391d9656708ac5163efdc1b463fb03c094c7ad",
      "vout": 2,
      "scriptSig": {
        "asm": "3045022100b1fc3878a851565fc7f77f0cd58007181b4dc3572b2922522266d683dd8e3be10220717da620c69756d385e8e1998cea6c540075716ac6248318ac6d62b78f95dda5[ALL]",
        "hex": "483045022100b1fc3878a851565fc7f77f0cd58007181b4dc3572b2922522266d683dd8e3be10220717da620c69756d385e8e1998cea6c540075716ac6248318ac6d62b78f95dda501"
      },
      "sequence": 4294967295
    },

It fails at this check: https://github.com/KomodoPlatform/komodo/blob/e7e81457214f0f4ce7a7b8dcc9877fc17ce282f5/src/script/interpreter.cpp#L1522

@tonymorony if possible, could you tell us which commit your node was on at 11:33 UTC June 18 (yesterday)

tonymorony commented 4 years ago

@Alrighttt

cat zeno.log | grep master@ -a1
    0.2.2.1
zeno 0.2.2.1 master@76fe06bb Jun 16 (commit 181) (dirty)
[17:50:48][Info] Loading bitcoin config: /root/.komodo/TXSCLZ3/TXSCLZ3.conf
--
    bump version
zeno 0.2.2.2 master@1560f2c9 Jun 16 (commit 186) (dirty)
[22:42:27][Info] Loading bitcoin config: /root/.komodo/TXSCLZ3/TXSCLZ3.conf
--
    remove stray printf
zeno 0.2.3.0 master@db0f30ed Jun 17 (commit 188) (dirty)
[05:37:32][Info] Loading bitcoin config: /root/.komodo/TXSCLZ3/TXSCLZ3.conf
--
    fix bug in proposer round robin config
zeno 0.2.3.0 master@c97e6a44 Jun 17 (commit 189) (dirty)
[12:00:31][Info] Loading bitcoin config: /root/.komodo/TXSCLZ3/TXSCLZ3.conf

I think I was on zeno 0.2.3.0 master@c97e6a44

ssadler commented 4 years ago

@Alrighttt and I have been looking into it, and we verified that there is a bad signature and it's not a problem of the sighash being generated wrongly.

I have pushed a change in 0.2.3.1 which updates the upstream secp256k1 wrapper, since it previously had a bug which could result in wrong signatures being generated, so we'll see if that fixes it.