Support generating V4 coinbase transactions
Motivation
PR #9627 removed support for V4 coinbase transactions. This PR restores it, and it also replaces #9639.
Solution
Zebra used to decide whether to generate a V4 or V5 coinbase tx based on the debug_like_zcashd config option. If the option was true, Zebra would generate a V4 tx, and V5 otherwise.
With this PR, Zebra determines the version based on the network and height.
Tests
I adjusted affected tests so that the issue outlined in the description of #9639 is of no relevance anymore.
PR Checklist
- [x] The PR name is suitable for the release notes.
- [x] The solution is tested.
- [x] The documentation is up to date.
This has some merge conflicts, and a test is still hanging due to this issue.
I rebased on main and force-pushed.
This functionality is needed for the RPC python framework to work. Otherwise block submission will fail with:
2025-07-07T15:18:43.207974Z INFO zebra_rpc::methods: submit block failed verification error=Ok(Block { source: Transaction(UnsupportedByNetworkUpgrade(5, Canopy)) }) block_hash=block::Hash("a43857985cd9c050b8063dd1816e17aa02c2416ae7f8d351d4ac3ea0b95c1190") height=Height(1)
I don’t think we’re fully ready yet, but this test, or at least part of it, could be ported to Zebra to test shielded coinbase functionality.
I’ve opened an issue to track that: https://github.com/ZcashFoundation/zebra/issues/9690
This pull request has been removed from the queue for the following reason: checks failed.
The merge conditions cannot be satisfied due to failing checks:
- 🛑 Unit tests / Test Zebra Docker configurations / Test Testnet config
- ☑️ Integration tests / Generate checkpoints testnet / Run checkpoints-testnet test
You can check the last failing draft PR here: #9696.
You may have to fix your CI before adding the pull request to the queue again.
If you update this pull request, to fix the CI, it will automatically be requeued once the queue conditions match again.
If you think this was a flaky issue instead, you can requeue the pull request, without updating it, by posting a @mergifyio requeue comment.
@mergifyio requeue
requeue