Skip to content

Comments

fix: Subtract Founders' Reward from block subsidy#10338

Open
upbqdn wants to merge 2 commits intomainfrom
fix-subsidy
Open

fix: Subtract Founders' Reward from block subsidy#10338
upbqdn wants to merge 2 commits intomainfrom
fix-subsidy

Conversation

@upbqdn
Copy link
Member

@upbqdn upbqdn commented Feb 23, 2026

Motivation

Solution

  • Subtract the founders' reward from the block subsidy when calculating the miner subsidy.

Tests

  • No new tests.

AI Disclosure

  • No AI tools were used in this PR
  • AI tools were used:

PR Checklist

  • The PR name is suitable for the release notes.
  • The PR follows the contribution guidelines.
  • This change was discussed in an issue or with the team beforehand.
  • The solution is tested.
  • The documentation and changelogs are up to date.

Comment on lines +482 to +489
founders_reward: Amount<NonNegative>,
funding_streams: &HashMap<FundingStreamReceiver, Amount<NonNegative>>,
) -> Result<Amount<NonNegative>, amount::Error> {
let total_funding_stream_amount: Result<Amount<NonNegative>, _> =
funding_stream_values(height, network, expected_block_subsidy)?
.values()
.sum();
let funding_streams_sum = funding_streams
.values()
.sum::<Result<Amount<NonNegative>, _>>()?;

expected_block_subsidy - total_funding_stream_amount?
expected_block_subsidy - founders_reward - funding_streams_sum
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a particular reason why founders_rewards and funding_streams are arguments instead of being computed inside the function?

My main reason for asking is that this is breaking API change which will require major bumps in most Zebra crates, so it would be better to avoid it unless absolutely necessary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C-bug Category: This is a bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: getblocksubsidy does not match zcashd for older blocks

2 participants