Skip to content

Conversation

roberto-bayardo
Copy link
Collaborator

@roberto-bayardo roberto-bayardo commented Oct 3, 2025

This PR creates a variant of adb::current called adb::ordered::Current that supports key exclusion proofs.

TODO:

  • current_ordered_init benchmark
  • adb_current_ordered_operations fuzz test

@roberto-bayardo roberto-bayardo changed the base branch from main to ordered-any October 3, 2025 20:53
@roberto-bayardo roberto-bayardo changed the title [storage/adb/current] Exclusion proof db [storage/adb/current] [WiP] Exclusion proof db Oct 3, 2025
Copy link

cloudflare-workers-and-pages bot commented Oct 3, 2025

Deploying monorepo with  Cloudflare Pages  Cloudflare Pages

Latest commit: ca42d14
Status: ✅  Deploy successful!
Preview URL: https://131b5e26.monorepo-eu0.pages.dev
Branch Preview URL: https://exclusion-proof-db.monorepo-eu0.pages.dev

View logs

@roberto-bayardo roberto-bayardo force-pushed the ordered-any branch 7 times, most recently from daced5e to 5ba7fc9 Compare October 9, 2025 18:47
@roberto-bayardo roberto-bayardo force-pushed the exclusion-proof-db branch 3 times, most recently from c05e8b7 to 0f4496f Compare October 9, 2025 22:08
@roberto-bayardo roberto-bayardo force-pushed the ordered-any branch 2 times, most recently from 264d8d8 to 475173b Compare October 10, 2025 22:05
@roberto-bayardo roberto-bayardo force-pushed the exclusion-proof-db branch 2 times, most recently from 51d13da to c2aff73 Compare October 13, 2025 23:28
@roberto-bayardo roberto-bayardo changed the base branch from ordered-any to main October 13, 2025 23:30
@roberto-bayardo roberto-bayardo force-pushed the exclusion-proof-db branch 3 times, most recently from 2f0cbcb to 49a8525 Compare October 13, 2025 23:56
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 introduces an ordered variant of the current authenticated database (ADB) that supports key exclusion proofs. The main purpose is to extend the existing unordered current ADB implementation with ordered key capabilities, allowing users to prove that specific keys do not exist in the database.

Key changes include:

  • Creation of a new adb::current::ordered module with exclusion proof functionality
  • Refactoring of the existing current ADB to separate ordered and unordered variants
  • Addition of helper methods for empty MMR root computation and ordered key operations

Reviewed Changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
storage/src/mmr/mem.rs Added empty_mmr_root helper method and corresponding test
storage/src/mmr/hasher.rs Updated test to use new empty MMR root helper
storage/src/mmr/grafting.rs Fixed documentation reference from specific type to module
storage/src/adb/mod.rs Added KeyExists error variant for exclusion proof failures
storage/src/adb/current/unordered.rs Updated to use new shared verification function and added next_key field
storage/src/adb/current/ordered.rs New implementation of ordered current ADB with exclusion proof support
storage/src/adb/current/mod.rs Refactored to support both ordered and unordered variants, added shared verification functions
storage/src/adb/benches/current_init.rs Updated import to use unordered variant
storage/src/adb/any/fixed/unordered.rs Added is_empty helper method
storage/src/adb/any/fixed/ordered.rs Made fields and methods public for use by current ordered implementation
storage/fuzz/fuzz_targets/adb_current_operations.rs Updated import to use unordered variant

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

// Handle the case where the proof shows the db is empty, hence any key is proven
// excluded.
let op = Operation::<K, V>::CommitFloor(loc);
// Make sure the
Copy link

Copilot AI Oct 13, 2025

Choose a reason for hiding this comment

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

Incomplete comment on line 657. The comment 'Make sure the' appears to be cut off and should be completed or removed.

Suggested change
// Make sure the

Copilot uses AI. Check for mistakes.

@roberto-bayardo roberto-bayardo changed the title [storage/adb/current] [WiP] Exclusion proof db [storage/adb/current] adb::ordered::current (provides exclusion proof support) Oct 13, 2025
@commonwarexyz commonwarexyz deleted a comment from Copilot AI Oct 14, 2025
Copy link

codecov bot commented Oct 14, 2025

Codecov Report

❌ Patch coverage is 96.27907% with 40 lines in your changes missing coverage. Please review.
✅ Project coverage is 92.27%. Comparing base (2dd0dae) to head (ca42d14).

Files with missing lines Patch % Lines
storage/src/adb/current/ordered.rs 98.29% 17 Missing ⚠️
storage/src/adb/current/mod.rs 72.34% 13 Missing ⚠️
storage/src/adb/any/fixed/ordered.rs 37.50% 10 Missing ⚠️
@@            Coverage Diff             @@
##             main    #1799      +/-   ##
==========================================
+ Coverage   92.21%   92.27%   +0.05%     
==========================================
  Files         308      309       +1     
  Lines       81255    82320    +1065     
==========================================
+ Hits        74931    75960    +1029     
- Misses       6324     6360      +36     
Files with missing lines Coverage Δ
storage/src/adb/any/fixed/unordered.rs 95.11% <100.00%> (+0.01%) ⬆️
storage/src/adb/current/unordered.rs 92.62% <100.00%> (+0.04%) ⬆️
storage/src/adb/mod.rs 95.45% <ø> (ø)
storage/src/mmr/grafting.rs 86.25% <ø> (ø)
storage/src/mmr/hasher.rs 93.70% <100.00%> (+0.04%) ⬆️
storage/src/mmr/mem.rs 93.03% <100.00%> (+0.03%) ⬆️
storage/src/adb/any/fixed/ordered.rs 96.04% <37.50%> (-0.54%) ⬇️
storage/src/adb/current/mod.rs 80.43% <72.34%> (-6.53%) ⬇️
storage/src/adb/current/ordered.rs 98.29% <98.29%> (ø)

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 2dd0dae...ca42d14. Read the comment docs.

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

@roberto-bayardo roberto-bayardo marked this pull request as ready for review October 14, 2025 02:14
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.

1 participant