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

Update zcash_script to support V5 transactions #2328

Closed
jvff opened this issue Jun 17, 2021 · 0 comments · Fixed by #2825
Closed

Update zcash_script to support V5 transactions #2328

jvff opened this issue Jun 17, 2021 · 0 comments · Fixed by #2825
Assignees
Labels
A-consensus Area: Consensus rule updates A-dependencies Area: Dependency file updates NU-5 Network Upgrade: NU5 specific tasks

Comments

@jvff
Copy link
Contributor

jvff commented Jun 17, 2021

Motivation

With the NU5 activation, a new transaction format was introduced (V5). Zebra is currently in the process of adding support for verifying those transactions (#1981). To validate transparent inputs and outputs, Zebra uses the zcash_script crate. However, it seems that it doesn't yet support V5 transactions, because it segfaults with a V5 test case.

Specifications

The new transaction encoding is specified here.

Designs

Solution

Once the zcash_script issue is closed, update Zebra to use the new version.

The segmentation fault itself could be caused by calling zcash_script_verify_precomputed with a nullptr returned when zcash_script_new_precomputed_tx failed to deserialize the V5 transaction, so it would be good to check for null after creating the precomputed transaction and returning an error to avoid reaching the segfault.

https://github.com/ZcashFoundation/zebra/blob/main/zebra-script/src/lib.rs#L80-L82

Alternatives

We'll need V5 transaction validation for the NU5 activation, and updating zcash_script is likely the simplest solution. An alternative could be to write our own verifier, but that will likely require too much effort and time.

Related Work

Issue #21 in thezcash_script repository tracks the support for V5.

@jvff jvff added C-enhancement Category: This is an improvement S-needs-triage Status: A bug report needs triage labels Jun 17, 2021
@mpguerra mpguerra added this to the 2021 Sprint 12 milestone Jun 17, 2021
@jvff jvff self-assigned this Jun 17, 2021
@mpguerra mpguerra removed the S-needs-triage Status: A bug report needs triage label Jun 21, 2021
@dconnolly dconnolly added A-consensus Area: Consensus rule updates A-dependencies Area: Dependency file updates NU-5 Network Upgrade: NU5 specific tasks and removed C-enhancement Category: This is an improvement labels Oct 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-consensus Area: Consensus rule updates A-dependencies Area: Dependency file updates NU-5 Network Upgrade: NU5 specific tasks
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants