github RunOnFlux/flux v8.4.1

12 hours ago

Pull Request: v8.4.1

Summary

This release includes critical bug fixes for the free app update pricing system (accounting for PON fork block time changes) and introduces a new service to automatically recover stopped applications on FluxOS boot.

Changes

🐛 Bug Fix: Free App Update Calculation for PON Fork

Files: ZelBack/src/services/utils/appSpecHelpers.js

The checkFreeAppUpdate() function was not correctly calculating expiration heights for applications registered before the PON (Proof of Node) fork at block 2020000. After the fork, the chain runs 4x faster, which affects how subscription expiration is calculated.

Problem: Apps registered before the PON fork had their expiration calculated incorrectly when checking if an update qualifies as free, potentially causing operators to be charged for updates that should have been free.

Solution:

  • Added fork-aware expiration height calculation that adjusts blocks correctly when:
    • App was registered before fork but expiration crosses the fork boundary
    • Blocks before fork count at 1x rate, blocks after fork at 4x rate
  • Improved matching logic for nodes, instances, and staticip fields:
    • staticip: Treats undefined/null as false (default) for older DB records
    • nodes: Empty arrays and undefined/null are considered equivalent
  • Added comprehensive logging for each validation path to aid debugging

✨ New Feature: Stopped Apps Recovery on Boot

Files:

  • ZelBack/src/services/appLifecycle/stoppedAppsRecovery.js (new - 256 lines)
  • ZelBack/src/services/appLifecycle/advancedWorkflows.js (export added)
  • ZelBack/src/services/serviceManager.js (scheduler added)

When FluxOS starts, applications may be in a stopped state. This new service automatically restarts them, improving node reliability without operator intervention.

Key Features:

  • Identifies all stopped Flux containers on boot
  • Looks up app specifications from both local and global databases
  • Properly handles enterprise apps with encrypted specifications
  • Excludes apps using g: syncthing mode (master/slave mode) - these are managed separately by the masterSlaveApps service
  • Starts apps with a 2-second delay between each to avoid system overload
  • Executes 50 seconds after boot (after volume mount validation completes)

Recovery Flow:

  1. Query Docker for stopped Flux containers (/flux* or /zel* prefix)
  2. Match containers to installed apps in local database
  3. Fetch global specifications (with enterprise decryption if needed)
  4. Skip apps using g: syncthing mode in any component
  5. Start remaining stopped apps sequentially

📦 Version Bump

  • Package version updated from 8.4.0 → 8.4.1

Testing Considerations

  • Verify free app updates work correctly for apps registered before block 2020000
  • Verify free app updates work correctly for apps registered after PON fork
  • Test stopped apps recovery on node restart
  • Confirm apps with g: syncthing mode are NOT auto-started (managed separately)
  • Verify enterprise apps with encrypted specs are handled correctly
  • Check logs for new [checkFreeAppUpdate] and stoppedAppsRecovery messages

Related PRs

  • #1657 - PON fork adjustment fixes for free updates
  • #1658 - Auto-start stopped apps on boot feature

Don't miss a new flux release

NewReleases is sending notifications on new releases.