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

Remove EthereumTxTypeEnvelope from raw tx #1264

Merged
merged 2 commits into from
Mar 23, 2022

Conversation

aeharvlee
Copy link
Contributor

@aeharvlee aeharvlee commented Mar 23, 2022

Proposed changes

EthereumTxTypeEnvelope(=0x78) is used for klay namespace APIs, not eth.

As-is

  • EthereumTxTypeEnvelope(=0x78) is appended for raw tx result when fetching Ethereum typed transactions using eth_getRawTransactionByBlockHashAndIndex and eth_getRawTransactionByBlockNumberAndIndex.
# eth_getRawTransactionByBlockHashAndIndex
curl http://localhost:8551 \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"eth_getRawTransactionByBlockHashAndIndex","params":["0x229ad80da53d0fb4111bf07d6b486d7dc57ee2af8c1e9f0af35dd4e7c0658885", "0x0"],"id":1}'
{"jsonrpc":"2.0","id":1,"result":"0x7802f86e8207e3458505d21dba008505d21dba0082c350943e2ac308cd78ac2fe162f9522deb2b56d9da94998080c001a04fc36a3c56650ffe1da32b5fdb81e3b5dd39c57154dfe721192a0742da91c261a0119b80ec12e1c01faab5673f29bcd3d8a56a4c319426bccf1570c7e13afe1477"}

# eth_getRawTransactionByBlockNumberAndIndex
curl http://localhost:8551 \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"eth_getRawTransactionByBlockNumberAndIndex","params":["0x174a5", "0x0"],"id":1}'
{"jsonrpc":"2.0","id":1,"result":"0x7802f86e8207e3458505d21dba008505d21dba0082c350943e2ac308cd78ac2fe162f9522deb2b56d9da94998080c001a04fc36a3c56650ffe1da32b5fdb81e3b5dd39c57154dfe721192a0742da91c261a0119b80ec12e1c01faab5673f29bcd3d8a56a4c319426bccf1570c7e13afe1477"}

To-be (If this PR is merged)

  • EthereumTxTypeEnvelope(=0x78) is appended for raw tx result.
# eth_getRawTransactionByBlockHashAndIndex
curl http://localhost:8551 \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"eth_getRawTransactionByBlockHashAndIndex","params":["0x229ad80da53d0fb4111bf07d6b486d7dc57ee2af8c1e9f0af35dd4e7c0658885", "0x0"],"id":1}'
{"jsonrpc":"2.0","id":1,"result":"0x02f86e8207e3458505d21dba008505d21dba0082c350943e2ac308cd78ac2fe162f9522deb2b56d9da94998080c001a04fc36a3c56650ffe1da32b5fdb81e3b5dd39c57154dfe721192a0742da91c261a0119b80ec12e1c01faab5673f29bcd3d8a56a4c319426bccf1570c7e13afe1477"}

# eth_getRawTransactionByBlockNumberAndIndex
curl http://localhost:8551 \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"eth_getRawTransactionByBlockNumberAndIndex","params":["0x174a5", "0x0"],"id":1}'
{"jsonrpc":"2.0","id":1,"result":"0x02f86e8207e3458505d21dba008505d21dba0082c350943e2ac308cd78ac2fe162f9522deb2b56d9da94998080c001a04fc36a3c56650ffe1da32b5fdb81e3b5dd39c57154dfe721192a0742da91c261a0119b80ec12e1c01faab5673f29bcd3d8a56a4c319426bccf1570c7e13afe1477"}
  • Of course raw tx of other tx types returned as it is.
# eth_getRawTransactionByBlockNumberAndIndex for LegacyTransaction
curl http://localhost:8551 \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"eth_getRawTransactionByBlockNumberAndIndex","params":["0x17d63", "0x0"],"id":1}'
{"jsonrpc":"2.0","id":1,"result":"0xf866468505d21dba0082c350943e2ac308cd78ac2fe162f9522deb2b56d9da94998080820fe9a0ee8406f2a554e781b07f0a66889a4c697ca58348345d303923f59f87bae204a7a06165806b67122f0e1309b673835cfe2e7ec0a14ecc7d11249ee21b520a351d21"

# eth_getRawTransactionByBlockNumberAndIndex for ValueTransfer
curl http://localhost:8551 \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"eth_getRawTransactionByBlockHashAndIndex","params":["0x226f0e25cda2732dda1f74ec47d9a5a32e64566325987c3eed1690c3c12eab63", "0x0"],"id":1}'
{"jsonrpc":"2.0","id":1,"result":"0x08f880498505d21dba0082c350943e2ac308cd78ac2fe162f9522deb2b56d9da94998201f494ca7a99380131e6c76cfa622396347107aeedca2df847f845820feaa0cfe0a5fae76def5ae00ab0c77416d6056f408c25fb1c58ae06898ed284b69762a0691b9ef65784125bb85b5a97c569c65ea168517d26219114b596465ba22bf8d5"}

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...

EthereumTxTypeEnvelope is used for klay namespace APIs, not eth.
jimni1222
jimni1222 previously approved these changes Mar 23, 2022
aidan-kwon
aidan-kwon previously approved these changes Mar 23, 2022
sirano11
sirano11 previously approved these changes Mar 23, 2022
kjhman21
kjhman21 previously approved these changes Mar 23, 2022
Copy link
Collaborator

@kjhman21 kjhman21 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have no objection to merge this, but can we make a test case for this?

@aeharvlee
Copy link
Contributor Author

aeharvlee commented Mar 23, 2022

I have no objection to merge this, but can we make a test case for this?

@kjhman21
PTAL this commit.

@aeharvlee aeharvlee merged commit 3399a00 into klaytn:dev Mar 23, 2022
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.

EthereumTxTypeEnvelope must be removed from raw tx
5 participants