-
Notifications
You must be signed in to change notification settings - Fork 112
[storage/adb/current] adb::ordered::current (provides exclusion proof support) #1799
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Deploying monorepo with
|
| Latest commit: |
fbd27e0
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://fbf1fce3.monorepo-eu0.pages.dev |
| Branch Preview URL: | https://exclusion-proof-db.monorepo-eu0.pages.dev |
daced5e to
5ba7fc9
Compare
c05e8b7 to
0f4496f
Compare
264d8d8 to
475173b
Compare
51d13da to
c2aff73
Compare
2f0cbcb to
49a8525
Compare
There was a problem hiding this 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::orderedmodule 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.
49a8525 to
ca42d14
Compare
044c9c7 to
289033a
Compare
769b9b1 to
9c46a54
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
very very small nits
| } | ||
|
|
||
| /// Whether the span defined by `span_start` and `span_end` contains `key`. | ||
| pub fn span_contains(span_start: &K, span_end: &K, key: &K) -> bool { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice standalone function ❤️
| c.bench_function( | ||
| &format!( | ||
| "{}/elements={} operations={}, keyspace={}", | ||
| "{}/elements={} operations={}, variant={}", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should put variant first in this list
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done, though I didn't reorder the loop vars. lmk if you need that changed too. I kind of like variant last in the loop vars since you see the performance impact of each variation across the same params.
| /// # Panics | ||
| /// | ||
| /// Panics if there is not at least one active operation above the inactivity floor. | ||
| async fn raise_floor(&mut self) -> Result<(), Error> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking forward to seeing this ported to the other DBs ❤️
| } | ||
|
|
||
| async fn update(&mut self, key: K, value: V) -> Result<(), crate::store::Error> { | ||
| self.any.update(key, value).await.map_err(Into::into) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for clarifying!
|
from the LLMs: |
Not an issue. Recovery ensures the last operation (if any exists) is always a commit 👍 Went ahead and added an assertion check to confirm that. |
Codecov Report❌ Patch coverage is
@@ Coverage Diff @@
## main #1799 +/- ##
==========================================
+ Coverage 92.39% 92.44% +0.04%
==========================================
Files 303 304 +1
Lines 79937 81445 +1508
==========================================
+ Hits 73861 75294 +1433
- Misses 6076 6151 +75
... and 19 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
Resolves #1409