Thanks to visit codestin.com
Credit goes to github.com

Skip to content

ERROR: ProcessNewBlock: AcceptBlock FAILED (bad-txnmrklroot, hashMerkleRoot mismatch) #6

@ReverseControl

Description

@ReverseControl

This issue was observed three days ago: it appears to be the case that the merkle tree root hash computed in the python script when there are more transactions than just the coinbase is not validated by the node. I've looked at mining code for bitcoin and the FACTOR.py script computes the merkle tree root hash in just the same way. Maybe Bitcoin TapRoot, tag v22.0, changed something about how the merkle tree root hashes are computed?

Here are some of the merkle tree root hashes computed after successfully submitting a block that only has the coinbase transaction.

2022-06-22T02:35:58Z UpdateTip: new best=721ba5214561024e93af5dc67019f50415244edec2f21230ba9a23d486e25991 height=20714 version=0x20000000 nBits=260 wOffset=9 log2_work=55.675297 nonce=3069314557446586543 tx=20715 date='2022-06-22T01:44:00Z' progress=0.999368 cache=0.0MiB(38txo)
2022-06-22T02:35:58Z CreateNewBlock(): block weight: 11677 txs: 1 fees: 25800 sigops 437
GetHash[0]: 8f38f43df1532cd9874eeafa61b1485aae65b13686450655f23c522004fce62e
GetHash[1]: fc2b752ef5b0d8caa388d3d0d08c87b748fe80df27482d5de3d581783fbc3b24
MerkleRoot: 80189b3b4f080a5d8116d475ec3e4a98fd4fe84de64cfbdbc439701ace74396c
GetHash[0]: 5b60947dc6e00916518b93a66c3788a4352c1cb5e1d3c51bdecee9363c6ac9b9
MerkleRoot: 5b60947dc6e00916518b93a66c3788a4352c1cb5e1d3c51bdecee9363c6ac9b9
2022-06-22T02:55:42Z UpdateTip: new best=38a0e83727077fe61cb8103a4138ed554465b29be931a1150fafb779618b49f4 height=20715 version=0x20000000 nBits=260 wOffset=3964 log2_work=55.675448 nonce=12698259158398758397 tx=20716 date='2022-06-22T02:36:26Z' progress=0.999766 cache=0.0MiB(39txo)
2022-06-22T02:55:42Z CreateNewBlock(): block weight: 11677 txs: 1 fees: 25800 sigops 437
GetHash[0]: 6dcecc3ab69259145075dfa179336e41ffeb05efabcc1f196d8afe6054c8a564
GetHash[1]: fc2b752ef5b0d8caa388d3d0d08c87b748fe80df27482d5de3d581783fbc3b24
MerkleRoot: 7385091c89398ffb0d1d9f0720077842a5c622f3e752db6732f89670daa9b884
GetHash[0]: ae0c07a5203dd969164759daca7cd64df661244d21a70f6d23217a5f6780b870
MerkleRoot: ae0c07a5203dd969164759daca7cd64df661244d21a70f6d23217a5f6780b870

It is unclear why the first merkle tree root hash is computed at all, since the coinbase's hash would be the merkle tree hash as it is the only transaction.

Help in diagnosing the real problem and fix for it would be greatly appreciated. @daedalus

In the meantime, miners can mine blocks that include only the coinbase until a fix is found. To do that:

  1. Rename the ~/.factorn/mempool.dat file to save the transactions in the mempool and restore them later.
  2. Start the factorn daemon as follows ./factorn -blocksonly.

Now when you mine, only the coinbase transaction will be made for a block. Until a fix is found for the merkle tree calculation. The function that computes the merkle tree is here: https://github.com/FACT0RN/factoring/blob/main/FACTOR.py#L309

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions