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

Add semantic block validation during the ZIP-212 grace period after Canopy activation #8430

Closed
arya2 opened this issue Apr 23, 2024 · 3 comments · Fixed by #8629
Closed

Add semantic block validation during the ZIP-212 grace period after Canopy activation #8430

arya2 opened this issue Apr 23, 2024 · 3 comments · Fixed by #8629
Assignees
Labels
A-consensus Area: Consensus rule updates C-tech-debt Category: Code maintainability issues C-testing Category: These are tests NU-4 Canopy Network Upgrade: Canopy specific tasks P-Medium ⚡

Comments

@arya2
Copy link
Contributor

arya2 commented Apr 23, 2024

Motivation

We want to fully validate Canopy blocks and abide by the ZIP-212 grace period where note plaintext lead bytes are allowed to be either 0x01 or 0x02 so that Regtest is as close to the Mainnet consensus rules as possible. Prior to Canopy activation those lead bytes must be 0x01, and after the grace period, they must be 0x02.

This rule only applies to nodes and not wallets, and librustzcash may only allow for lead bytes of 0x02 after Canopy activation, so Zebra is currently mandating checkpoint validation until the end of the ZIP-212 grace period.

Possible Design

The grace period after Canopy should only apply until the next network upgrade (NU5) is activated, so it should be the lesser of Canopy Activation Height + ZIP_212_DURATION or NU5 Activation Height

Testing

  • Ensure that Zebra can validate transactions with note plaintexts that have lead bytes of 0x01 as well as 0x02 during the ZIP-212 grace period
  • Ensure that Zebra will only validate transactions with note plaintexts that have lead bytes of 0x02 after the ZIP-212 grace period
@arya2 arya2 added A-consensus Area: Consensus rule updates NU-4 Canopy Network Upgrade: Canopy specific tasks C-testing Category: These are tests C-tech-debt Category: Code maintainability issues P-Medium ⚡ labels Apr 23, 2024
@arya2
Copy link
Contributor Author

arya2 commented May 1, 2024

Both the latest version of zcash_primitives and the version Zebra currently uses (0.13.0) allow for plaintext lead bytes of 0x01 or 0x02 during the grace period, see:

@arya2
Copy link
Contributor Author

arya2 commented May 3, 2024

Let's wait until Zebra is using zcash_primitives v0.14.0 and then pass Zip212Enforcement::On in the call to try_sapling_note_decryption() in zcash_note_encryption

@mpguerra
Copy link
Contributor

depends-on: #8540

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 C-tech-debt Category: Code maintainability issues C-testing Category: These are tests NU-4 Canopy Network Upgrade: Canopy specific tasks P-Medium ⚡
Projects
Archived in project
2 participants