[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:
- Preset miner count mode (line ~579):
const avgMultiplier = 1.5; // Conservative average
- 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
- Navigate to https://github.com/Scottcjn/Rustchain/blob/main/mining-calculator/index.html
- Open the file and examine the
calculateTotalWeight function (lines ~504-530) and generateSensitivityTable function (lines ~620-640)
- Note that
avgMultiplier = 1.5 is hardcoded in both places
- Compare against
DEFAULT_NETWORK definition (lines ~456-468) which has a total weight of 10.9 across 8 miners = 1.3625 average
- 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);
[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.htmluses a hardcoded average multiplier of 1.5x to estimate network weight in two critical code paths:const avgMultiplier = 1.5; // Conservative averageconst avgMultiplier = 1.5;The actual average multiplier of the
DEFAULT_NETWORKcomposition is 1.3625x (total weight 10.9 / 8 miners).DEFAULT_NETWORK composition:
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
calculateTotalWeightfunction (lines ~504-530) andgenerateSensitivityTablefunction (lines ~620-640)avgMultiplier = 1.5is hardcoded in both placesDEFAULT_NETWORKdefinition (lines ~456-468) which has a total weight of 10.9 across 8 miners = 1.3625 averageImpact
For a 2.5x hardware miner in a 50-miner network:
Severity
Medium — 10 RTC (Incorrect calculation — earnings estimates are consistently ~8-10% lower than reality across all network sizes)
Fix
Replace
const avgMultiplier = 1.5with the computed actual average: