Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Empty fields on eth_getTransactionReceipt with light clients #10697

Closed
jleeh opened this issue May 28, 2019 · 9 comments
Closed

Empty fields on eth_getTransactionReceipt with light clients #10697

jleeh opened this issue May 28, 2019 · 9 comments
Labels
A3-stale 🍃 Pull request did not receive any updates in a long time. No review needed at this stage. Close it. F2-bug 🐞 The client fails to follow expected behavior. M4-core ⛓ Core client code / Rust. P5-sometimesoon 🌲 Issue is worth doing soon.

Comments

@jleeh
Copy link

jleeh commented May 28, 2019

  • Parity Ethereum version: v2.4.6
  • Operating system: Linux
  • Installation: docker
  • Fully synchronized: yes (light client)
  • Network: ropsten
  • Restarted: yes

Upon calling eth_getTransactionReceipt on a confirmed transaction, many of the fields aren't set in the response such as: logs.logIndex, logs.transactionIndex, logs.blockHash.

Parity light: request & response

{"method":"eth_getTransactionReceipt","params":["0xfa211225345a571d2cd8a61734f1006045cb286b10f72191adb6db5a0e225edd"],"id":1,"jsonrpc":"2.0"}
{
    "jsonrpc": "2.0",
    "result": {
        "blockHash": "0xa0fe830df662b98597c28359b9dab1388600e8661f1fa4627c5722d15106fce4",
        "blockNumber": "0x56c9ef",
        "contractAddress": null,
        "cumulativeGasUsed": "0x68fc",
        "from": null,
        "gasUsed": null,
        "logs": [
            {
                "address": "0xec8ea88b10717ad268e30bbbf3f3659c44d49256",
                "blockHash": null,
                "blockNumber": null,
                "data": "0x",
                "logIndex": null,
                "removed": false,
                "topics": [
                    "0x7cc135e0cebb02c3480ae5d74d377283180a2601f8f644edf7987b009316c63a",
                    "0xeb406ee3d1d716b939a47f0d0a6778d917640335acabfaa634dcfb6715955fa8"
                ],
                "transactionHash": null,
                "transactionIndex": null,
                "transactionLogIndex": null,
                "type": "pending"
            },
            {
                "address": "0xec8ea88b10717ad268e30bbbf3f3659c44d49256",
                "blockHash": null,
                "blockNumber": null,
                "data": "0x",
                "logIndex": null,
                "removed": false,
                "topics": [
                    "0x794eb9e29f6750ede99e05248d997a9ab9fa23c4a7eaff8afa729080eb7c6428",
                    "0xeb406ee3d1d716b939a47f0d0a6778d917640335acabfaa634dcfb6715955fa8",
                    "0x00000000000000000000000000000000000000000000000000000000000068fc"
                ],
                "transactionHash": null,
                "transactionIndex": null,
                "transactionLogIndex": null,
                "type": "pending"
            }
        ],
        "logsBloom": "0x00000000000000000000000000000000000000000000400000000000000000000000100000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000800000000000000000000000000100000000000000000000000800000000000000000000100000000000000040000000000000000000000000000000000000000000000000000000000000000000000000002008800000000000000000000000000008000000000000000000000000000000002000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
        "root": null,
        "status": "0x1",
        "to": null,
        "transactionHash": "0xfa211225345a571d2cd8a61734f1006045cb286b10f72191adb6db5a0e225edd",
        "transactionIndex": "0x0"
    },
    "id": 1
}

Geth light: request & response

{"method":"eth_getTransactionReceipt","params":["0xfa211225345a571d2cd8a61734f1006045cb286b10f72191adb6db5a0e225edd"],"id":1,"jsonrpc":"2.0"}
{
    "jsonrpc": "2.0",
    "id": 1,
    "result": {
        "blockHash": "0xa0fe830df662b98597c28359b9dab1388600e8661f1fa4627c5722d15106fce4",
        "blockNumber": "0x56c9ef",
        "contractAddress": null,
        "cumulativeGasUsed": "0x68fc",
        "from": "0x247b4b6d0bf906abcfd938562ac81798eda9c653",
        "gasUsed": "0x68fc",
        "logs": [
            {
                "address": "0xec8ea88b10717ad268e30bbbf3f3659c44d49256",
                "topics": [
                    "0x7cc135e0cebb02c3480ae5d74d377283180a2601f8f644edf7987b009316c63a",
                    "0xeb406ee3d1d716b939a47f0d0a6778d917640335acabfaa634dcfb6715955fa8"
                ],
                "data": "0x",
                "blockNumber": "0x56c9ef",
                "transactionHash": "0xfa211225345a571d2cd8a61734f1006045cb286b10f72191adb6db5a0e225edd",
                "transactionIndex": "0x0",
                "blockHash": "0xa0fe830df662b98597c28359b9dab1388600e8661f1fa4627c5722d15106fce4",
                "logIndex": "0x0",
                "removed": false
            },
            {
                "address": "0xec8ea88b10717ad268e30bbbf3f3659c44d49256",
                "topics": [
                    "0x794eb9e29f6750ede99e05248d997a9ab9fa23c4a7eaff8afa729080eb7c6428",
                    "0xeb406ee3d1d716b939a47f0d0a6778d917640335acabfaa634dcfb6715955fa8",
                    "0x00000000000000000000000000000000000000000000000000000000000068fc"
                ],
                "data": "0x",
                "blockNumber": "0x56c9ef",
                "transactionHash": "0xfa211225345a571d2cd8a61734f1006045cb286b10f72191adb6db5a0e225edd",
                "transactionIndex": "0x0",
                "blockHash": "0xa0fe830df662b98597c28359b9dab1388600e8661f1fa4627c5722d15106fce4",
                "logIndex": "0x1",
                "removed": false
            }
        ],
        "logsBloom": "0x00000000000000000000000000000000000000000000400000000000000000000000100000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000800000000000000000000000000100000000000000000000000800000000000000000000100000000000000040000000000000000000000000000000000000000000000000000000000000000000000000002008800000000000000000000000000008000000000000000000000000000000002000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
        "status": "0x1",
        "to": "0xf4737f9f3ab0f16acdcf6a77d31edf754bf1b058",
        "transactionHash": "0xfa211225345a571d2cd8a61734f1006045cb286b10f72191adb6db5a0e225edd",
        "transactionIndex": "0x0"
    }
}

Severity
This issue will cause problems for any application that hangs off light clients when sending transactions and then fetching the receipt. I'd say this is a pretty severe bug in the light implementation.

@jam10o-new
Copy link
Contributor

"type":"pending"

I feel like this is a consequence of the difference in behavior between geth and parity regarding pending transactionReceipts - we have the same differences in non-light requests - geth returns a null receipt, parity returns what its aware of in the transaction with the undefined values (as the transaction hasn't been mined yet) being null.

@jam10o-new jam10o-new added Z1-question 🙋‍♀️ Issue is a question. Closer should answer. Z5-intended 🎯 Issue describes a behavior which turns out to work as intended. Closer should explain why. labels May 28, 2019
@jam10o-new jam10o-new added this to the 2.6 milestone May 28, 2019
@jleeh
Copy link
Author

jleeh commented May 28, 2019

@joshua-mir The transaction isn't pending, it's had 75 confirmations as I write this. I can also replicate this with transactions that were confirmed over 14 hours ago.

@jam10o-new
Copy link
Contributor

I'd say the issue is that nodes are responding with outdated responses in that case - which would certainly be a valid issue.

@jam10o-new jam10o-new added F2-bug 🐞 The client fails to follow expected behavior. M4-core ⛓ Core client code / Rust. and removed Z1-question 🙋‍♀️ Issue is a question. Closer should answer. Z5-intended 🎯 Issue describes a behavior which turns out to work as intended. Closer should explain why. labels May 28, 2019
@jam10o-new jam10o-new changed the title A lot of empty fields on eth_getTransactionReceipt with light clients Outdated responses on eth_getTransactionReceipt with light clients May 28, 2019
@jleeh
Copy link
Author

jleeh commented May 28, 2019

The light clients seeing this issue have reserved peers that are my own full nodes that are constantly healthchecked to make sure they're at the latest height. I doubt it's outdated responses, since the reserved peers are the prioritised peers.

@jleeh
Copy link
Author

jleeh commented May 28, 2019

I've tested this with a transaction that confirmed 3 days ago and see the same issue, tx hash 0xc1edfed50bfb343335162a8832ae8a81c5c961b30df2ed86e0f51761a605971e. Response:

{
    "jsonrpc": "2.0",
    "result": {
        "blockHash": "0x7304f0d566f4371bd0eaf63e9b4964b36184d2e51d178ed959cacdf92d1b8533",
        "blockNumber": "0x568f98",
        "contractAddress": null,
        "cumulativeGasUsed": "0x11607c",
        "from": null,
        "gasUsed": null,
        "logs": [
            {
                "address": "0x2e9a512fc6fea120e567ed5faef1440e4f66b5ff",
                "blockHash": null,
                "blockNumber": null,
                "data": "0x00000000000000000000000000000000000000000000000000000000000003e2",
                "logIndex": null,
                "removed": false,
                "topics": [
                    "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",
                    "0x0000000000000000000000000000000000000000000000000000000000000000",
                    "0x0000000000000000000000003223aeb8404c7525fcaa6c512f91e287ae9ffe7b"
                ],
                "transactionHash": null,
                "transactionIndex": null,
                "transactionLogIndex": null,
                "type": "pending"
            },
            {
                "address": "0x2e9a512fc6fea120e567ed5faef1440e4f66b5ff",
                "blockHash": null,
                "blockNumber": null,
                "data": "0x",
                "logIndex": null,
                "removed": false,
                "topics": [
                    "0xb74863f5872044b0b75607f25b78a7991d1183f0453ab5166bda9ddc99e38a1b",
                    "0xe99572abd6bcfc500bafe3770e091ddd740b5bcd0436cf41bde2de8b4b2bf42b",
                    "0x00000000000000000000000000000000000000000000000000000000000003e2"
                ],
                "transactionHash": null,
                "transactionIndex": null,
                "transactionLogIndex": null,
                "type": "pending"
            },
            {
                "address": "0x2e9a512fc6fea120e567ed5faef1440e4f66b5ff",
                "blockHash": null,
                "blockNumber": null,
                "data": "0x",
                "logIndex": null,
                "removed": false,
                "topics": [
                    "0x96234cb3d6c373a1aaa06497a540bc166d4b0359243a088eaf95e21d7253d0be",
                    "0x0000000000000000000000003223aeb8404c7525fcaa6c512f91e287ae9ffe7b",
                    "0x00000000000000000000000000000000000000000000000000000000000003e2",
                    "0x0000000000000000000000000000000000000000000000000000000000000003"
                ],
                "transactionHash": null,
                "transactionIndex": null,
                "transactionLogIndex": null,
                "type": "pending"
            }
        ],
        "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000400000020000000000200000000000800000000000000020000000000000000100000000000000400200000000008000200000000000000000000000000000000000000000000020000000000000000000800000000000000000000000010000000000000000000000000000000000004200000000000000000000000000000000100000000000000000000000000000000000000000000800000000000000000404000000002000080000000040000000028000000000000000000000000000020000000000000000000000000000000000000000000000000080000000000000000",
        "root": null,
        "status": "0x1",
        "to": null,
        "transactionHash": "0xc1edfed50bfb343335162a8832ae8a81c5c961b30df2ed86e0f51761a605971e",
        "transactionIndex": "0x4"
    },
    "id": 1
}

I can go to Ropsten Etherscan and grab any TX ID and the same is shown for them all.

@jam10o-new
Copy link
Contributor

@jleeh sorry, I misread your original response

@jleeh
Copy link
Author

jleeh commented May 28, 2019

No worries @joshua-mir. I appreciate the very quick responses!

@jam10o-new jam10o-new changed the title Outdated responses on eth_getTransactionReceipt with light clients Empty fields on eth_getTransactionReceipt with light clients May 28, 2019
@jam10o-new
Copy link
Contributor

Possibly related to #10444 and #10265

@niklasad1
Copy link
Collaborator

I think the issue is that the light client queries for a Receipt which doesn't have all this information. I guess it's some kind of optimization.

I think we should query for RichReceipt but not even this type seems to have all fields though for example from and to seems to be missing.

Maybe related to #11109

@niklasad1 niklasad1 self-assigned this Oct 2, 2019
@niklasad1 niklasad1 removed their assignment Mar 3, 2020
@adria0 adria0 added the A3-stale 🍃 Pull request did not receive any updates in a long time. No review needed at this stage. Close it. label Jul 27, 2020
@adria0 adria0 closed this as completed Jul 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A3-stale 🍃 Pull request did not receive any updates in a long time. No review needed at this stage. Close it. F2-bug 🐞 The client fails to follow expected behavior. M4-core ⛓ Core client code / Rust. P5-sometimesoon 🌲 Issue is worth doing soon.
Projects
None yet
Development

No branches or pull requests

6 participants