Skip to content

[Bug] Mining Calculator uses hardcoded average multiplier (1.5x) causing ~8-10% underreporting of earnings #7729

Description

@IcanBENCHurCAT

[Bug] Mining Calculator uses hardcoded average multiplier causing ~8-10% underreporting of earnings

Component

Other (Mining Earnings Calculator)

What happened?

The mining calculator at mining-calculator/index.html uses a hardcoded average multiplier of 1.5x to estimate network weight in two critical code paths:

  1. Preset miner count mode (line ~579): const avgMultiplier = 1.5; // Conservative average
  2. Sensitivity table (line ~627): const avgMultiplier = 1.5;

The actual average multiplier of the DEFAULT_NETWORK composition is 1.3625x (total weight 10.9 / 8 miners).

DEFAULT_NETWORK composition:

Hardware Multiplier Count Weight
POWER8 2.0x 1 2.0
G3 1.8x 1 1.8
Pentium 4 1.5x 1 1.5
Core 2 Duo 1.3x 1 1.3
Apple Silicon 1.15x 2 2.3
Modern x86 1.0x 2 2.0
Total 8 10.9

Actual average: 10.9 / 8 = 1.3625x

Expected behavior

The calculator should use the actual average multiplier from DEFAULT_NETWORK (1.3625x) or compute it dynamically, so the displayed earnings match the actual calculated earnings.

Steps to reproduce

  1. Navigate to https://github.com/Scottcjn/Rustchain/blob/main/mining-calculator/index.html
  2. Open the file and examine the calculateTotalWeight function (lines ~504-530) and generateSensitivityTable function (lines ~620-640)
  3. Note that avgMultiplier = 1.5 is hardcoded in both places
  4. Compare against DEFAULT_NETWORK definition (lines ~456-468) which has a total weight of 10.9 across 8 miners = 1.3625 average
  5. Select any hardware type and select "Preset miner count" mode — the displayed earnings will be ~8-10% lower than actual

Impact

For a 2.5x hardware miner in a 50-miner network:

  • Actual: 7.65 RTC/day (based on 1.3625 avg)
  • Displayed: 6.97 RTC/day (based on 1.5 avg)
  • Underreported by 0.68 RTC/day (8.9%)

Severity

Medium — 10 RTC (Incorrect calculation — earnings estimates are consistently ~8-10% lower than reality across all network sizes)

Fix

Replace const avgMultiplier = 1.5 with the computed actual average:

const avgMultiplier = DEFAULT_NETWORK.reduce((sum, item) => sum + item.multiplier * item.count, 0) / DEFAULT_NETWORK.reduce((sum, item) => sum + item.count, 0);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions