Skip to content

Enhance and cleanup ivk-to-bytes-visibility-downgrade branch#81

Merged
PaulLaux merged 50 commits intozsa1from
ivk-to-bytes-visibility-downgrade-with-burn-valid
Oct 4, 2023
Merged

Enhance and cleanup ivk-to-bytes-visibility-downgrade branch#81
PaulLaux merged 50 commits intozsa1from
ivk-to-bytes-visibility-downgrade-with-burn-valid

Conversation

@dmidem
Copy link

@dmidem dmidem commented Aug 23, 2023

This pull request includes the changes made in the ivk-to-bytes-visibility-downgrade branch, which serves as the parent branch for this ivk-to-bytes-visibility-downgrade-with-burn-valid branch. Additionally, it incorporates some extra enhancements and cleanups. Also, it relocates the burn_validation.rs module from the librustzcash repository to this orchard repository. While the burn_validation.rs module is not currently in use, it may potentially be valuable for invocation from Zebra project code.

alexeykoren and others added 25 commits June 26, 2023 09:14
…undle-in-v5-vector-serialization-with-burn-valid branch
@dmidem dmidem requested review from PaulLaux and alexeykoren August 23, 2023 16:11
@QED-it QED-it deleted a comment from what-the-diff bot Aug 24, 2023
Copy link
Collaborator

@PaulLaux PaulLaux left a comment

Choose a reason for hiding this comment

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

Good overall, added comments and questions.

Cargo.toml Outdated
dashmap = ">= 5.4, <5.5"
inferno = ">= 0.11, < 0.11.15"
pprof = { version = "0.9", features = ["criterion", "flamegraph"] } # MSRV 1.56
backtrace = "=0.3.67" # Last version required rust 1.65
Copy link
Collaborator

Choose a reason for hiding this comment

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

Let's update to rust 1.65 as discussed with the zcash team. Remove this after update.

Copy link
Author

Choose a reason for hiding this comment

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

Done, but I had to add two new pins because even Rust 1.65 can't compile the latest version:

1. Pinned blake2b_simd to "1.0.1" as its latest version requires Rust 1.66.
2. Pinned clap to "4.2.0" as its latest version requires Rust 1.70.

Additionally, I've added a couple of comments with "FIXME" to draw your attention to the lines that were updated in Cargo.toml in the latest version of Orchard from the Zcash team.

Copy link
Author

Choose a reason for hiding this comment

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

Also, I've updated the dependencies in Cargo.toml to align with the latest changes from the Zcash team's upstream Cargo.toml.

@@ -0,0 +1,146 @@
//! Validating burn operations on asset bundles.
//!
//! The module provides a function `validate_bundle_burn` that can be used to validate a burn for a bundle.
Copy link
Collaborator

Choose a reason for hiding this comment

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

"...to validate the burn values for the bundle."

Copy link
Author

Choose a reason for hiding this comment

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

Done.

src/issuance.rs Outdated
Comment on lines +497 to +500
let bounds = (
self.actions.dynamic_usage_bounds(),
self.ik.dynamic_usage_bounds(),
self.authorization.dynamic_usage_bounds(),
Copy link
Collaborator

Choose a reason for hiding this comment

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

Same, replace tuple with short names for the variables.

Copy link
Author

Choose a reason for hiding this comment

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

Done.

// FIXME: take/save finalization set from/to the global state
let finalized = HashSet::<AssetBase>::new();

// FIXME: process resulting supply_info
Copy link
Collaborator

Choose a reason for hiding this comment

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

Same, Add a way to extract the resulting supply_info param.

Comment on lines +28 to +29
// FIXME: take/save finalization set from/to the global state
let finalized = HashSet::<AssetBase>::new();
Copy link
Collaborator

Choose a reason for hiding this comment

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

We need a way to pass the finilized HashSet by the caller. Please add a way to transfer the parameter.
We can call it with an empty Set while global state is not implemented.

Copy link
Author

Choose a reason for hiding this comment

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

Based on our latest discussion, I've reverted the changes related to BatchValidators as they are not used in Zebra: I have removed the modifications I made to the Orchard batch validator and completely removed Issuance batch validator I created before.

Copy link
Collaborator

@PaulLaux PaulLaux left a comment

Choose a reason for hiding this comment

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

Very nice, one suggestion about number of lines. If this is not possible, let's merge the way it is.

@dmidem dmidem changed the title BatchValidator updates and cleanup Enhance and cleanup ivk-to-bytes-visibility-downgrade branch Sep 21, 2023
src/note.rs Outdated
Comment on lines +310 to +321
impl DynamicUsage for Note {
#[inline(always)]
fn dynamic_usage(&self) -> usize {
0
}

#[inline(always)]
fn dynamic_usage_bounds(&self) -> (usize, Option<usize>) {
(0, Some(0))
}
}

Copy link
Collaborator

Choose a reason for hiding this comment

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

remove DynamicUsage across the entire PR if not needed in zebra

@PaulLaux PaulLaux self-requested a review October 3, 2023 20:49
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