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: Allow merkle trees of 1 node (its root) #919

Merged
merged 5 commits into from
Sep 27, 2024

Conversation

uri-99
Copy link
Contributor

@uri-99 uri-99 commented Sep 26, 2024

Allow merkle trees of 1 node

Description

This PR removes the constraint from is_power_of_two() that said 1 is not a power of 2.

In turn, this allows Merkle Trees of size 1 to be built, without padding them to 2 nodes. Size 1 Merkle Trees are then only 1 node, which is equal to its root.

Type of change

  • New feature: Allow Merkle Trees of size 1

Checklist

  • Linked to Github Issue
  • Unit tests added
  • Unit tests updated
  • This change requires new documentation.
    • Documentation has been added/updated.
  • This change is an Optimization
    • Benchmarks added/run

@uri-99 uri-99 requested a review from a team as a code owner September 26, 2024 14:43
@uri-99 uri-99 changed the title feat: change is_power_of_two() to allow merkle trees of 1 node (its root) feat: Allow merkle trees of 1 node (its root) Sep 26, 2024
@uri-99 uri-99 marked this pull request as draft September 26, 2024 14:46
@uri-99 uri-99 marked this pull request as ready for review September 26, 2024 14:56
diegokingston and others added 2 commits September 27, 2024 11:43
Co-authored-by: Mario Rugiero <mrugiero@gmail.com>
Copy link
Contributor

@pablodeymo pablodeymo left a comment

Choose a reason for hiding this comment

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

LGTM

@diegokingston diegokingston added this pull request to the merge queue Sep 27, 2024
Merged via the queue into lambdaclass:main with commit efd46f0 Sep 27, 2024
7 of 8 checks passed
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.

5 participants