Skip to content

Conversation

roberto-bayardo
Copy link
Collaborator

@roberto-bayardo roberto-bayardo commented Aug 14, 2025

Adds a new method verify_range_inclusion_and_extract_digests to the Proof struct that returns all node digests involved in the MMR root reconstruction process, along with their positions. This extends the existing root_from_range functionality.

Copilot

This comment was marked as outdated.

Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds a new method digests_from_range to the Proof struct that returns all node digests involved in the MMR root reconstruction process, along with their positions. This extends the existing root_from_range functionality to provide more detailed information about the reconstruction process.

  • Introduces digests_from_range method that returns all (position, digest) pairs used during root reconstruction
  • Refactors internal functions to optionally collect digests during traversal
  • Changes ReconstructionError visibility from pub(crate) to pub

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@roberto-bayardo roberto-bayardo marked this pull request as ready for review August 14, 2025 19:28
range_info: RangeInfo,
elements: &mut E,
sibling_digests: &mut S,
mut collected_digests: Option<&mut Vec<(u64, I::Digest)>>,
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm generally not a huge fan of the "pass and fill" pattern but am not yet seeing a way to support this without a ton of duplicate code any other way.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yeah, this pattern here is only for internal APIs at least.

patrick-ogrady
patrick-ogrady previously approved these changes Aug 14, 2025
@patrick-ogrady patrick-ogrady merged commit b0c42a4 into main Aug 14, 2025
35 checks passed
@patrick-ogrady patrick-ogrady deleted the collect-digests branch August 14, 2025 21:36
Copy link

codecov bot commented Aug 14, 2025

Codecov Report

❌ Patch coverage is 91.48936% with 16 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (main@8e23110). Learn more about missing BASE report.
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
storage/src/adb/verify.rs 0.00% 15 Missing ⚠️
storage/src/mmr/verification.rs 99.42% 1 Missing ⚠️
@@           Coverage Diff           @@
##             main    #1403   +/-   ##
=======================================
  Coverage        ?   91.69%           
=======================================
  Files           ?      275           
  Lines           ?    69192           
  Branches        ?        0           
=======================================
  Hits            ?    63447           
  Misses          ?     5745           
  Partials        ?        0           
Files with missing lines Coverage Δ
storage/src/mmr/verification.rs 95.50% <99.42%> (ø)
storage/src/adb/verify.rs 61.53% <0.00%> (ø)

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8e23110...2631df0. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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