Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@roberto-bayardo
Copy link
Collaborator

@roberto-bayardo roberto-bayardo commented Jul 22, 2025

Fixes issue where adb::Any was unnecessarily hashing database operations before putting them in the MMR, which does its own hashing of provided elements.

@roberto-bayardo roberto-bayardo marked this pull request as ready for review July 22, 2025 22:27
Copy link
Contributor

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 fixes a double-hashing issue in the adb::Any storage implementation where operations were being hashed before being added to the MMR (Merkle Mountain Range), which performs its own hashing internally.

  • Removes the intermediate op_digest function that was pre-hashing operations
  • Updates all MMR operations to use encoded operations directly instead of digests
  • Simplifies verification logic by passing encoded elements rather than pre-computed hashes

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
storage/src/adb/current.rs Updates verification methods to use encoded operations instead of digests, adds Encode trait import
storage/src/adb/any/mod.rs Removes op_digest function, updates MMR operations to use encoded data directly, fixes documentation formatting

@roberto-bayardo roberto-bayardo force-pushed the fix-redundant-hashing branch 2 times, most recently from 0f77d75 to 1b70188 Compare July 22, 2025 22:59
@patrick-ogrady patrick-ogrady merged commit bea2e00 into main Jul 22, 2025
33 checks passed
@patrick-ogrady patrick-ogrady deleted the fix-redundant-hashing branch July 22, 2025 23:12
@codecov
Copy link

codecov bot commented Jul 23, 2025

Codecov Report

Attention: Patch coverage is 92.30769% with 1 line in your changes missing coverage. Please review.

Project coverage is 91.22%. Comparing base (078ed74) to head (0250a85).
Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
storage/src/adb/current.rs 87.50% 1 Missing ⚠️
@@            Coverage Diff             @@
##             main    #1308      +/-   ##
==========================================
+ Coverage   91.21%   91.22%   +0.01%     
==========================================
  Files         247      248       +1     
  Lines       61770    61917     +147     
==========================================
+ Hits        56342    56483     +141     
- Misses       5428     5434       +6     
Files with missing lines Coverage Δ
storage/src/adb/any/mod.rs 99.10% <100.00%> (-0.01%) ⬇️
storage/src/mmr/mem.rs 92.21% <ø> (ø)
storage/src/adb/current.rs 96.87% <87.50%> (-0.02%) ⬇️

... and 3 files with indirect coverage changes


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 078ed74...0250a85. 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