web3.js icon indicating copy to clipboard operation
web3.js copied to clipboard

`TransactionReceipt` do not have the `gasPrice` attribute

Open nazarhussain opened this issue 3 years ago • 1 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

Current Behavior

Currently the TransactionReceipt does not have the gasPrice attribute.

Expected Behavior

It's used in different projects.

https://github.com/trufflesuite/truffle/blob/e6004bda9f09e1c9a5870050a40a783da0707788/packages/interface-adapter/lib/adapter/web3/index.ts#L79

Steps to Reproduce

Not available.

Web3.js Version

4.x

Environment

  • Operating System:
  • Browser:
  • Node.js Version:
  • NPM Version:

Anything Else?

This field is not available in the specs, so we need to be careful for adding this attribute.

https://github.com/ethereum/execution-apis/blob/0b965fb714ccd3faa3c939fdce1726e56679cdec/src/schemas/receipt.yaml#L36

nazarhussain avatar Jul 12 '22 14:07 nazarhussain

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions. If you believe this was a mistake, please comment.

github-actions[bot] avatar Sep 11 '22 00:09 github-actions[bot]

There is no gasPrice field in tx receipt in:

  • Eth Specs :

https://github.com/ethereum/execution-apis/blob/9846b93ae6e9e323209fa826832b91139cc82925/src/schemas/receipt.yaml#L36

  • Its not returned by Eth node ( tested on geth )
{
    "jsonrpc": "2.0",
    "id": 1,
    "result": {
        "blockHash": "0xd62735d17d3bfc651b93a83dbc9e37acbc8c1318f24e1f604239fa34c1c13323",
        "blockNumber": "0x26298b",
        "contractAddress": null,
        "cumulativeGasUsed": "0x38658",
        "effectiveGasPrice": "0x4a817c800",
        "from": "0xea674fdde714fd979de3edf0f56aa9716b898ec8",
        "gasUsed": "0x5208",
        "logs": [],
        "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
        "root": "0x61d804d6deea0447a7e232ea033f5058088f72f4502a515028d8971e22879f68",
        "to": "0xf34a762291e2578b79646cbf296abf4f5a242b3d",
        "transactionHash": "0xddcc471a6e1a1cd8b49f40ab295c9e351f184e4de8493ab865d15d34bd34a5d6",
        "transactionIndex": "0xa",
        "type": "0x0"
    }
}
  • Its not in web3 4x
  • Its not used in project referred above ( the link shared above is getting transaction https://github.com/trufflesuite/truffle/blob/e6004bda9f09e1c9a5870050a40a783da0707788/packages/interface-adapter/lib/adapter/web3/index.ts#L73 and not transaction receipt )

We have effectiveGasPrice field in 4.x receipt that is in compliance with EL specs and valid with Eth node as well. So closing this issue.

jdevcs avatar Apr 12 '23 11:04 jdevcs