05 August 2019

Developer's Journal #21


Here is another edition of the journal devoted to the changes of the Credits blockchain platform. The main changes in the code and structure of the platform for June - July 2019 are presented below.

Credits Node

Change in the method of storing the status of smart contracts.

The previous implementation envisaged the full storage of the “new state” of the smart contract in a transaction, that is, every challenge of the smart contract entailed the need to place a full copy of the smart contract with an altered state in the blockchain's storage.

The new solution allows you to maintain a constant cache of current transaction states on each node, and only hash states are stored in the blockchain. 

Such solution made it possible to significantly reduce the amount of data placed in the storage by the smart contract, to implement a mechanism for fair payment of the smart contract calls by the user (the user only pays for the increase in the size he initiated, and also reduces traffic when synchronizing blocks between network nodes.

Improvement of the synchronization mechanism

The problem associated with slowing synchronization between nodes when an unstable node appears is fixed. When there are signs of lagging behind the current round, the node “unconditionally” turned on the synchronization mode. This made it possible to stop the network by putting all the nodes in sync mode. For this, it was enough to form, for example, an incorrect round number during the ping between the nodes.

The solution of the problem is an algorithm that allows the node, when the node detects the signs of lagging behind the round, to request additional clarifying information from it and, after checking it, make a decision on whether to enable synchronization mode.

Credits Wallet

In respect to the large stream of clarifying requests related to the display of the balance and commissions written off from the user, the Credits Wallet has been modified.

There were problems that when a user pays transaction fees for which his wallet was not explicitly stated, he could not see all of his disposals and thus created the illusion of unreasonable write-offs from his wallet balance.

To overcome such situations, information on additional expenses has been added to the information about each transaction. For example, a commission for a new smart contract status has been added to the user transaction that caused the contract.

The additional expenses are accompanied by comments, which should unambiguously reveal the essence of the costs incurred, and links, allowing the user to quickly clarify the details.

Bug Bounty

The Bug Bounty Report with a list of detected errors, comments related to the corrections and payments will be submitted within 2 weeks.