Skip to content

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

Copy link

@Anynomouss Anynomouss Sep 25, 2025

Choose a reason for hiding this comment

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

I would keep the diagram, just my opinion as a visual thinker.
I would propose to either close this PR or modify the PR to contain a modified version of the diagram that matches the new and more correct process description by @tromp

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.

4 participants