8. FHE Engine Upgrade & Migration
On April 27, 13:00 - 16:00 UTC, Fhenix will execute a critical upgrade of the underlying Fully Homomorphic Encryption (FHE) engine to improve performance, efficiency, and long-term compatibility. This upgrade includes a non-backward compatible ciphertext state migration, requiring all developers to update their applications within the specified maintenance window.
This section documents the upgrade procedure, migration paths, breaking changes, and emergency protocols to ensure zero downtime for Fhenix-FairMarket and other dependent applications.
Quick Summary
- Upgrade Window: April 27, 13:00 - 16:00 UTC (3-hour maintenance window)
- Target Version:
@cofhe/sdk/cofhejsv0.5.0 - Breaking Change: Non-backward compatible ciphertext state migration
- Action Required: All applications must upgrade within the window
- Risk: Upgrading before or after the window will cause downtime and ciphertext incompatibility
Detailed Answer (Cited)
8.1. Upgrade Objectives & Technical Improvements
The FHE engine upgrade addresses three critical areas:
| Objective | Technical Implementation | Impact |
|---|---|---|
| Performance | Optimized FHE circuit evaluation, reduced ciphertext expansion | 40-60% faster encryption/decryption cycles |
| Efficiency | Smaller ciphertext size, reduced memory footprint | Lower gas costs for on-chain operations |
| Long-term Compatibility | Standardized ciphertext format aligned with ZK-proof systems | Future-proof integration with EigenLayer AVS and Layer 2 rollups |
8.2. Breaking Changes & Migration Paths
Non-Backward Compatible Ciphertext Migration
The v0.5.0 engine introduces a new ciphertext serialization format. Ciphertexts generated with v0.4.x or earlier will not be compatible with v0.5.0, requiring migration.
Migration Path by Current Version:
| Current Version | Migration Steps | Complexity |
|---|---|---|
| v0.4.0+ | 1. Wait for upgrade window 2. Update package.json: "@cofhe/sdk": "^0.5.0"3. Reinstall dependencies 4. No code changes required | Simple |
| v0.3.x or older | 1. Follow legacy migration guide 2. Update to v0.4.0 first 3. Then upgrade to v0.5.0 during window 4. Test ciphertext serialization | ️ Moderate |
| Production with active auctions | 1. Complete all active auctions before window 2. Or migrate ciphertexts using migration utility 3. Coordinate with Fhenix team for custom migration script | Critical |
8.3. Fhenix-FairMarket Impact Assessment
Critical Components Requiring Updates
// packages/frontend/package.json (UPDATE REQUIRED)
{
"dependencies": {
"@cofhe/sdk": "^0.5.0", // WAS: ^0.4.0
"@fhenixprotocol/cofhe-contracts": "^0.5.0" // WAS: ^0.4.0
}
}
// packages/contracts/package.json (UPDATE REQUIRED)
{
"devDependencies": {
"@cofhe/hardhat-plugin": "^0.5.0" // WAS: ^0.4.0
}
}State Migration for Active Auctions
If Fhenix-FairMarket has active auctions during the upgrade window, the following migration procedure applies:
- Pre-Window (April 26):
- Pause new auction creation 24 hours before window
- Notify users of scheduled maintenance
- Export all active ciphertext states to migration format
- During Window (April 27, 13:00-16:00 UTC):
- Fhenix team executes ciphertext state migration
- Upgrade SDK to v0.5.0
- Run migration validation tests
- Verify
FHE.lte()andFHE.select()operations
- Post-Window (April 27, 16:00+ UTC):
- Resume auction creation
- Monitor for ciphertext serialization errors
- Activate emergency rollback if migration fails
8.4. Testing & Validation Checklist
Before and after the upgrade, execute the following validation suite:
# Pre-upgrade validation (April 26)
npx hardhat test --grep "FHE encryption"
npm run test:e2e -- --grep "bid submission"
# Post-upgrade validation (April 27, 16:00+ UTC)
npx hardhat test --grep "FHE v0.5.0 compatibility"
npm run test:integration -- --grep "ciphertext migration"
# Critical test cases
encryptBid() produces valid v0.5.0 ciphertext
FHE.lte(encryptedBid, escrowBalance) executes without error
FHE.select() constant-time execution verified
Ciphertext hash matches expected v0.5.0 format
Auction settlement completes with migrated ciphertexts8.5. Emergency Rollback Procedure
If the upgrade causes critical failures, the following rollback protocol applies:
| Scenario | Rollback Action | Timeline |
|---|---|---|
| Ciphertext serialization failure | Revert to v0.4.0 SDK, restore pre-migration state | < 30 minutes |
| FHE operation timeout | Disable CoFHE processing, activate Dynamic Dead Man's Switch | < 1 hour |
| State corruption | Restore from pre-upgrade snapshot, notify users of 24h delay | < 4 hours |
Rollback Commands:
# Emergency SDK rollback
npm install @cofhe/sdk@0.4.0 @fhenixprotocol/cofhe-contracts@0.4.0
# Restore pre-migration state (admin only)
npx hardhat restore-state --network fhenix-mainnet --snapshot pre-upgrade-2024-04-27Confirmed Facts
- Upgrade Window is Fixed: April 27, 13:00 - 16:00 UTC. No extensions planned.
- Non-Backward Compatible: Ciphertexts from v0.4.x will not work with v0.5.0 without migration.
- Timing is Critical: Upgrading before or after the window will cause downtime and incompatibility.
- Simple Migration for v0.4.0+: Only requires
package.jsonversion bump, no code changes. - Legacy Versions Require Extra Steps: v0.3.x and older must follow migration guide first.
Unresolved Points & Explicit Gaps
| Gap / Unresolved Point | Impact | Current Status | Recommended Action |
|---|---|---|---|
| Active Auction Handling | What happens to bids submitted during the 3-hour window? | Not explicitly documented in announcement. | Pause auction creation 24h before window; complete all active auctions or migrate ciphertexts. |
| Rollback SLA | What is the guaranteed rollback time if migration fails? | Announcement mentions downtime risk but no SLA. | Coordinate with Fhenix team to establish < 1 hour rollback guarantee for critical failures. |
| Gas Cost Impact | Will the new FHE engine reduce gas costs for placeBid()? | Performance improvements mentioned but no specific gas benchmarks. | Run gas profiling tests post-upgrade to quantify cost reduction for user communication. |
| Testnet Staging | Was the upgrade tested on Fhenix Testnet before mainnet deployment? | No mention of testnet validation in announcement. | Request testnet migration logs and validation reports from Fhenix team before mainnet window. |
| Cross-Protocol Dependencies | Do EigenLayer AVS operators need to upgrade simultaneously? | Announcement focuses on SDK but AVS integration may require coordination. | Confirm with EigenLayer AVS team whether operator nodes require simultaneous upgrade. |
Fact vs. Analysis Distinction: The upgrade window (April 27, 13:00-16:00 UTC), version requirement (v0.5.0), non-backward compatibility, and migration paths are verified facts from the official Fhenix announcement. Active auction handling, rollback SLA, gas cost impact, testnet staging, and cross-protocol dependencies are unresolved operational gaps requiring explicit coordination before the upgrade window.
Sources (Official Documentation References)
- Fhenix Discord Announcement →
dev-updateschannel (April 2024) - Migration Guide → https://cofhesdk.fhenix.io/migrating-from-cofhejs
- Fhenix-FairMarket Whitepaper v2.0 → Section 2.1 (FHE Cryptography)
- Technical Specification v2.0 → Section 4.1 (CoFHE Integration)
- Phase 3 Sub-Tasks Matrix → Task 3.2 (FHEOS Integration)
Next Steps
- Immediate (Before April 27): Complete all active auctions or prepare ciphertext migration scripts
- During Window (April 27, 13:00-16:00 UTC): Update
@cofhe/sdkto v0.5.0, run validation tests- Post-Upgrade (April 27, 16:00+ UTC): Monitor for errors, resume normal operations, document lessons learned
- Contingency: If rollback required, execute emergency procedure within 30 minutes and notify users
Developer Action Items
Before April 27 (Pre-Upgrade)
- [] Audit all
@cofhe/sdkandcofhejsdependencies across projects - [] Complete or pause active auctions in Fhenix-FairMarket
- [] Backup ciphertext state database
- [] Test upgrade on local environment with v0.5.0 SDK
- [] Notify users of scheduled maintenance window
During April 27, 13:00-16:00 UTC (Upgrade Window)
- [] Update
package.json:"@cofhe/sdk": "^0.5.0" - [] Run
npm installorpnpm install - [] Execute migration validation tests
- [] Verify FHE operations (
encrypt,lte,select) - [] Monitor Fhenix Discord for real-time updates
After April 27, 16:00+ UTC (Post-Upgrade)
- [] Resume auction creation and bid submission
- [] Monitor logs for ciphertext serialization errors
- [] Run integration test suite
- [] Document any issues or performance improvements
- [] Update internal documentation with v0.5.0 changes
️ Critical Reminder: Only upgrade during the specified window. Upgrading before or after will cause downtime and ciphertext incompatibility with the Fhenix network.