Skip to content

Invalid height in coinbase bug #349

@MarkPfennig

Description

@MarkPfennig

As discussed with ahmed on bitcointalk, stratum-mining and the new Bitmark code base I've created aren't playing nicely.

Specifically, my codebase is bitcoin with scrypt support, and version 2 blocks requiring the height to be in the coinbase. As per https://github.com/bitcoin/bips/blob/master/bip-0034.mediawiki#specification

I've tested on multiple miners, cgminer, minerd, the internal miner, they all work correctly, only stratum-mining is faulting.

The below was the submission of found block with height 13

stratum-mining submitting a found block:

2014-07-02 03:44:08,792 DEBUG bitcoin_rpc bitcoin_rpc.submitblock # ['020000000d80bd8601a4e69b2428e668a4ea7c37059dd18f2ad0eb8fd3b6acdeb88d9c23418806c83f72111efab41bf10887e94195632a0d360d5a226f422cfc4175da03dd63b353f0ff0f1e2000974d0101000000010000000000000000000000000000000000000000000000000000000000000000ffffffff25010d062f503253482f04dd63b35308f8000001000000000d2f7374726174756d506f6f6c2f000000000100943577000000001976a914987dd9a879208fac5d9c1b0944bb27c7fb4e123d88ac00000000']

Block::print() output from bitmark debug log for above submitted block:

2014-07-02 01:44:08 CBlock(hash=f07c28f6eca5cec7f7700a6154b85474700984f4a93e82eaf9f2c49022b8383a, pow=000004b7d8f016751d5adf6978ae635ab7f995cc32b4222d1a1d2fe7b21d6ff3, ver=2, hashPrevBlock=239c8db8deacb6d38febd02a8fd19d05377ceaa468e628249be6a40186bd800d, hashMerkleRoot=03da7541fc2c426f225a0d360d2a639541e98708f11bb4fa1e11723fc8068841, nTime=1404265437, nBits=1e0ffff0, nNonce=1301741600, vtx=1)
2014-07-02 01:44:08   CTransaction(hash=03da7541fc, ver=1, vin.size=1, vout.size=1, nLockTime=0)
    CTxIn(COutPoint(0000000000, 4294967295), coinbase 010d062f503253482f04dd63b35308f8000001000000000d2f7374726174756d506f6f6c2f, nSequence=0)
    CTxOut(nValue=20.00000000, scriptPubKey=OP_DUP OP_HASH160 987dd9a87920)
2014-07-02 01:44:08   vMerkleTree: 03da7541fc2c426f225a0d360d2a639541e98708f11bb4fa1e11723fc8068841
2014-07-02 01:44:08 ERROR: AcceptBlock() : block height mismatch in coinbase
2014-07-02 01:44:08 ERROR: ProcessBlock() : AcceptBlock FAILED

Apologies as I haven't dissected it to find the exact error. I have checked that getblocktemplate is returning the right value:

{
    "version" : 2,
    "previousblockhash" : "239c8db8deacb6d38febd02a8fd19d05377ceaa468e628249be6a40186bd800d",
    "transactions" : [
    ],
    "coinbaseaux" : {
        "flags" : "062f503253482f"
    },
    "coinbasevalue" : 2000000000,
    "target" : "00000ffff0000000000000000000000000000000000000000000000000000000",
    "mintime" : 1404228423,
    "mutable" : [
        "time",
        "transactions",
        "prevblock"
    ],
    "noncerange" : "00000000ffffffff",
    "sigoplimit" : 20000,
    "sizelimit" : 1000000,
    "curtime" : 1404265970,
    "bits" : "1e0ffff0",
    "height" : 13
}

To be explicit, the error is being thrown within Bitmark on line 2408, code here: https://github.com/coinsolidation/bitmark/blob/master/src/main.cpp#L2408

I'll monitor the thread to see if I can be of any further assistance.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions