Summary
Fixes app expiration and pricing calculations to properly account for the PON fork (block 2020000) where chain speed increased 4x (from 2-minute blocks to 30-second blocks).
##Main Problem Fixed
If someone tries to extend the app for one month, instead of being adding one month to the current subscription, the app will be updated to run one month from today.
Changes
Frontend (HomeUI)
- Fixed subscription extension issue: Prevented
getDaemonBlockCount()from resettingexpireOptionsduring app updates by adding a parameter to control when expire options should be
adjusted - Fixed
getExpireOptions()function:- Uses correct default expire based on app registration height (88000 blocks for apps registered after fork, 22000 before)
- Adjusts
currentExpirecalculation for apps registered before fork whose expiration crosses the fork boundary (multiplies blocks after fork by 4x)
- Fixed
appRunningTill()computed property:- Applies same fork-aware default expire logic
- Calculates expiration time by splitting blocks before and after fork with correct block times (2 min vs 30 sec)
- Ensures accurate "running until" timestamps displayed to users
Backend (ZelBack)
- Fixed pricing calculations in
appSpecHelpers.js:- Updated
getAppFluxOnChainPrice()to adjustpreviousExpireInfor apps registered before fork - Updated
getAppFiatAndFluxPrice()with same adjustment logic - Ensures correct pricing when renewing apps that were registered before the fork
- Updated
Problem
Apps registered before the PON fork with expiration periods crossing the fork boundary were not correctly accounting for the 4x chain speed increase, leading to:
- Incorrect expiration date calculations
- Wrong pricing for app renewals
- Inconsistent expire options shown to users
Solution
Added fork-aware logic throughout the codebase that:
- Detects when an app was registered before the fork
- Checks if the expiration crosses the fork boundary
- Adjusts block counts after the fork by multiplying by 4
- Uses appropriate block times (2 min before fork, 30 sec after) for time calculations