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

don't confuse with different numbering bases #3660

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

tromp
Copy link
Contributor

@tromp tromp commented Nov 5, 2021

Minor change in MMR doc, rewriting a few paragraphs that for no good reason used 1-based positions.

@phyro
Copy link
Member

phyro commented Nov 9, 2021

Unrelated to this change, but I do wonder if the hashing in the document is correct e.g. P = Blake2b(N | Blake2b(N | Node(p3) | Node(p2)) | Node(p1)). I don't understand why we'd hash this way.

@tromp
Copy link
Contributor Author

tromp commented Nov 9, 2021

Unrelated to this change, but I do wonder if the hashing in the document is correct e.g. P = Blake2b(N | Blake2b(N | Node(p3) | Node(p2)) | Node(p1)). I don't understand why we'd hash this way.

Thanks for spotting that mistake. Fixed now.

peaks is 19-15=4.
After 2 more right shifts to peak size 3, we find 4 >= 3 and identify the 2nd peak,
reducing relative position to 4-3 = 1.
A final right shift gives a peak size of 1, and with 1 >= 1, we identified the 3rd and final peak.
Copy link
Member

Choose a reason for hiding this comment

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

This is definitely more correct in terms of keeping consistent with a 0 based index and the code, but I have to say I did like having the diagram in place and the 'all ones on the left' to assist with the process conceptually (even thought it was 1-index based).

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.

None yet

3 participants