Developer UpdateKekcoin Developer Update #10: Wallet Patch (v2.0.2)

Kekcoin Developer Update #10: Wallet Patch (v2.0.2)

Unintentional Fork

First and foremost we would like to thank the Kekcoin community for their vigilance and patience in dealing with the latest wallet upgrades. It was brought to our attention that some of the new nodes had diverged from the original chain onto their own Kekcoin fork. Blocks were being created on two separate branches, one branch for users running the new client and one branch for those still running the old client.

We have isolated why this occurred and why it was not found during initial beta testing of the new wallet. Initially the consensus critical tests all passed. There was however an unforeseen scenario which was only likely to be found when a significant portion of the network was staking with the new client.

What happened?

As newly created blocks are received from peers in the network there are a number of validity conditions that are tested. One of those conditions checks whether the block’s timestamp is too far in the future. [Note that the network is asynchronous and thus nodes have differing views of what the time is]. Kekcoin v1.0 had this condition in its ‘CheckBlockHeaders’ function, while the Kekcoin v2.0 did not. It was thus a possibility that a v2.0 client would create a block which was perfectly valid according to other v2.0 clients but was rejected by v1.0 clients. Indeed, this is what occurred and caused the network to segregate in two. Thanks to our perceptive community members this anomaly was noticed early on and together we were able to turn off enough v2.0 staking nodes such that the forked chain slowed in growth compared to the original chain. The original chain eventually became longer than the forked chain and the whole network reestablished consensus. The v2.0 clients have undergone a reorganisation of their chain-state and now the whole network agrees on the state of the blockchain.

We have produced a new wallet patch, v2.0.2, which introduces the block timestamp validity condition into the new client and fixes this bug.

In hindsight we see that a more rigorous testing phase was necessary (bigger scale over a longer period etc.) — lessons learned for the future!

Upgrading to v2.0.2

The new wallet can be found on the releases page of our GitHub repository. In addition to downloading and running the new wallet, there are some steps which may be necessary to take if you find your balance to be miscalculated with the new wallet. Please follow the instructions relevant to you, depending on your OS and whether you are running the GUI or the daemon.

Windows & Linux GUI:

  1. Open wallet v2.0.2, select File > Repair Wallet. If your balances are adjusted to their correct values then you do not need to perform steps 2–4.
  2. Close wallet v2.0.2. Open wallet v1.0. Go to help > debug window > console. Type dumpwallet ExamplFileName and hit enter. This produces a human-readable file with all the private keys associated with your wallet.
  3. Click File > Backup Wallet, and save your wallet.dat file somewhere safe!
  4. Close wallet v1.0. Open wallet v2.0.2. Go to help > debug window > console. Type importwallet ExampleFileName and hit enter.

Your balances should now be correct. Compare with the block explorer to be certain.

Linux Daemon:

Assuming you have compiled the source code as per this tutorial,

  1. Navigate to Kekcoin-segwit
  2. Run ./kekcoind -rescan

Your balances should now be correct. Compare with the block explorer to be certain.

Categories: Developer Update