Skip to content

[bug] Dev fee incorrectly includes transaction fees (should be subsidy only) #218

@cdonnachie

Description

@cdonnachie

Bug Report

Current behavior:
The dev fee is currently being calculated as a percentage of (block subsidy + transaction fees) instead of being calculated from the block subsidy only.

For example, with a 5% dev fee:

  • Block subsidy: 625 AVN
  • Transaction fees: 0.1 AVN
  • Expected dev fee (5% of subsidy only): 31.25 AVN
  • Actual dev fee paid: 31.255 AVN

This indicates the formula is effectively:

devFee = (subsidy + fees) * 0.05

instead of:

devFee = subsidy * 0.05

As a result, a portion of the transaction fees (in this example, 0.005 AVN) is being diverted to the dev address instead of going entirely to the miner.

Expected behavior
The dev fee should be calculated only from the block subsidy, and all transaction fees should go to the miner.

Expected behavior for the same example:

  • Block subsidy: 625 AVN
  • Transaction fees: 0.1 AVN
  • Dev fee (5% of subsidy only): 31.25 AVN
  • Miner should receive: subsidy - devFee + fees = 625 - 31.25 + 0.1 = 593.85 AVN

No portion of the transaction fees should be included in the dev fee calculation.

Steps to reproduce:

  1. Mine a block (or observe a freshly mined block) with non-zero transaction fees.
  2. Note the:
    • Block subsidy,
    • Total transaction fees in the block,
    • Outputs in the coinbase transaction (dev address vs miner).
  3. Compare the actual dev fee value with:
    • subsidy * 0.05 (expected), and
    • (subsidy + fees) * 0.05 (current behavior).
  4. You will see the dev fee matches (subsidy + fees) * 0.05, meaning it includes a percentage of transaction fees.

Screenshots
N/A – issue is visible via coinbase transaction outputs and fee/subsidy calculations

The main issue is that the dev fee calculation is including transaction fees instead of being strictly based on the block subsidy.

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingconsensusConsensus change

Type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions