Commit 8a58e00
feat(consensus): make block-1 premine mainnet-only so testnet can bootstrap
GetBlockValue(1) returned the 5,000,000 FAIR premine unconditionally, but
ConnectBlock validates a block's mint against GetBlockValue(prev_height) — so
for a brand-new chain, block 1 mints 5M while consensus expects the normal
reward at height 0, and the block is rejected ("reward pays too much"). Mainnet
is unaffected (its block 1 is long since mined and checkpointed), but it makes a
fresh testnet impossible to launch.
Gate the premine to non-testnet so testnet block 1 mints the normal subsidy and
is mineable. Mainnet consensus is byte-identical. release.yml marks *-testnet*
tags as prereleases so they never become releases/latest (tracked by mainnet).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent 7c44a3f commit 8a58e00
2 files changed
Lines changed: 11 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
201 | 201 | | |
202 | 202 | | |
203 | 203 | | |
204 | | - | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
205 | 207 | | |
206 | 208 | | |
207 | 209 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1617 | 1617 | | |
1618 | 1618 | | |
1619 | 1619 | | |
1620 | | - | |
1621 | | - | |
| 1620 | + | |
| 1621 | + | |
| 1622 | + | |
| 1623 | + | |
| 1624 | + | |
| 1625 | + | |
| 1626 | + | |
| 1627 | + | |
1622 | 1628 | | |
1623 | 1629 | | |
1624 | 1630 | | |
| |||
0 commit comments