Skip to content

feat(SmtForest): Make the entries iterator fallible#900

Merged
iamrecursion merged 1 commit intonextfrom
forest-fallible-iterator
Mar 16, 2026
Merged

feat(SmtForest): Make the entries iterator fallible#900
iamrecursion merged 1 commit intonextfrom
forest-fallible-iterator

Conversation

@iamrecursion
Copy link
Collaborator

@iamrecursion iamrecursion commented Mar 16, 2026

Describe your changes

This changes LargeSmtForest::entries to return an iterator over items that are Result<TreeEntry> instead of bare TreeEntry, ensuring that the potential failure of iteration in the backend is communicated clearly to the caller performing the iteration.

We also add benchmarks to the iteration in order to confirm that the changes incur no performance impact.

Closes #887.

Checklist before requesting a review

  • Repo forked and branch created from next according to naming convention.
  • Commit messages and codestyle follow conventions.
  • Relevant issues are linked in the PR description.
  • Tests added for new functionality.
  • Documentation/comments updated according to changes.

@iamrecursion iamrecursion self-assigned this Mar 16, 2026
@iamrecursion iamrecursion added the merkle Related to Merkle trees or MMRs label Mar 16, 2026
@iamrecursion iamrecursion force-pushed the forest-fallible-iterator branch from bc730c5 to ed96e0f Compare March 16, 2026 12:39
@iamrecursion iamrecursion marked this pull request as ready for review March 16, 2026 12:55
Copy link
Contributor

@huitseeker huitseeker left a comment

Choose a reason for hiding this comment

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

Thanks a lot! This LGTM.

This changes `LargeSmtForest::entries` to return an iterator over items
that are `Result<TreeEntry>` instead of bare `TreeEntry`, ensuring that
the potential failure of iteration in the backend is communicated
clearly to the caller performing the iteration.

We also add benchmarks to the iteration in order to confirm that the
changes incur no performance impact.
@iamrecursion iamrecursion force-pushed the forest-fallible-iterator branch from ed96e0f to 7c0e920 Compare March 16, 2026 16:15
@iamrecursion iamrecursion merged commit b779dbf into next Mar 16, 2026
29 checks passed
@iamrecursion iamrecursion deleted the forest-fallible-iterator branch March 16, 2026 17:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merkle Related to Merkle trees or MMRs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Discuss error handling in LargeSmtForests entries iterator

3 participants