Skip to content

merkle: cleanup and add new_repeated#80

Merged
delbonis merged 4 commits intomainfrom
feature/mmr-batch-init
Apr 6, 2026
Merged

merkle: cleanup and add new_repeated#80
delbonis merged 4 commits intomainfrom
feature/mmr-batch-init

Conversation

@delbonis
Copy link
Copy Markdown
Collaborator

@delbonis delbonis commented Mar 25, 2026

Description

This PR does three things:

  • make CompactMmr64 only available if the new legacy_compact feature is enabled, we should only be using the SSZ version everywhere now, doing some reorganization in the process
  • STR-2783: adds a new_repeated fn to create efficiently create MMR instances containing lots of repeated elements, with an exhaustive test
  • makes everything be exported at the crate root and hides the modules themselves

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature/Enhancement (non-breaking change which adds functionality or enhances an existing one)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Refactor
  • New or updated tests
  • Dependency update
  • Security fix

Notes to Reviewers

Checklist

  • I have performed a self-review of my code.
  • I have commented my code where necessary.
  • I have updated the documentation if needed.
  • My changes do not introduce new warnings.
  • I have added tests that prove my changes are effective or that my feature works.
  • New and existing tests pass with my changes.

Related Issues

@delbonis delbonis requested a review from prajwolrg March 25, 2026 18:21
Copy link
Copy Markdown
Member

@storopoli storopoli left a comment

Choose a reason for hiding this comment

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

Just one comment (not a blocker).

Comment on lines -18 to +21
### Sibling hashes required for proof.
inner: RawMerkleProofB32
### Index of the element for which this proof is for.
index: uint64
### Sibling hashes required for proof.
inner: RawMerkleProofB32
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This diff is not needed right. This is a noop.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Actually not a noop. This fundamentally changes SSZ serialization order why?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

it should have been like this in the first place 😭

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Ok

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please rebase?

@delbonis delbonis force-pushed the feature/mmr-batch-init branch from a6d756b to 3ed816a Compare April 6, 2026 20:29
@delbonis delbonis merged commit 76b6277 into main Apr 6, 2026
10 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.

2 participants