[storage/qmdb/current] have current proof types implement codec#3717
Conversation
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
commonware-mcp | 19f1c7d | May 05 2026, 11:14 PM |
Benchmark resultsTip ✅ PASSED: No benchmark exceeded the regression threshold. Benchmark comparison table
Baseline commit(s): |
There was a problem hiding this comment.
Pull request overview
Adds commonware-codec serialization support to QMDB “current” proof structures so they can be shipped over the wire and round-tripped in tests.
Changes:
- Implement
Write,EncodeSize, andReadforRangeProof<F, D>with bounded decoding viaReadRangeExt. - Implement
Write,EncodeSize, andReadforOperationProof<F, D, N>(threading config to the embeddedRangeProof). - Add unit tests that round-trip encode/decode for both proof types.
Deploying monorepo with
|
| Latest commit: |
19f1c7d
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://22c6cefa.monorepo-eu0.pages.dev |
| Branch Preview URL: | https://codec-proofs.monorepo-eu0.pages.dev |
patrick-ogrady
left a comment
There was a problem hiding this comment.
we should better leverage codec
| Self::KeyValue(op_proof, update) => { | ||
| EXCLUSION_TAG_KEY_VALUE.write(buf); | ||
| op_proof.write(buf); | ||
| update.key.write(buf); |
There was a problem hiding this comment.
Is there a reason we don’t define write on update?
There was a problem hiding this comment.
AI slop, fixed.
| Self::Commit(op_proof, value) => { | ||
| EXCLUSION_TAG_COMMIT.write(buf); | ||
| op_proof.write(buf); | ||
| value.is_some().write(buf); |
There was a problem hiding this comment.
Option write is already supported by Codec!
| } | ||
| EXCLUSION_TAG_COMMIT => { | ||
| let op_proof = OperationProof::<F, D, N>::read_cfg(buf, max_digests)?; | ||
| let value = if bool::read(buf)? { |
There was a problem hiding this comment.
see comment about option support
| } | ||
| self.unfolded_prefix_peaks.write(buf); | ||
| self.partial_chunk_digest.is_some().write(buf); | ||
| if let Some(digest) = &self.partial_chunk_digest { |
There was a problem hiding this comment.
see comment about option support
|
Another finding: One unique actionable finding remained after deduplication: decoded |
Ah, this is dumb. N is controlled. |
| } | ||
|
|
||
| #[cfg(test)] | ||
| mod codec_tests { |
There was a problem hiding this comment.
I think this can just be part of tests?
| let value = Option::<V::Value>::read_cfg(buf, value_cfg)?; | ||
| Ok(Self::Commit(op_proof, value)) | ||
| } | ||
| _ => Err(commonware_codec::Error::Invalid( |
There was a problem hiding this comment.
I think there is an "InvalidEnum"
8abd15a to
c752eb4
Compare
ab849d8 to
638cb18
Compare
638cb18 to
e42644b
Compare
|
We should add conformance tests for these new proof types. |
|
|
This is fine since max-digests is generally around 64 -- hard to DoS with that few digests even if it is *N. I can document better. |
done |
What do we do in other proof decode functions? |
The other proof decoder only had one field of digests. |
469937c to
19f1c7d
Compare
|
Should fully unblock exoware! |
Codecov Report✅ All modified and coverable lines are covered by tests. @@ Coverage Diff @@
## main #3717 +/- ##
========================================
Coverage 95.83% 95.83%
========================================
Files 458 458
Lines 180650 180964 +314
Branches 4218 4218
========================================
+ Hits 173118 173430 +312
- Misses 6186 6187 +1
- Partials 1346 1347 +1
... and 3 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
Resolves: #3705