8000 Porting go-ethereum/rlp package. by sirano11 · Pull Request #1385 · klaytn/klaytn · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
This repository was archived by the owner on Aug 19, 2024. It is now read-only.

Porting go-ethereum/rlp package. #1385

Merged
merged 7 commits into from
May 30, 2022
Merged

Porting go-ethereum/rlp package. #1385

merged 7 commits into from
May 30, 2022

Conversation

sirano11
Copy link
@sirano11 sirano11 commented May 19, 2022

Proposed changes

For using "optional" struct tag, ported latest go-ethereum/rlp package.

  • Among the packages imported and referenced by the rlp package, Changed the ethereum package that referenced from rlp to the klaytn package.

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

@kjhman21
Copy link

@sirano11 Could you explain what you've changed in addition to bringing the original Ethereum code?

@sirano11
Copy link
Author
sirano11 commented May 20, 2022

Could you explain what you've changed in addition to bringing the original Ethereum code?

@kjhman21
Among the packages imported and referenced by the rlp package, I changed the ethereum package to the klaytn package.

kjhman21
kjhman21 previously approved these changes May 20, 2022
Copy link
@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.

LGTM.
@aidan-kwon Please take a look.

kjeom
8000 kjeom previously approved these changes May 23, 2022
@kjeom
Copy link
kjeom commented May 24, 2022

I tested encoding/decoding block header before/after KIP-71 hard fork and It works well with this PR :)

@sirano11 sirano11 dismissed stale reviews from kjeom and kjhman21 via b46d938 May 24, 2022 05:05
Co-authored-by: Jang Hyung Kyu <pepper.jang@krustuniverse.com>
@hyunsooda
Copy link
Contributor
hyunsooda commented May 25, 2022
8000

Based on this big change, could you describe how you tested compatibility tests? For example:

As you know better than I, the RLP is widely used in the existing functionalities (e.g., network, DB, etc.). The facts seem to be required that this new change perfectly works in all the places used if the fundamental rules of RLP are still preserved (The rules seem preserved in my view) .

@hyunsooda
Copy link
Contributor

Could you take a look again entirely the imported license? (some of the files seems not updated and even not imported)

@sirano11
Copy link
Author

@hyunsooda

Given a stored block (or any structure) with the previous RLP encoding method, is it decodable with the new RLP decoder?

Because it already exists a test about rlp encoding / decoding, i think it is enough to check compatiblility with testing existed test case.

By the new changes (optional fields, nil, nilList, nilString, etc), Is there a case that the RLP-encoded data is misinterpreted between two nodes whose have different RLP encoding and decoding methods?) (https://github.com/klaytn/klaytn/pull/1385/files#diff-0307e7f9d52cb5d1be9e58e3ed38f13060d2b28e85617df74aed30b08a720445L239-R353)

These changes will be contained hardfork update, it means that all node must update new klaytn version which contains these changes.

Could you take a look again entirely the imported license? (some of the files seems not updated and even not imported)

Only files that I have modified (eg, change of import path) have modified the license, and files that have not been modified do not change the license part.
If I made a mistake, can you tell me in the comments?

@hyunsooda
Copy link
Contributor
hyunsooda commented May 25, 2022

Okay. Then please describe this change is for the hardfork update so that similar questions would not be popped.

Because it already exists a test about rlp encoding / decoding, i think it is enough to check compatiblility with testing existed test case.

All the current test units call the newly replaced RLP encoding/decoding methods. I was concerned the surprising difference in encoding and decoding between the old one and your change may lead to wrong encoding/decoding result.

These changes will be contained hardfork update, it means that all node must update new klaytn version which contains these changes.

Even if its change is for the hardfork, EN/PN binaries must be updated since its change is not bounded to consensus/governance.

Only files that I have modified (eg, change of import path) have modified the license, and files that have not been modified do not change the license part.
If I made a mistake, can you tell me in the comments?

  • If you imported testdata directory as is, putting licenses are required, or if it is generated by tools or code, no change seems required.
  • types.go, gen.go, gen_test.go, enc_buffer.go, safe.go, unsafe.go,

Hope to hear your comment again.

Copy link
@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.

LGTM

@sirano11 sirano11 merged commit ed593ea into klaytn:dev May 30, 2022
@hyunsooda
Copy link
Contributor

@sirano11, Could you post an issue and address the unexpected cases such as https://github.com/klaytn/klaytn/pull/1385/files#diff-0307e7f9d52cb5d1be9e58e3ed38f13060d2b28e85617df74aed30b08a720445L239-R353?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants
0