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

Not to wrap values into RLP when storing the valueNode in the trie #126

Closed
AlexeyAkhunov opened this issue Oct 19, 2019 · 1 comment · Fixed by #170
Closed

Not to wrap values into RLP when storing the valueNode in the trie #126

AlexeyAkhunov opened this issue Oct 19, 2019 · 1 comment · Fixed by #170
Assignees

Comments

@AlexeyAkhunov
Copy link
Contributor

AlexeyAkhunov commented Oct 19, 2019

Before we performed state trie unification and therefore created a separate leaf node type accountNode, simple value nodes and account nodes needed different amount of RLP "wrapping" (The quirk of yellow paper). Now that that their are separate, we should remove RLP wrapping from valueNode leaves. This will simplify code in some parts, and also reduce number of allocation due to wrapping/up-wrapping.
Issue #118 was a result of extra wrapping applied erroneously

@AlexeyAkhunov
Copy link
Contributor Author

Additionally, HashBuilder (in trie/structural_2.go) should be changed to assume that value tape provides "raw" (without any RLP encoding) values, and additional (2nd) wrapping to occur here:
https://github.com/ledgerwatch/turbo-geth/blob/c9e1cb8b7728d7d302cf192512fa6614e2584cbe/trie/structural_2.go#L306

by using generateByteArrayLenDouble and then subsequently generating two RLP length prefixes instead of one (that is quite weird design in Ethereum, but we've got to live with it for now).

@mandrigin mandrigin self-assigned this Nov 7, 2019
battlmonstr pushed a commit that referenced this issue Sep 14, 2023
cffls pushed a commit to cffls/erigon that referenced this issue Feb 14, 2024
jyellick pushed a commit to bobanetwork/op-erigon that referenced this issue Feb 26, 2024
wtdcode pushed a commit to wtdcode/erigon that referenced this issue May 27, 2024
taratorio pushed a commit that referenced this issue Jul 23, 2024
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 a pull request may close this issue.

2 participants