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

Transaction receipt is missing information. #11109

Closed
MicahZoltu opened this issue Oct 1, 2019 · 4 comments · Fixed by #11179
Closed

Transaction receipt is missing information. #11109

MicahZoltu opened this issue Oct 1, 2019 · 4 comments · Fixed by #11179
Labels
F2-bug 🐞 The client fails to follow expected behavior. M4-core ⛓ Core client code / Rust. M6-rpcapi 📣 RPC API.
Milestone

Comments

@MicahZoltu
Copy link
Contributor

  • Parity Ethereum version: 2.5.9
  • Operating system: Windows
  • Installation: Docker
  • Fully synchronized: yes
  • Network: ethereum
  • Restarted: yes

Your issue description goes here below. Try to include actual vs. expected behavior and steps to reproduce the issue.

When fetching a transaction receipt immediately after getting the transaction hash in response to a eth_sendRawTransaction call, the receipt has null for a lot of values that should never be null.

An example receipt response for a simple 0 value transfer:

{
    "jsonrpc": "2.0",
    "result": {
        "blockHash": null,
        "blockNumber": null,
        "contractAddress": null,
        "cumulativeGasUsed": "0x5208",
        "from": null,
        "gasUsed": "0x5208",
        "logs": [],
        "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
        "root": null,
        "status": "0x1",
        "to": null,
        "transactionHash": "0x2083491971605336023db17f2446d2af1561d4a6f788b4f2a1742b0ce70694f7",
        "transactionIndex": "0x0"
    },
    "id": null
}

While blockHash and blockNumber are expected to be null, from and to should not be null. The root being null is also bizarre, I would expect it to return the pending block root root, though I can appreciate why that is null.

The problem persists with a non-0 value transfer as well.

@MicahZoltu MicahZoltu changed the title Transaction receipt is missing a bunch of information. Transaction receipt is missing information. Oct 1, 2019
@jam10o-new jam10o-new added F2-bug 🐞 The client fails to follow expected behavior. M4-core ⛓ Core client code / Rust. M6-rpcapi 📣 RPC API. labels Oct 1, 2019
@jam10o-new jam10o-new added this to the 2.7 milestone Oct 1, 2019
@jam10o-new
Copy link
Contributor

jam10o-new commented Oct 1, 2019

2.5.7 and 2.5.9 both have the problem.

IIUC it's still unknown what version this behavior was introduced in.

@niklasad1
Copy link
Collaborator

niklasad1 commented Oct 16, 2019

@MicahZoltu are you using eth_getTransactionReceipt to fetch the receipt?

AFAIK, in eth_getTransactionReceipt we call either:

  1. pending_receipt which returns RichReceipt (it is missing blockHash, blockNumber, to, from)
  2. transaction_receipt which returns LocalizedReceipt (it has all the fields)

Could it be the case that your response is from a pending receipt?

You could enforce to always use transaction_receipt if you enable geth compabiltity by the flag --geth

Meanwhile, I will try to reproduce this.

/cc @tomusdrw any pointers regarding this?

@MicahZoltu
Copy link
Contributor Author

@niklasad1 After submitting a raw transaction, I would get a transaction hash in the response. I would immediately call eth_getTransactionReceipt which returned an incomplete transaction receipt.

@tomusdrw
Copy link
Collaborator

Pending receipts create RichReceipt struct directly, and it seems that some fields that are copied from transaction itself (like from, to) are not correctly populated:
https://github.com/paritytech/parity/blob/aefa8d5f5975e00da024550eb51e65bd3cae6534/rpc/src/v1/types/receipt.rs#L94-L95

We should add from and to to RichReceipt and populate it during creation.

I think root is correctly null, as we don't produce intermediate state roots after EIP98. Although we might consider just not returning the field at all if it's null (#[serde(skip_serializing_if = "Option::is_none")])

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
F2-bug 🐞 The client fails to follow expected behavior. M4-core ⛓ Core client code / Rust. M6-rpcapi 📣 RPC API.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants