INCIDENT: Peercoin/Peerunity 32-bit clients fork

Windows and 32-bit linux clients have forked from main peercoin blockchain as of block height 234613. This is a separate incident from the peerunity fork (https://www.peercointalk.org/index.php?topic=4541.0) last week. This incident is also related to the blockchain incident of November 2015 (https://www.peercointalk.org/index.php?topic=4312.0).

Symptom:
Displays error invalid checkpoint found, client unable to sync/reorganize to the main blockchain

Impact:
Peercoin v0.5.3, peerunity v0.2.1, limited to windows clients and linux 32-bit clients, possibly other 32-bit clients.

Severity:
Moderate. Not affecting wallets or main blockchain. Impacted users are recommended to suspend transaction activity until fix is available.

Resolution:
Fixed as of peercoin v0.5.4 and peerunity v0.2.2

Kudos to sigmike whose fix is currently under validation. stay tuned

That’s good to hear. I will post about the fix on Peercoin’s social media once it is confirmed that it solves the problem.

Yes, great team effort! We sure are getting good on this forking stuff ;D

I’ve updated ppcoin repo but my test still fails VerifySignature, how can that be?

./test_ppcoin --log_level=test_suite
Running 56 test cases…
Entering test module “Bitcoin Test Suite”
test/Checkpoints_tests.cpp:13: Entering test suite “Checkpoints_tests”
test/Checkpoints_tests.cpp:15: Entering test case “sanity”
test/Checkpoints_tests.cpp:15: Leaving test case “sanity”; testing time: 87us
test/Checkpoints_tests.cpp:13: Leaving test suite “Checkpoints_tests”; testing time: 124us
test/DoS_tests.cpp:31: Entering test suite “DoS_tests”
test/DoS_tests.cpp:33: Entering test case “DoS_banning”
test/DoS_tests.cpp:33: Leaving test case “DoS_banning”; testing time: 129us
test/DoS_tests.cpp:51: Entering test case “DoS_banscore”
test/DoS_tests.cpp:51: Leaving test case “DoS_banscore”; testing time: 75us
test/DoS_tests.cpp:66: Entering test case “DoS_bantime”
test/DoS_tests.cpp:66: Leaving test case “DoS_bantime”; testing time: 38us
test/DoS_tests.cpp:98: Entering test case “DoS_checknbits”
test/DoS_tests.cpp:98: Leaving test case “DoS_checknbits”; testing time: 1547us
test/DoS_tests.cpp:147: Entering test case “DoS_mapOrphans”
test/DoS_tests.cpp:147: Leaving test case “DoS_mapOrphans”; testing time: 408573us
test/DoS_tests.cpp:226: Entering test case “DoS_checkSig”
test/DoS_tests.cpp:226: Leaving test case “DoS_checkSig”; testing time: 930082us
test/DoS_tests.cpp:31: Leaving test suite “DoS_tests”; testing time: 1340701us
test/base58_tests.cpp:5: Entering test suite “base58_tests”
test/base58_tests.cpp:66: Entering test case “base58_EncodeBase58”
test/base58_tests.cpp:66: Leaving test case “base58_EncodeBase58”; testing time: 198us
test/base58_tests.cpp:74: Entering test case “base58_DecodeBase58”
test/base58_tests.cpp:74: Leaving test case “base58_DecodeBase58”; testing time: 131us
test/base58_tests.cpp:5: Leaving test suite “base58_tests”; testing time: 402us
test/base64_tests.cpp:7: Entering test suite “base64_tests”
test/base64_tests.cpp:9: Entering test case “base64_testvectors”
test/base64_tests.cpp:9: Leaving test case “base64_testvectors”; testing time: 63us
test/base64_tests.cpp:7: Leaving test suite “base64_tests”; testing time: 97us
test/getarg_tests.cpp:7: Entering test suite “getarg_tests”
test/getarg_tests.cpp:26: Entering test case “boolarg”
test/getarg_tests.cpp:26: Leaving test case “boolarg”; testing time: 363us
test/getarg_tests.cpp:90: Entering test case “stringarg”
test/getarg_tests.cpp:90: Leaving test case “stringarg”; testing time: 126us
test/getarg_tests.cpp:114: Entering test case “intarg”
test/getarg_tests.cpp:114: Leaving test case “intarg”; testing time: 118us
test/getarg_tests.cpp:133: Entering test case “doubledash”
test/getarg_tests.cpp:133: Leaving test case “doubledash”; testing time: 72us
test/getarg_tests.cpp:143: Entering test case “boolargno”
test/getarg_tests.cpp:143: Leaving test case “boolargno”; testing time: 147us
test/getarg_tests.cpp:7: Leaving test suite “getarg_tests”; testing time: 988us
test/key_tests.cpp:54: Entering test suite “key_tests”
test/key_tests.cpp:56: Entering test case “key_test1”
test/key_tests.cpp:56: Leaving test case “key_test1”; testing time: 646384us
test/key_tests.cpp:54: Leaving test suite “key_tests”; testing time: 646444us
test/miner_tests.cpp:8: Entering test suite “miner_tests”
test/miner_tests.cpp:10: Entering test case “sha256transform_equality”
2df5e1c65ef9f8cde240d23cae2ec036d31a15ec64bc68f64be242b1da6631f3
test/miner_tests.cpp:10: Leaving test case “sha256transform_equality”; testing time: 88us
test/miner_tests.cpp:8: Leaving test suite “miner_tests”; testing time: 122us
test/mruset_tests.cpp:29: Entering test suite “mruset_tests”
test/mruset_tests.cpp:32: Entering test case “mruset_like_set”
test/mruset_tests.cpp:32: Leaving test case “mruset_like_set”; testing time: 18364us
test/mruset_tests.cpp:45: Entering test case “mruset_limited_size”
test/mruset_tests.cpp:45: Leaving test case “mruset_limited_size”; testing time: 18326us
test/mruset_tests.cpp:75: Entering test case “mruset_window”
test/mruset_tests.cpp:75: Leaving test case “mruset_window”; testing time: 106105us
test/mruset_tests.cpp:29: Leaving test suite “mruset_tests”; testing time: 143052us
test/multisig_tests.cpp:26: Entering test suite “multisig_tests”
test/multisig_tests.cpp:45: Entering test case “multisig_verify”
test/multisig_tests.cpp:45: Leaving test case “multisig_verify”; testing time: 120480us
test/multisig_tests.cpp:130: Entering test case “multisig_IsStandard”
test/multisig_tests.cpp:130: Leaving test case “multisig_IsStandard”; testing time: 4903us
test/multisig_tests.cpp:166: Entering test case “multisig_Solver1”
test/multisig_tests.cpp:166: Leaving test case “multisig_Solver1”; testing time: 4321us
test/multisig_tests.cpp:255: Entering test case “multisig_Sign”
test/multisig_tests.cpp:255: Leaving test case “multisig_Sign”; testing time: 22749us
test/multisig_tests.cpp:26: Leaving test suite “multisig_tests”; testing time: 152796us
test/rpc_tests.cpp:11: Entering test suite “rpc_tests”
test/rpc_tests.cpp:32: Entering test case “rpc_addmultisig”
test/rpc_tests.cpp:32: Leaving test case “rpc_addmultisig”; testing time: 1628us
test/rpc_tests.cpp:11: Leaving test suite “rpc_tests”; testing time: 1689us
test/script_P2SH_tests.cpp:47: Entering test suite “script_P2SH_tests”
test/script_P2SH_tests.cpp:49: Entering test case “sign”
test/script_P2SH_tests.cpp:49: Leaving test case “sign”; testing time: 44704us
test/script_P2SH_tests.cpp:117: Entering test case “norecurse”
test/script_P2SH_tests.cpp:117: Leaving test case “norecurse”; testing time: 225us
test/script_P2SH_tests.cpp:143: Entering test case “set”
test/script_P2SH_tests.cpp:143: Leaving test case “set”; testing time: 31013us
test/script_P2SH_tests.cpp:195: Entering test case “is”
test/script_P2SH_tests.cpp:195: Leaving test case “is”; testing time: 64us
test/script_P2SH_tests.cpp:226: Entering test case “switchover”
test/script_P2SH_tests.cpp:226: Leaving test case “switchover”; testing time: 145us
test/script_P2SH_tests.cpp:244: Entering test case “AreInputsStandard”
test/script_P2SH_tests.cpp:244: Leaving test case “AreInputsStandard”; testing time: 18270us
test/script_P2SH_tests.cpp:47: Leaving test suite “script_P2SH_tests”; testing time: 94803us
test/script_tests.cpp:115: Entering test suite “script_tests”
test/script_tests.cpp:117: Entering test case “script_dubious”
test/script_tests.cpp:140: error: in “script_tests/script_dubious”: verifySignature should pass.
test/script_tests.cpp:117: Leaving test case “script_dubious”; testing time: 165us
test/script_tests.cpp:143: Entering test case “script_valid”
test/script_tests.cpp:143: Leaving test case “script_valid”; testing time: 15009us
test/script_tests.cpp:171: Entering test case “script_invalid”
test/script_tests.cpp:171: Leaving test case “script_invalid”; testing time: 4375us
test/script_tests.cpp:195: Entering test case “script_PushData”
test/script_tests.cpp:195: Leaving test case “script_PushData”; testing time: 86us
test/script_tests.cpp:252: Entering test case “script_CHECKMULTISIG12”
test/script_tests.cpp:252: Leaving test case “script_CHECKMULTISIG12”; testing time: 14716us
test/script_tests.cpp:285: Entering test case “script_CHECKMULTISIG23”
test/script_tests.cpp:285: Leaving test case “script_CHECKMULTISIG23”; testing time: 45768us
test/script_tests.cpp:115: Leaving test suite “script_tests”; testing time: 80527us
test/sigopcount_tests.cpp:18: Entering test suite “sigopcount_tests”
test/sigopcount_tests.cpp:20: Entering test case “GetSigOpCount”
test/sigopcount_tests.cpp:20: Leaving test case “GetSigOpCount”; testing time: 3002us
test/sigopcount_tests.cpp:18: Leaving test suite “sigopcount_tests”; testing time: 3090us
test/transaction_tests.cpp:8: Entering test suite “transaction_tests”
test/transaction_tests.cpp:10: Entering test case “basic_transaction_tests”
test/transaction_tests.cpp:10: Leaving test case “basic_transaction_tests”; testing time: 175us
test/transaction_tests.cpp:63: Entering test case “test_Get”
test/transaction_tests.cpp:63: Leaving test case “test_Get”; testing time: 4290us
test/transaction_tests.cpp:96: Entering test case “test_IsStandard”
test/transaction_tests.cpp:96: Leaving test case “test_IsStandard”; testing time: 5205us
test/transaction_tests.cpp:145: Entering test case “test_GetThrow”
test/transaction_tests.cpp:145: Leaving test case “test_GetThrow”; testing time: 4680us
test/transaction_tests.cpp:8: Leaving test suite “transaction_tests”; testing time: 14562us
test/uint160_tests.cpp:5: Entering test suite “uint160_tests”
test/uint160_tests.cpp:7: Entering test case “uint160_equality”
test/uint160_tests.cpp:7: Leaving test case “uint160_equality”; testing time: 46us
test/uint160_tests.cpp:5: Leaving test suite “uint160_tests”; testing time: 106us
test/uint256_tests.cpp:5: Entering test suite “uint256_tests”
test/uint256_tests.cpp:7: Entering test case “uint256_equality”
test/uint256_tests.cpp:7: Leaving test case “uint256_equality”; testing time: 37us
test/uint256_tests.cpp:5: Leaving test suite “uint256_tests”; testing time: 100us
test/util_tests.cpp:11: Entering test suite “util_tests”
test/util_tests.cpp:13: Entering test case “util_criticalsection”
Test case util_tests/util_criticalsection did not check any assertions
test/util_tests.cpp:13: Leaving test case “util_criticalsection”; testing time: 78us
test/util_tests.cpp:33: Entering test case “util_MedianFilter”
test/util_tests.cpp:33: Leaving test case “util_MedianFilter”; testing time: 71us
test/util_tests.cpp:65: Entering test case “util_ParseHex”
test/util_tests.cpp:65: Leaving test case “util_ParseHex”; testing time: 58us
test/util_tests.cpp:82: Entering test case “util_HexStr”
test/util_tests.cpp:82: Leaving test case “util_HexStr”; testing time: 66us
test/util_tests.cpp:104: Entering test case “util_DateTimeStrFormat”
test/util_tests.cpp:104: Leaving test case “util_DateTimeStrFormat”; testing time: 1135us
test/util_tests.cpp:113: Entering test case “util_ParseParameters”
test/util_tests.cpp:113: Leaving test case “util_ParseParameters”; testing time: 143us
test/util_tests.cpp:137: Entering test case “util_GetArg”
test/util_tests.cpp:137: Leaving test case “util_GetArg”; testing time: 81us
test/util_tests.cpp:161: Entering test case “util_WildcardMatch”
test/util_tests.cpp:161: Leaving test case “util_WildcardMatch”; testing time: 32us
test/util_tests.cpp:172: Entering test case “util_FormatMoney”
test/util_tests.cpp:172: Leaving test case “util_FormatMoney”; testing time: 119us
test/util_tests.cpp:201: Entering test case “util_ParseMoney”
test/util_tests.cpp:201: Leaving test case “util_ParseMoney”; testing time: 83us
test/util_tests.cpp:249: Entering test case “util_IsHex”
test/util_tests.cpp:249: Leaving test case “util_IsHex”; testing time: 53us
test/util_tests.cpp:11: Leaving test suite “util_tests”; testing time: 2535us
test/wallet_tests.cpp:14: Entering test suite “wallet_tests”
test/wallet_tests.cpp:47: Entering test case “coin_selection_tests”
test/wallet_tests.cpp:47: Leaving test case “coin_selection_tests”; testing time: 318559us
test/wallet_tests.cpp:14: Leaving test suite “wallet_tests”; testing time: 318627us
Leaving test module “Bitcoin Test Suite”; testing time: 2801646us

*** 1 failure is detected in the test module “Bitcoin Test Suite”

Hi backpacker,

I don’t have time now. But I’ll debug your test tomorrow to see where it exactly fails.
Or you can debug it, did you do that?

I proposed some additional fixes: https://github.com/ppcoin/ppcoin/pull/117

@backpacker69 your test fails when the hashes are compared before the signature is actually checked. In the new pull request I wrote some unit tests that directly use CKey::Verify instead.

[member=32708]backpacker69[/member] I just debugged the test quickly, no more time to investigate.
The test fails on this line in VerifySignature:

    if (txin.prevout.hash != txFrom.GetHash())
        return false;

Yesterday, I had this: “WARNING: Invalid checkpoint found! Displayed transactions may not be correct! You may need to upgrade, or notify developers of the issue”.

This was just after I downloaded a fresh version of the blockchain, so I am assuming this new fork issue is the cause.

I use Peerunity v0.2.1 on Windows 64-bit client. All my coins are present and correct.

Here is my feedback, im make transaction to wallet with old version 0.2.0 than my transaction is pending after i make new update 0.2.1 and my transcation and my ballance is stil pending… blocks loader 219999…

Is this OK ??

OS: Win 8.1 64

[member=29678]RobertLloyd[/member] and [member=32970]miga[/member] Since you are on Windows your not connected to the correct chain. You should uninstall your client and wait for the new one that will be released pretty soon.

Rejected block and transaction by 32-bit clients:

$ ppcoind getblockhash 234613
e8bd8a656a00966eb87398bc65c051c35959e646e2db4a74ea472a58acbed191
$ ppcoind getblock e8bd8a656a00966eb87398bc65c051c35959e646e2db4a74ea472a58acbed191 true true
{
    "hash" : "e8bd8a656a00966eb87398bc65c051c35959e646e2db4a74ea472a58acbed191",
    "size" : 648,
    "height" : 234613,
    "version" : 1,
    "merkleroot" : "110960b3cc81cc4500f89649a4edc39178d1267c27f548e3f0d6e0e9ef156491",
    "time" : "2016-05-02 04:10:33 UTC",
    "nonce" : 0,
    "bits" : "1c1a799e",
    "difficulty" : 9.66932746,
    "mint" : 0.37000000,
    "previousblockhash" : "ac866f8336f7689c3ec76b48add32f959812ccaf10fb379dfc8f85147eef149f",
    "nextblockhash" : "78f58553adc965430d7e8f4908433f12f9acae097fbd39cfd879058522cf9dc9",
    "flags" : "proof-of-stake",
    "proofhash" : "000000cf9e7c14b462bef0e336fb2370446ecdd36bc96c81036525fa9bf4e1c3",
    "entropybit" : 1,
    "modifier" : "3e61c60c2d72e14c",
    "modifierchecksum" : "9686762e",
    "tx" : [
        {
            "txid" : "993846673a1ee375f6fac581b540a20673e3a8a433a95a2b241365d8cfa2a290",
            ...
        }
        {
            "txid" : "1bae10c202f1dc4332d39cca768de0d7a86b7fda6ff94d8b2b57c047b063de5d",
            ...
        }
        {
            "txid" : "9c125157e9d246823885a93537ed42590cf19c8acb746ea4940999b7cf7b6bc7",
            "version" : 1,
            "locktime" : 0,
            "is_coinbase" : false,
            "is_coinstake" : false,
            "vin" : [
                {
                    "txid" : "fd38483a2029469fecdecfc08526b9e7d6635945d74adc92dc836aa7f6ea1291",
                    "vout" : 1,
                    "scriptSig" : {
                        "asm" : "304a0285000000002100d1c453ddcaae9215a24fc86d50916b66117839d163402d9ed21a1f4aba3173e302200ce3d43a4c4841a340c267c9fa1f3aa43c1e51c0d5043e91a85c954e14c6b91f01 03d4b1beb94313fc4395e38b4ba4ea74f62c5ecec2454c49cbf21d4262803b5469",
                        "hex" : "4c4d304a0285000000002100d1c453ddcaae9215a24fc86d50916b66117839d163402d9ed21a1f4aba3173e302200ce3d43a4c4841a340c267c9fa1f3aa43c1e51c0d5043e91a85c954e14c6b91f012103d4b1beb94313fc4395e38b4ba4ea74f62c5ecec2454c49cbf21d4262803b5469"
                    },
                    "sequence" : 4294967295
                }
            ],
            "vout" : [
                {
                    "value" : 0.11000000,
                    "n" : 0,
                    "scriptPubKey" : {
                        "asm" : "OP_DUP OP_HASH160 c9aa8544c830b866e519c1245465b395863ef444 OP_EQUALVERIFY OP_CHECKSIG",
                        "hex" : "76a914c9aa8544c830b866e519c1245465b395863ef44488ac",
                        "type" : "pubkeyhash",
                        "reqSig" : 1,
                        "addresses" : [
                            "PSyVFWTXLsgQKp65PmgmNqgwh4CBae71kv"
                        ]
                    }
                }
            ]
        }
    ]
}

A Raspberry Pi model B or 2 is not easy to be called 32bit or 64bit in the Intel sense. Since my R-Pi couldn’t sync to the full blockchain I assume it also suffered the 32bit client problem.

I compiled the #116 (fix2) version of ppcoind and my Pi (old B model) can fully sync with the rigt chain now.

For reference, the block and transaction rejected by 32-bit clients in the November 2015 incident:

$ ppcoind getblockhash 204614
8350ac92844dfe4d8308d06fc4ecf379a98b0657f8b6435546f620888174adcc
$ ppcoind getblock 8350ac92844dfe4d8308d06fc4ecf379a98b0657f8b6435546f620888174adcc true true
{
    "hash" : "8350ac92844dfe4d8308d06fc4ecf379a98b0657f8b6435546f620888174adcc",
    "size" : 922,
    "height" : 204614,
    "version" : 1,
    "merkleroot" : "5d8665eaeea014d99d639c2f6842994f4502471a8056c811ec733bdcf0855f4f",
    "time" : "2015-11-09 10:49:20 UTC",
    "nonce" : 0,
    "bits" : "1c1657a5",
    "difficulty" : 11.45787988,
    "mint" : 0.03000000,
    "previousblockhash" : "388c5c875d1ab37ff7b9329a12a415e43e38335316a5caa982fc3a373a32e93d",
    "nextblockhash" : "04d276ba269b73aa31859b3b46ed6e6fbc735e895d6419cc79a2a1e58d20ef33",
    "flags" : "proof-of-stake",
    "proofhash" : "00000008ca69172a084867346f164802113b9490394ade05f409f2f7ffb18836",
    "entropybit" : 0,
    "modifier" : "d6824d0de812a028",
    "modifierchecksum" : "a65d4abd",
    "tx" : [
        {
            "txid" : "c23883ac0c1eefbab3b4310b0caefc6cdbd97dbd1c8bd9a7ff207d524fc0b6e1",
            ...
        },
        {
            "txid" : "1ef732b6654c867ab3cc1cf8cbd94d4874df406cb9fe013ab70df30e053ee740",
            ...
        },
        {
            "txid" : "1559306a96c2bd6767b8a3d441ca8cf870cea2e15ceb6934e380e42382c053dd",
            ...
        },
        {
            "txid" : "2d00a7349e5d281406a9e78c3af5d14dd0b3df2dedbc61c08e02e909797c6ecf",
            "version" : 1,
            "locktime" : 0,
            "is_coinbase" : false,
            "is_coinstake" : false,
            "vin" : [
                {
                    "txid" : "e19bd9513a74180b63da11c0719c8009e261ae5591b20daa018f8cf9019c61b8",
                    "vout" : 1,
                    "scriptSig" : {
                        "asm" : "308500000000450221009802e19f86a3d348218a180599cd4488da687c250b850788b43427d277e4981002202a52418c497dd9ba9e5b97f1cb4de8b683e2ad9efe9f95f763022b23d2c5ee4e01 028a2d8bdcb6f0210fab72c19c63c513818ec19289e4002f9057555b5057dde7c5",
                        "hex" : "4c4d308500000000450221009802e19f86a3d348218a180599cd4488da687c250b850788b43427d277e4981002202a52418c497dd9ba9e5b97f1cb4de8b683e2ad9efe9f95f763022b23d2c5ee4e0121028a2d8bdcb6f0210fab72c19c63c513818ec19289e4002f9057555b5057dde7c5"
                    },
                    "sequence" : 4294967295
                }
            ],
            "vout" : [
                {
                    "value" : 0.05000000,
                    "n" : 0,
                    "scriptPubKey" : {
                        "asm" : "OP_DUP OP_HASH160 6f8dd023bbbe103c661c5c6ac8b43f46f795fba9 OP_EQUALVERIFY OP_CHECKSIG",
                        "hex" : "76a9146f8dd023bbbe103c661c5c6ac8b43f46f795fba988ac",
                        "type" : "pubkeyhash",
                        "reqSig" : 1,
                        "addresses" : [
                            "PJm23cJN2wmiF4GKfVZ87W2aueDpSfv3Nw"
                        ]
                    }
                }
            ]
        }
    ]
}

Im think this is gonna to win64bit version to, on my secondery pc which runs 64bit windows i make update for new wallet and same problem, after is clean folders and put my wallet file back look same problem

Is the new release ready?

few minutes ago i managed to build ppcoind.exe with fixes for windows, but no qt version.

https://rbfi.io/dl.php?key=/Sdph/ppcoind.zip
sha1 checksum 6eb16dde0ed2f30944e550f453bb297ecc577790

it has started to sync for me, but haven’t gotten to the dubious blocks yet.

this kind of software will not benefit at all from 64b versions. on the contrary, 64b clients need much more memory than the 32b ones!

ppcoin-qt.exe built

https://rbfi.io/dl.php?key=/Qlwa/ppcoin-qt.zip

sha256 7942747e8d301d4d0ad72e6e3eca7f96b265898ecbb28be16ea6027fc29f2436

New release of Peerunity with sigmike’s patches here: https://github.com/Peerunity/Peerunity/releases/tag/v0.2.2

I tested it on 64-bit Linux and 32-bit Windows and the clients successfully synchronized the blockchain.