Skip to content

Treat NO_ACTIVATION_HEIGHT as never active in IsPONActive - #288

Open
MorningLightMountain713 wants to merge 1 commit into
RunOnFlux:masterfrom
MorningLightMountain713:fluxd-consensus/ispon-no-activation
Open

Treat NO_ACTIVATION_HEIGHT as never active in IsPONActive#288
MorningLightMountain713 wants to merge 1 commit into
RunOnFlux:masterfrom
MorningLightMountain713:fluxd-consensus/ispon-no-activation

Conversation

@MorningLightMountain713

Copy link
Copy Markdown
Contributor

IsPONActive returns true at every height when the PON activation height is NO_ACTIVATION_HEIGHT (-1), because nHeight >= -1 always holds — the function's own comment already states the opposite intent. This adds the missing guard: an unset activation height means PON is not active.

Effect by network:

  • Mainnet, testnet: none. Both set explicit PON activation heights.
  • Regtest: PON is no longer unconditionally active from genesis. Regtest becomes PoW by default with PON opt-in via -ponactivation, making PON consistent with how every other upgrade gate behaves (NetworkUpgradeActive treats NO_ACTIVATION_HEIGHT as disabled).

This is kept as a single-commit PR so the consensus-adjacent change can be reviewed in isolation.

Coordination note: #284 modifies the same function. Landing this first is recommended, with #284 rebasing over it; #284's new IsPONVRFActive follows the same unguarded comparison and should adopt the same guard.

🤖 Generated with Claude Code

IsPONActive did nHeight >= activationHeight, so a NO_ACTIVATION_HEIGHT (-1) activation made it always-true rather than never (its documented intent). Return false when the activation height is NO_ACTIVATION_HEIGHT. This is a no-op on mainnet and testnet, which set real PON activation heights (2020000 / 800); the only effect is on regtest (PON = NO_ACTIVATION_HEIGHT), which now defaults to PoW from genesis instead of PON, matching the tx-level check (ContextualCheckTransaction already uses NetworkUpgradeActive(UPGRADE_PON), which returned false on regtest) and the documented semantics. Verified: the full qa suite (86 tests) stays green, funded tests pin PON via -ponactivation so are unaffected.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant