Skip to content

feat(dursto): implement FromProof for Database#1077

Merged
victor-dumitrescu merged 1 commit into
mainfrom
vdum/database_from_proof
Jun 1, 2026
Merged

feat(dursto): implement FromProof for Database#1077
victor-dumitrescu merged 1 commit into
mainfrom
vdum/database_from_proof

Conversation

@victor-dumitrescu
Copy link
Copy Markdown
Contributor

@victor-dumitrescu victor-dumitrescu commented Jun 1, 2026

What

Implements FromProof for Database<KV, Verify>.

Why

Needed in order to expose proof verification

How

This also required implementing FromProof for MerkleLayer and its inner Tree<VerifyNodeId>. The latter implementations are mostly based on the MerkleLayer<KV, Verify>::from_proof test helper. This helper, along with the equivalent Database one, are now removed.

Manually Testing

make all

Tasks for the Author

  • Link all Linear issues related to this MR using magic words (e.g. part of, relates to, closes).
  • Eliminate dead code and other spurious artefacts introduced in your changes.
  • Document new public functions, methods and types.
  • Make sure the documentation for updated functions, methods, and types is correct.
  • Add tests for bugs that have been fixed.
  • Explain changes to regression test captures when applicable.
  • Write commit messages in agreement with our guidelines.
  • Self-review your changes to ensure they are high-quality.
  • Complete all of the above before assigning this MR to reviewers.

@codecov
Copy link
Copy Markdown

codecov Bot commented Jun 1, 2026

Codecov Report

❌ Patch coverage is 74.28571% with 9 lines in your changes missing coverage. Please review.
✅ Project coverage is 90.08%. Comparing base (1f2991f) to head (67ce8f1).

Files with missing lines Patch % Lines
durable-storage/src/avl/tree.rs 44.44% 3 Missing and 2 partials ⚠️
durable-storage/src/merkle_layer.rs 83.33% 0 Missing and 3 partials ⚠️
durable-storage/src/database.rs 75.00% 0 Missing and 1 partial ⚠️

❌ Your patch check has failed because the patch coverage (74.28%) is below the target coverage (80.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1077      +/-   ##
==========================================
- Coverage   90.12%   90.08%   -0.04%     
==========================================
  Files         130      130              
  Lines       28337    28350      +13     
  Branches    28337    28350      +13     
==========================================
+ Hits        25539    25540       +1     
- Misses       2040     2047       +7     
- Partials      758      763       +5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@victor-dumitrescu victor-dumitrescu marked this pull request as ready for review June 1, 2026 12:27
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 1, 2026

Benchmark results for revision e6fecd8:

Metric Duration TPS
Mean 1.514437052s 26.413
Worst 1.530784718s 26.130
Best 1.497305697s 26.715
Standard Deviation ±7.49263ms ±0.131
Full results
Run Transfers Duration TPS
1 40 1.530784718s 26.130
2 40 1.512537285s 26.446
3 40 1.502415063s 26.624
4 40 1.518808515s 26.336
5 40 1.51239673s 26.448
6 40 1.51741888s 26.361
7 40 1.518775797s 26.337
8 40 1.506204766s 26.557
9 40 1.510583884s 26.480
10 40 1.508369327s 26.519
11 40 1.50619667s 26.557
12 40 1.519295511s 26.328
13 40 1.517089734s 26.366
14 40 1.515650834s 26.391
15 40 1.522677853s 26.270
16 40 1.515290616s 26.398
17 40 1.517034164s 26.367
18 40 1.521857311s 26.284
19 40 1.497305697s 26.715
20 40 1.518047686s 26.350

Compare the results above with those for the default branch.

Copy link
Copy Markdown
Contributor

@emturner emturner left a comment

Choose a reason for hiding this comment

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

After investigating also, I suspect that this won't quite work, as the stream deserialisers don't allow capturing the owned proof.

I have a follow-up, to tackle this. The simplest way forward is to just deserialise twice: once to get the in-memory proof tree, the second time to allow the capturing to work.

We should investigate eventually, how to do capturing for stream deserialisers too.

Base automatically changed from vdum/rv-982 to main June 1, 2026 15:04
Copy link
Copy Markdown
Contributor

@emturner emturner left a comment

Choose a reason for hiding this comment

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

Approving to unblock the octez integration plumbing (in combination with the produce proof MR)

@victor-dumitrescu victor-dumitrescu force-pushed the vdum/database_from_proof branch from 3683f58 to 42eb73c Compare June 1, 2026 15:33
Comment thread durable-storage/src/avl/tree.rs Outdated
@victor-dumitrescu victor-dumitrescu force-pushed the vdum/database_from_proof branch from 42eb73c to 67ce8f1 Compare June 1, 2026 16:36
@victor-dumitrescu victor-dumitrescu added this pull request to the merge queue Jun 1, 2026
Merged via the queue into main with commit 8c7cd1e Jun 1, 2026
9 of 10 checks passed
@victor-dumitrescu victor-dumitrescu deleted the vdum/database_from_proof branch June 1, 2026 18:30
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.

3 participants