Hotfix V4.3.0 Inflation Bug Instructions - mwcproject/docs GitHub Wiki

Inflation Bug Incident Advisory.

Please take your time to read this document carefully.

Background

In reference to previous announcement: https://forum.mwc.mw/t/critical-bug-report/102

Backup Data

IMPORTANT for EXCHANGES: After upgrading, the chain data State will change and transaction confirmation statuses can change. If you wish to view transactions from the old chains from a pre-patch perspective, please back up your old chain data, as well as your old binary.

Before we start to explain the procedure make sure to export your tx history (mwc-wallet txs > mwc-wallet_TX_HistoryInflated.data) and to backup whatever data you need to correlate those transactions with your Users, including the old binary. In case your setup relies on data stored by mwc-wallet or mwc-node to correlate users and deposited/withdrawn amounts, it is important that this data is preserved (wallet_data and chain_data folders respectively) This ensures that a complete resync from scratch will not affect your ability to analyze this situation after fixing the invalid Chain under any circumstances.

Validate the Output is complete and then continue.

Preamble

If your Node hasn't picked up the new chain in time, due to technical reasons you will need to update your Node and wallets, let's elaborate:

Switch chains manually

You will need to force the wallets to switch chains.

In order to restore trading, deposits and withdrawals you will need to:

  1. Upgrade your Node to Version 4.3.0
  2. If not an Archive node: Delete ~/.mwc/main/chain_data (Important: Create a Backup before deleting it https://github.com/mwcproject/docs/wiki/Hotfix-V4.3.0-Inflation-Bug-Instructions#backup-data)
  3. Start the Node and wait for synchronization to finish

From here on it depends on your Setup, the patched wallet will rescan outputs against the correct chain and Upgrade transaction statuses accordingly. Make sure your system handles the following edge cases;

  • Some of your System Components may panic if amounts are automatically subtracted if they are already spent (Make sure values can be below 0 or ensure they won't get negative)
  • Some of your System Components may not rescan/retouch a transaction that was confirmed once with enough confirmations that doesn't exist anymore now on the fixed chain if you manually switch it as there is no Reorg detected. (Make sure your system handles transactions even if not on chain anymore without a reorg event)
  • This list may not include every possible edgecase depending on your Setup

If your system can handle above cases and you are confident your Interfaces can process this automatically you can simply Upgrade your wallet to version 4.1.2 and the wallet should reflect it's transactions accordingly propagating through your software interfaces.

If your system will not be able to automatically handle confirmed transactions becoming invalid you will need to manually get the data out of your system. You may choose different methods to get the needed data, either you check the wallets output when it is rescanning or you compare the transaction history of the old corrupted chain that you exported to an export of transactions after the resync was finished. This will reveal a difference of Transactions that never happened allowing you to act accordingly. You can then link those Transactions that don't exist anymore to the Accounts that received said transactions, subtracting the resulting amounts in a manual or an automated manner. If that's the route to go, continue below:

  1. Upgrade your wallet to version 4.1.2
  2. Validate the Output of the Wallets Rescan and verify if this is sufficient to handle affairs.
  3. If not export your TX history (mwc-wallet txs > mwc-wallet_TX_HistoryCorrected.data)

It may be better suited to your architecture to compare outputs for example. This will get you the needed Data to take actions and to trace missing transactions back to the affected user.

Ressources:

Official Hotfix for Node: https://github.com/mwcproject/mwc-node/releases/tag/4.3.0

Official Hotfix for wallet: https://github.com/mwcproject/mwc-wallet/releases/tag/4.1.2

Official Hotfix for mwc713: https://github.com/mwcproject/mwc713/releases/tag/4.1.2

Official Hotfix for GUI Wallet: https://github.com/mwcproject/mwc-qt-wallet/releases/tag/1.2.2