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 v5 transaction stubs #1822

Closed
4 of 9 tasks
teor2345 opened this issue Feb 26, 2021 · 0 comments · Fixed by #1824
Closed
4 of 9 tasks

Add v5 transaction stubs #1822

teor2345 opened this issue Feb 26, 2021 · 0 comments · Fixed by #1824
Assignees
Labels
A-consensus Area: Consensus rule updates A-rust Area: Updates to Rust code C-enhancement Category: This is an improvement NU-5 Network Upgrade: NU5 specific tasks
Milestone

Comments

@teor2345
Copy link
Contributor

teor2345 commented Feb 26, 2021

Is your feature request related to a problem? Please describe

Network Upgrade 5 introduces a new transaction version. Zebra needs to support that transaction version.

The draft ZIP isn't available yet:

But there is a draft spec for the transaction format at: https://raw.githubusercontent.com/daira/zips/orchard-circuit/protocol/orchard.pdf

So for now we just want to create a placeholder enum variant.

Describe the solution you'd like

Transaction variant

Serialization

Suggestion - just do something simple like:

  1. choose a random length between 0 and 20
  2. fill it with random bytes

We'll rewrite it properly later.

Validation

Placeholders

  • If a V5 transaction is used anywhere else, panic using unimplemented!("v5 transaction")

Describe alternatives you've considered

We could try to implement the whole v5 transaction format in the same PR, but that's a lot of work.

Additional context

This is just a stub that lets us start work on v5 transactions.

Follow Up

Once #1797 merges:

  • Reject V5 transactions during transaction validation if the network upgrade is Canopy or earlier
  • If the network upgrade is NU5 or later, panic using unimplemented!("v5 transaction")
  • test that the transaction validator rejects v5 transactions before NU5, and panics after NU5 (using #[should_panic])

Suggestion: add an allows_v5_transactions() -> bool method on NetworkUpgrade

Implement the v5 transaction format based on the draft spec: https://raw.githubusercontent.com/daira/zips/orchard-circuit/protocol/orchard.pdf

@teor2345 teor2345 added A-consensus Area: Consensus rule updates A-rust Area: Updates to Rust code C-enhancement Category: This is an improvement S-needs-triage Status: A bug report needs triage NU-5 Network Upgrade: NU5 specific tasks P-Medium labels Feb 26, 2021
@mpguerra mpguerra added this to the 2021 Sprint 4 milestone Feb 26, 2021
@mpguerra mpguerra removed the S-needs-triage Status: A bug report needs triage label Mar 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-rust Area: Updates to Rust code C-enhancement Category: This is an improvement NU-5 Network Upgrade: NU5 specific tasks
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants