Conversation
1945f6f to
da9bc7d
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #960 +/- ##
=======================================
Coverage 89.70% 89.71%
=======================================
Files 110 110
Lines 22136 22136
Branches 22136 22136
=======================================
+ Hits 19857 19859 +2
+ Misses 1884 1882 -2
Partials 395 395 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
8799a96 to
9646f78
Compare
Adds implementations of `Resolver` and `FromProof` for IDs used for implementing `Verify` mode for the Merkle layer.
9646f78 to
1134f2a
Compare
|
Benchmark results for revision b182284:
Full results
Compare the results above with those for the default branch. |
|
|
||
| /// Identifier for a tree resolved in [`Verify`] mode. | ||
| pub enum VerifyTreeId { | ||
| Present(Tree<Arc<VerifyNodeId>>), |
There was a problem hiding this comment.
Let's keep the reference counting in the node/node ID, like LazyNodeId and ArcNodeId.
| } | ||
| } | ||
|
|
||
| impl Resolver<VerifyTreeId, Tree<Arc<VerifyNodeId>>> for VerifyResolver { |
There was a problem hiding this comment.
Something doesn't add up here. Resolving VerifyTreeId -> Tree<Arc<VerifyNodeId>> implies that Arc<VerifyNodeId> is a node ID, but it's not. The Arc prevents it.
| } | ||
| } | ||
|
|
||
| /// Identifier for a node resolved in [`Verify`] mode. |
There was a problem hiding this comment.
perhaps worth a comment about why Absent doesn't exist
| let (ctx, present) = ctx.next_branch_with(|proof| proof.into_leaf::<bool>())?; | ||
| match present { | ||
| Partial::Present(true) => { | ||
| let (ctx, node_id) = ctx.next_branch_with(|proof| { | ||
| let suspended = VerifyNodeId::from_proof(proof)?; | ||
| Ok(suspended.map(Arc::new)) | ||
| })?; | ||
| ctx.done(VerifyTreeId::Present(Tree::from(Some(node_id)))) | ||
| } | ||
| Partial::Present(false) => ctx.done(VerifyTreeId::Present(Tree::default())), | ||
| // SAFETY: called only in `Verify` mode | ||
| Partial::Blinded(_) | Partial::Absent => unsafe { not_found() }, | ||
| } |
There was a problem hiding this comment.
This portion should be done by the parser (not necessarily FromProof) for Tree. I think the VerifyTreeId type doesn't need to implement on behalf of Tree.
Closes RV-949
What
Adds support for parsing MAVL tree proofs for
VerifymodeWhy
This is needed as part of supporting
Verifymode in the Merkle layer.How
VerifyNodeId/VerifyTreeIdResolverfor eachManually Testing
Tasks for the Author