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

feat: verifies new MMR = old MMR + all incremental headers #13

Merged

Conversation

yangby-cryptape
Copy link
Collaborator

@yangby-cryptape yangby-cryptape commented Jul 19, 2023

Issue

The old code only checks:

  • Whether the new MMR root contains all-new appended headers.

But it doesn't check:

  • Whether the new MMR root is a successor of the old MMR root.
  • If there exists any headers not list in the new-appended headers, but they are contained in the new MMR root.

As a permissionless solution, it has to avoid those potential attracts.

Solution

Just upgrade the dependency and introduce a new API.

More details could be found in:

Tips for Review

  • No break changes.
  • The positions is removed, since the new API considers that all new appended headers are continuous with the previous headers, so it calculates the positions of headers inside itself.
  • Currently, we have unit tests for this change.

@yangby-cryptape yangby-cryptape marked this pull request as ready for review July 19, 2023 16:51
@yangby-cryptape yangby-cryptape marked this pull request as draft July 19, 2023 16:51
@yangby-cryptape yangby-cryptape force-pushed the feature/check-old-mmr-root branch from 0f9febb to 9325266 Compare July 19, 2023 17:24
@yangby-cryptape yangby-cryptape marked this pull request as ready for review July 19, 2023 17:35
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