Skip to content
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

ZIP 225 & ZIP 244 #375

Merged
merged 26 commits into from
Jun 8, 2021
Merged

ZIP 225 & ZIP 244 #375

merged 26 commits into from
Jun 8, 2021

Conversation

nuttycom
Copy link
Contributor

No description provided.

@nuttycom
Copy link
Contributor Author

nuttycom commented May 4, 2021

A note to reviewers: This PR is best viewed hiding whitespace changes.

@nuttycom nuttycom force-pushed the feature/zip-225 branch 3 times, most recently from 39770cf to aa060fa Compare May 6, 2021 15:42
@nuttycom nuttycom marked this pull request as draft May 7, 2021 20:14
Copy link

@conradoplg conradoplg left a comment

Choose a reason for hiding this comment

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

Found a possible personalization field mismatch

zcash_primitives/src/transaction/txid.rs Outdated Show resolved Hide resolved
Copy link
Contributor

@therealyingtong therealyingtong left a comment

Choose a reason for hiding this comment

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

Flushing comments from partial review.

zcash_primitives/src/transaction/mod.rs Outdated Show resolved Hide resolved
h.finalize()
}

pub fn to_txid(
Copy link
Contributor

Choose a reason for hiding this comment

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

Could to_txid() be a method on TransactionData?

zcash_primitives/src/consensus.rs Outdated Show resolved Hide resolved
zcash_primitives/Cargo.toml Outdated Show resolved Hide resolved
zcash_primitives/Cargo.toml Outdated Show resolved Hide resolved
zcash_primitives/src/transaction/builder.rs Outdated Show resolved Hide resolved
zcash_primitives/src/transaction/mod.rs Outdated Show resolved Hide resolved
@nuttycom nuttycom force-pushed the feature/zip-225 branch 2 times, most recently from 3450de4 to 239b125 Compare May 14, 2021 15:37
@nuttycom nuttycom marked this pull request as ready for review May 14, 2021 15:38
Co-authored-by: str4d <jack@electriccoin.co>
@nuttycom nuttycom force-pushed the feature/zip-225 branch 2 times, most recently from ecc9b68 to 8a9eda7 Compare June 5, 2021 16:18
Co-authored-by: str4d <jack@electriccoin.co>
@nuttycom nuttycom force-pushed the feature/zip-225 branch 2 times, most recently from 54dce0e to 1d7c6ea Compare June 5, 2021 16:42
Copy link
Contributor

@str4d str4d left a comment

Choose a reason for hiding this comment

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

utACK 1d7c6ea9f9a60a564a7ead4cab9b9e6b55aef241

@@ -0,0 +1,182 @@
use std::io::Write;
Copy link
Contributor

Choose a reason for hiding this comment

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

I have not checked this file either.

Copy link
Contributor

@daira daira left a comment

Choose a reason for hiding this comment

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

Partial review. I commented which files I have not checked.

nuttycom and others added 3 commits June 7, 2021 09:27
Co-authored-by: str4d <jack@electriccoin.co>
Co-authored-by: str4d <jack@electriccoin.co>
unauthed_tx,
let transparent_bundle = unauthed_tx.transparent_bundle.clone().map(|b| {
b.apply_signatures(
#[cfg(feature = "transparent-inputs")]
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this be a separate method for the case with transparent inputs, rather than a method with feature-conditional arguments?

Copy link
Contributor

Choose a reason for hiding this comment

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

That's going to happen in a subsequent PR, when the Orchard builder is integrated.

if actions_without_auth.is_empty() {
Ok(None)
} else {
let flags = orchard_serialization::read_flags(&mut reader)?;
Copy link
Contributor

Choose a reason for hiding this comment

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

The implementation of read_flags enforces that unused bits are zero. This is as intended but was ambiguous in the spec. The spec has been clarified in version 2021.2.4.

) -> TransactionData<Authorized> {
TransactionData {
version,
consensus_branch_id,
lock_time,
expiry_height: expiry_height.into(),
transparent_bundle,
sprout_bundle: None,
Copy link
Contributor

Choose a reason for hiding this comment

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

I know we don't support creating v4 transactions with a Sprout bundle, but we do support reading them, so it should probably be prop-tested. Please file a ticket. (Does not block this PR.)

const ZCASH_SAPLING_SIGS_HASH_PERSONALIZATION: &[u8; 16] = b"ZTxAuthSapliHash";
const ZCASH_ORCHARD_SIGS_HASH_PERSONALIZATION: &[u8; 16] = b"ZTxAuthOrchaHash";
#[cfg(feature = "zfuture")]
const ZCASH_TZE_WITNESSES_HASH_PERSONALIZATION: &[u8; 16] = b"ZTxAuthTZE__Hash";
Copy link
Contributor

@daira daira Jun 8, 2021

Choose a reason for hiding this comment

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

I checked all of the non-TZE personalizations against the current version of ZIP 244.

Copy link
Contributor

@daira daira left a comment

Choose a reason for hiding this comment

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

utACK with minor comments.

Co-authored-by: Daira Hopwood <daira@jacaranda.org>
Copy link
Contributor

@str4d str4d left a comment

Choose a reason for hiding this comment

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

utACK eb3d01a. I confirmed it addressed @daira's comments.

@str4d str4d merged commit 0bfd1f7 into zcash:master Jun 8, 2021
Copy link
Contributor

@daira daira left a comment

Choose a reason for hiding this comment

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

Post-hoc ACK eb3d01a

@nuttycom nuttycom deleted the feature/zip-225 branch June 12, 2021 21:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-committed Status: Planned work in a sprint
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants