-
Notifications
You must be signed in to change notification settings - Fork 108
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
Parse ConsensusBranchId into NetworkUpgrade for transaction v5 #2075
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's merge #2070 and all the PRs that depend on it, before we merge this PR, to avoid conflicts
Yea, i will rebase after that. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good.
There are a few places where we could use standard library functions to simplify the code, so we don't need to write tests.
I made all the changes except for the derive of Will rebase after the PR is re-reviewed by @teor2345 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's use a custom strategy to return arbitrary network upgrades with branch IDs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good now, I added a missing TODO comment.
I've set it to auto-merge after CI passes.
I merged the imports and moved code in the test module |
I think something is wrong. the utility functions and the new constant should be in https://github.com/ZcashFoundation/zebra/blob/main/zebra-chain/src/transaction/arbitrary.rs#L327 |
You're right, it looks like I did the merge wrong, and then auto-merge passed and merged the PR, even though it should have failed. I'll open a PR to fix it up, and a ticket to deal with the GitHub issue |
Also tweak a constant name, an import, and a comment.
Motivation
nConsensusBranchId
was added to the spec for transaction V5: https://github.com/zcash/zips/blob/master/zip-0225.rst#specificationWe need to add this to Zebra.
Solution
In this PR we are adding the field, the serialization and the arbitrary tests but we are not doing validation.
The code in this pull request has:
Review
@teor2345
Related Issues
This is part of #2066
Follow Up Work
Validation should be done to complete #2066 but we need #2070 merged first.
A conflict is expected after #2070 just because the
transaction_to_fake_v5
was moved.