feat(wasm-utxo): add Zcash NU7 consensus branch id - #420
Open
hrishikeshjain wants to merge 2 commits into
Open
hrishikeshjain wants to merge 2 commits into
hrishikeshjain wants to merge 2 commits into
Conversation
Zcash testnet activated NU7 at block 4,465,026 (ZIP-259), introducing consensus branch id 0x77190ad9. Per ZIP-2003, version 4 transactions become invalid once NU7 activates; only v5 (ZIP-225) and v6 (ZIP-229) remain valid. `NetworkUpgrade` stopped at Nu6_3, so `branch_id_for_height` resolved post-NU7 testnet heights to the NU6.3 branch id, and `new_at_height` went on to build a version 4 transaction regardless. Those signed and queued normally, then failed every broadcast with "transaction version 4 not supported by the network upgrade Nu7" and retried indefinitely (observed in sendq: 5 stuck TZEC sends, one retried ~750 times over ~7h). Adds the Nu7 entry and rejects a v4 build at or after NU7 activation, so the failure surfaces at build time instead of after signing. v6 (Ironwood) builds are unaffected and remain the valid path. NU7 has no assigned mainnet activation height yet (TBD in ZIP-259), so `UpgradeParams::mainnet_activation_height` becomes `Option<u32>`: an upgrade with no height on a network is never active there, leaving mainnet on NU6.3. The zebra parity test compares the field as an `Option`, so it starts failing the moment zebra publishes a height rather than silently drifting. Bumps the zebra-chain dev-dependency 11.2 -> 14.0: 11.2 carries Nu7 only as a test-only placeholder (0xfffffffe), so the parity tests can only check the real constants against 14. Adjusts the v6 zebra-oracle test for 14's API, which exposes ironwood actions as its own orchard release's `Action` type. Refs: SPT-483
The zebra-chain 11.2 -> 14 bump broke `cargo clippy --all-features`: halo2_proofs 0.3.2 does not compile with `multicore` off, and nothing was turning it on any more. orchard takes halo2 with default features disabled, so `multicore` never came from our own dependency edge. It was supplied by accident: zebra-chain 11.2 resolved to the same orchard 0.15 we use, and cargo unified its feature set with ours. zebra-chain 14 moved to orchard 0.16, so the two graphs no longer unify and our halo2 was left without rayon. Declare halo2_proofs as an optional dependency and have the `orchard-proving` feature enable `halo2_proofs/multicore` explicitly, so the proving build states the requirement itself instead of relying on a dev-dependency's resolution. Refs: SPT-483
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Zcash testnet activated NU7 at block 4,465,026 (ZIP-259), introducing consensus branch id
0x77190ad9. Per ZIP-2003, version 4 transactions become invalid once NU7 activates — only v5 (ZIP-225) and v6 (ZIP-229) remain valid.NetworkUpgradestopped atNu6_3, sobranch_id_for_heightresolved post-NU7 testnet heights to the NU6.3 branch id, andnew_at_heightwent on to build a version 4 transaction regardless. Those signed and queued normally, then failed every broadcast withtransaction version 4 not supported by the network upgrade Nu7and retried indefinitely — observed in sendq: 5 stuck TZEC sends, one retried ~750 times over ~7h.This is the
wasm-utxocounterpart of BitGoJS#9896 (approved, then closed —utxo-libis deprecated, per Veetrag in thread).Changes
src/zcash/mod.rs—Nu7variant (branch id0x77190ad9, testnet height4465026), wired intoALL,params(), and both zebra parity maps.mainnet_activation_height→Option<u32>— NU7's mainnet height is TBD in ZIP-259. An upgrade with no assigned height on a network is never active there, so mainnet stays on NU6.3 and is unaffected by this PR.new_at_heightrejects v4 at/after NU7 — this path only ever builds v4/Sapling, so at those heights it has no valid output to produce. Failing at build time beats signing something that can never broadcast. v6 (Ironwood) builds are untouched and remain the valid path.11.2→14.0— 11.2 carriesNu7only as a test-only placeholder (0xfffffffe); 14.0 is the first release with the real constants, so the parity tests check our entry against upstream rather than against a value I typed in. Also adjusts the v6 zebra-oracle test for 14's API, which exposes ironwood actions as its own orchard release'sAction.Verification
cargo test --lib— 635 passed, 0 failed, 94 ignored.parity_with_zebra_chaintests pass against zebra 14's real NU7 constants — branch id and testnet activation height are cross-checked against upstream, not hardcoded here.test_mainnet_heights_match_zebranow compares asOption, so it starts failing the moment zebra publishes a mainnet NU7 height instead of silently drifting.test_new_zcash_at_height_rejects_v4_after_nu7_on_testnetcovers the exact cutover:nu7 - 1still builds,nu7and beyond are refused, mainnet unaffected.falseand the test failed withv4 must be refused at or after NU7 activation; restored, passes.cargo clippy --all-targets -- -D warningsclean against this diff. One pre-existingchunks_exactlint insrc/p2mr/mod.rs(untouched here) fires on local rustc 1.99 but not on CI's pinned toolchain.Scope — please read before assuming TZEC sends resume
This stops the bleeding; it does not by itself make TZEC sends work again.
ZcashBitGoPsbtonly builds v4/Sapling, and there is no v5 (ZIP-225) codec in this repo — BitGoJS#9896 got v5 for free fromutxo-lib, which is why it was a ~30-line change there and is not here. After this PR, post-NU7 testnet sends fail loudly at build time instead of silently producing unbroadcastable transactions.For sends to actually succeed, one of:
@veetragjain — which did you have in mind? Happy to take the follow-up either way.
Also note: the 5 TZEC sendq entries stuck since the bug were signed as v4 and can never validate, even with this fix — they need purging and re-sending.
Refs: SPT-483