Skip to content

Mismatching block hash and transaction receipt data #291

@txhsl

Description

@txhsl

System information

Geth version: v0.2.1
OS & Version: Windows/Linux/OSX

Expected behaviour

The blockHash field of a transaction receipt should be the hash of the block that contains this transaction.

When we fetch the receipt of transaction 0xdad9de0271d263e061c031a4bf5ac58355e16149e035bbfa5bb8e97a6f9449a1 from mainnet through RPC method eth_getTransactionReceipt, we will get the following response.

{
    "blockHash": "0xfea21c66977db7b4fb33283e0e442c67321cd690f33da5f880fe02e16df6788e",
    "blockNumber": "0x11045",
    "contractAddress": "0x9ddb3368751af25e7af9a8c3ed92ea5dd5cfbe4a",
    "cumulativeGasUsed": "0xf023d",
    "effectiveGasPrice": "0x9502f9000",
    "from": "0xb5b184b4a5304be50e45f9489df9bce1cfc40f90",
    "gasUsed": "0xf023d",
    "logs": [],
    "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
    "status": "0x1",
    "to": null,
    "transactionHash": "0xdad9de0271d263e061c031a4bf5ac58355e16149e035bbfa5bb8e97a6f9449a1",
    "transactionIndex": "0x0",
    "type": "0x2"
}

Actual behaviour

However, the block 0xfea21c66977db7b4fb33283e0e442c67321cd690f33da5f880fe02e16df6788e was reorged at the height of 69701, and the final hash of that block is 0x1bb7685c5d85c818458858ad690c07b41a73a58bfa7e81e9182c64955ec05bf5.

Because when we fetch the hash of block 0x11045 from mainnet through eth_getBlockByNumber, we will get the following response.

{
    "baseFeePerGas": "0x4a817c800",
    "difficulty": "0x2",
    "extraData": "0x0034a3b2abb99b4c128acf61dcbbd1fcac0b1616524fe8af0dbb633283d8e9703668142fd130f2818d641ec1c538fa17e6ad8193c9b580f6850b114280763452f65353fffe73d46539e51a6ddfc0e2c86aa61ac4a4f006f4fceeb72ee0012a2d3367168d10e3973f57e8a0aa312c1917ab0e6a05d8b6af6609e6d1a9db6a0893926bd81c0ef93aaaa543c116f09bd475aca0317e8181a43c4f9e430708cebc4a93e633aa6c599e82061538e979658444efbe96abadff286914f47721a367c48bbcefc295d5d113e26e523d8c4900629a4336162ada25fc36fbd0f796e2377ccc1a7692d15a4b1511b2d365748df7538275f0bf0a61b44717745fa2c8babb9b696dad0cb92fcd5b99c20b9dc3a39f0063995c814cbdf9615a38a6f9d4de210c16bfff7629df4b15ed468e0d918e039362d2a8e036ab150ecf1a9268b89e2f6b848e4da2bfa551d85f18fdee1213a23300bbbe6e3972099089dbab41269303d98779a327c509fdc9c4fc95ebbe67c5d882421d5f17b6865daf34ad346f62e97d117f32639eae98071f2f0b5a9bc2b8581f0059ca291535dbc673f13a222d3814f41735eca5ff3309958b1f4ecae3402e5c8c17ea6bb155b00c69174d96e9d2ce689aaeded4d3341143d13877d1158803a29101",
    "gasLimit": "0x1c9c380",
    "gasUsed": "0xf023d",
    "hash": "0x1bb7685c5d85c818458858ad690c07b41a73a58bfa7e81e9182c64955ec05bf5",
    "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
    "miner": "0x1212000000000000000000000000000000000003",
    "mixHash": "0xeb59c093e3a02bfa4e0d4677d4769022cd9399bbc8b93ad1e892acd6a08aa533",
    "nonce": "0x0000000000000002",
    "number": "0x11045",
    "parentHash": "0x11f6a478dba0d59c85736264929c35dfd34cb5bd00976fff239971dffe161a76",
    "receiptsRoot": "0x89058005597e2b4b5e888c3efb707090f0944e1d66b4f8ab941b934075a3f178",
    "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
    "size": "0x11b1",
    "stateRoot": "0x067d20bb2eef5818da7b4c75043630d3bbded3943e3100a88f931addd2f8df74",
    "timestamp": "0x66ae1404",
    "totalDifficulty": "0x21f53",
    "transactions": [
        "0xdad9de0271d263e061c031a4bf5ac58355e16149e035bbfa5bb8e97a6f9449a1"
    ],
    "transactionsRoot": "0xb353d8b4b112bd85f08597be61a9534ce6928bf40f842a7b6b6f1f3ca6ad358d",
    "uncles": [],
    "withdrawals": [],
    "withdrawalsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421"
}

Steps to reproduce the behaviour

Send above RPC requests to any of our running nodes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions