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

Fix ambiguous empty brackets in Appendix D #852

Merged
merged 1 commit into from
Apr 7, 2022

Conversation

michprev
Copy link
Contributor

@michprev michprev commented Apr 5, 2022

Appendix B (Recursive Length Prefix) defines two sets of possible inputs to the RLP function: lists and byte arrays.
image

An empty list must be distinguishable from an empty byte array because RLP of an empty list is (0xC0) while RLP of an empty byte array is (0x80).

Appendix D (Modified Merkle Patricia Tree) uses empty round brackets in two equations. In both cases it is unclear whether these empty round brackets represent an empty list or an empty byte array. It should be fixed in this PR.
image
image

In both cases, these empty brackets should represent an empty byte array, which I checked against geth source code (https://github.com/ethereum/go-ethereum/blob/5079e3c6e5f2096e32b2216d1119db66fe0ff531/trie/node_enc.go#L37 and https://github.com/ethereum/go-ethereum/blob/5079e3c6e5f2096e32b2216d1119db66fe0ff531/trie/node_enc.go#L49).

Modified equations look like this:
image
image

@yperbasis yperbasis merged commit 934279c into ethereum:master Apr 7, 2022
fulldecent pushed a commit to fulldecent/yellowpaper that referenced this pull request Dec 31, 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 this pull request may close these issues.

2 participants