Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed receipt status values when serving eth_getTransactionReceipt #1257

Merged
merged 1 commit into from
Mar 22, 2022

Conversation

aeharvlee
Copy link
Contributor

@aeharvlee aeharvlee commented Mar 22, 2022

Proposed changes

The value of status field of Receipt should have 0(=Failure) or 1(=Success) only when served as eth namespace.

As-Is

Klaytn - Get Transaction Receipt for reverted tx

curl http://localhost:8551 \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"eth_getTransactionReceipt","params":["0x7247ef708a97c98e2459696afe4473a6f37cb0bc9b43e4144238d730f45a57f1"],"id":1}'
  • status field have "0x9" which is not "0x0".
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "blockHash": "0x7bfb410e63d8f2865a2774d62f74057071aed4c0c7868af29665ddc3ae661c64",
    "blockNumber": "0xebcb",
    "contractAddress": null,
    "cumulativeGasUsed": "0x6661",
    "effectiveGasPrice": "0x5d21dba00",
    "from": "0xca7a99380131e6c76cfa622396347107aeedca2d",
    "gasUsed": "0x6661",
    "logs": [],
    "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
    "status": "0x9",
    "to": "0xce9267d48d3fb8e9efabaaf6b6662dfd72187377",
    "transactionHash": "0x7247ef708a97c98e2459696afe4473a6f37cb0bc9b43e4144238d730f45a57f1",
    "transactionIndex": "0x0",
    "type": "0x0"
  }
}

To-be ( If this PR merged)

Geth - Get Transaction Receipt for reverted tx

curl http://localhost:8545 \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"eth_getTransactionReceipt","params":["0x261cdfabddc91b40608a16868964a353d54da547dfb722c13628e3f7df343be8"],"id":1}'
  • status field have "0x0" because it is reverted tx.
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "blockHash": "0xa1abc8e1c29c4bafecb040a8c4de7b8bf3aec325249811569f7835c0e3abecff",
    "blockNumber": "0xc1b",
    "contractAddress": null,
    "cumulativeGasUsed": "0x5f15",
    "effectiveGasPrice": "0x3b9aca07",
    "from": "0xca7a99380131e6c76cfa622396347107aeedca2d",
    "gasUsed": "0x5f15",
    "logs": [],
    "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
    "status": "0x0",
    "to": "0x07af6e214e7deb6c3d7409fca8d81adda8151237",
    "transactionHash": "0x261cdfabddc91b40608a16868964a353d54da547dfb722c13628e3f7df343be8",
    "transactionIndex": "0x0",
    "type": "0x2"
  }
}

Klaytn - Get Transaction Receipt for reverted tx

curl http://localhost:8551 \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"eth_getTransactionReceipt","params":["0x7247ef708a97c98e2459696afe4473a6f37cb0bc9b43e4144238d730f45a57f1"],"id":1}'
  • status field have "0x0" because it is reverted tx.
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "blockHash": "0x7bfb410e63d8f2865a2774d62f74057071aed4c0c7868af29665ddc3ae661c64",
    "blockNumber": "0xebcb",
    "contractAddress": null,
    "cumulativeGasUsed": "0x6661",
    "effectiveGasPrice": "0x5d21dba00",
    "from": "0xca7a99380131e6c76cfa622396347107aeedca2d",
    "gasUsed": "0x6661",
    "logs": [],
    "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
    "status": "0x0",
    "to": "0xce9267d48d3fb8e9efabaaf6b6662dfd72187377",
    "transactionHash": "0x7247ef708a97c98e2459696afe4473a6f37cb0bc9b43e4144238d730f45a57f1",
    "transactionIndex": "0x0",
    "type": "0x0"
  }
}

Types of changes

Please put an x in the boxes related to your change.

  • Bugfix
  • New feature or enhancement
  • Others

Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.

  • I have read the CONTRIBUTING GUIDELINES doc
  • I have signed the CLA
  • Lint and unit tests pass locally with my changes ($ make test)
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)
  • Any dependent changes have been merged and published in downstream modules

Related issues

  • Please leave the issue numbers or links related to this PR here.

Further comments

If this is a relatively large or complex change, kick off the discussion by explaining why you chose the solution you did and what alternatives you considered, etc...

The value of status of Receipt field should have 0 or 1 only when served as eth namespace.
@aeharvlee aeharvlee self-assigned this Mar 22, 2022
@aeharvlee aeharvlee linked an issue Mar 22, 2022 that may be closed by this pull request
@aeharvlee aeharvlee merged commit 2850bf8 into dev Mar 22, 2022
@aidan-kwon aidan-kwon deleted the fix_receipt_status branch July 24, 2023 03:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

fix status field of receipt
5 participants