Treat NO_ACTIVATION_HEIGHT as never active in IsPONActive - #288
Open
MorningLightMountain713 wants to merge 1 commit into
Open
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
IsPONActivereturns true at every height when the PON activation height isNO_ACTIVATION_HEIGHT(-1), becausenHeight >= -1always 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:
-ponactivation, making PON consistent with how every other upgrade gate behaves (NetworkUpgradeActivetreatsNO_ACTIVATION_HEIGHTas 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
IsPONVRFActivefollows the same unguarded comparison and should adopt the same guard.🤖 Generated with Claude Code