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

change(consensus): Require that coinbase transactions balance exactly after NU6 activation #8727

Merged
merged 41 commits into from
Aug 8, 2024

Conversation

arya2
Copy link
Contributor

@arya2 arya2 commented Jul 29, 2024

Motivation

We want to check that coinbase transaction values balance exactly after NU6 activation.

Closes #8696.

Depends-On: #8694.

Specifications & References

https://zips.z.cash/draft-hopwood-coinbase-balance

Solution

  • Updates the relevant check in block::check::subsidy_is_valid()

Tests

Updates an acceptance test to check that blocks are rejected when their coinbase transaction doesn't balance exactly.

PR Author's Checklist

  • The PR name will make sense to users.
  • The PR provides a CHANGELOG summary.
  • The solution is tested.
  • The documentation is up to date.
  • The PR has a priority label.

PR Reviewer's Checklist

  • The PR Author's checklist is complete.
  • The PR resolves the issue.

arya2 added 25 commits July 25, 2024 16:46
…tructs, splits them into pre/post NU6 funding streams, and adds them as a field on `testnet::Parameters`
…onversion logic with constraints.

Minor refactors
…red Testnets, but that being okay since configured testnet parameters are checked when they're being built
…ams, updates the `miner_fees_are_valid()` and `subsidy_is_valid()` functions to check that the deferred pool contribution is valid and that there are no unclaimed block subsidies after NU6 activation, and adds some TODOs
…too, adds Mainnet/Testnet NU6 activation heights, fixes lints/compilation issue
…est_funding_stream_values()` to use a configured testnet with the post-NU6 Mainnet funding streams height range
@arya2 arya2 added A-consensus Area: Consensus rule updates NU-6 Network Upgrade: NU6 specific tasks P-Medium ⚡ labels Jul 29, 2024
@arya2 arya2 self-assigned this Jul 29, 2024
@arya2 arya2 requested a review from a team as a code owner July 29, 2024 22:17
@arya2 arya2 force-pushed the coinbase-should-balance-exactly branch from c45fbd4 to 993e915 Compare July 29, 2024 22:20
@arya2 arya2 linked an issue Jul 29, 2024 that may be closed by this pull request
mpguerra and others added 8 commits July 30, 2024 10:01
…s instead of an option of an iterator, updates a comment quoting the coinbase transaction balance consensus rule to note that the current code is inconsistent with the protocol spec, adds a TODO for updating the quote there once the protocol spec has been updated.
@arya2 arya2 force-pushed the coinbase-should-balance-exactly branch from 993e915 to 935efb9 Compare August 1, 2024 14:07
@arya2 arya2 force-pushed the coinbase-should-balance-exactly branch from 935efb9 to f308d49 Compare August 1, 2024 16:45
Base automatically changed from deferred-pool to main August 1, 2024 23:22
@oxarbitrage
Copy link
Contributor

please rebase to get rid of extra commits. thanks!

@mpguerra mpguerra requested a review from upbqdn August 6, 2024 08:44
@oxarbitrage
Copy link
Contributor

@Mergifyio refresh

Copy link
Contributor

mergify bot commented Aug 8, 2024

refresh

✅ Pull request refreshed

@mergify mergify bot merged commit 53b40d0 into main Aug 8, 2024
135 of 138 checks passed
@mergify mergify bot deleted the coinbase-should-balance-exactly branch August 8, 2024 17:12
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-trivial Category: A trivial change that is not worth mentioning in the CHANGELOG NU-6 Network Upgrade: NU6 specific tasks P-Medium ⚡
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement "Blocks should balance exactly" ZIP
4 participants