Data Sync
Double spend attack
In cryptocurrency systems, the replicability of data makes it possible for the system to have the same digital asset being used over and over again, which is also known as double spend attack, also known as a double spending attack. It is because of this phenomenon that Transformers uses error correction synchronization to solve part of the double spend problem.
Checksum synchronization
Checksum synchronization is the main way of synchronizing data blocks and correcting errors on the Transformers chain. In the node due to network, performance, fork or other force majeure factors, the node chain height fails to agree with the majority of nodes in the network, and when and the node height and the chain height difference is less than 100, then the node will be checksum synchronization. The operation process of checksum synchronization is as follows:
The synchronization node requests data of a specific height from all nodes in the network through Byzantium, and checksums the data back from the relevant request. If the current block does not exist locally the block replenishment logic is run, when the data checksum passes, the data is written to the cache and when there is a block that should not have existed locally, the extra block is added to the rollback cache. The wrong block is eliminated in the next rollback logic. Whether it is a missing block or a wrong block, the result of the repair will be added to the local database changes.
Block synchronization
Patch block synchronization is a complement to the first two mechanisms, in the current node block height and the whole network gap is too large. The current database is lost, the block synchronization will quickly pull the block and add it to the local database. Replacement block will pull a thousand height of the hash and the local comparison, the verification passed will be directly added to the lost block to the cache, after adding to the database. In a thousand height hash and local inconsistency, this time will once again Byzantium pull to remove the block when Byzantium also failed, will be in the current height once again to verify the synchronization.
Fast synchronization
Fast synchronization occurs when the block is stored and found that the block before the block hash does not exist, this time through the fast synchronization to quickly find the block hash and add the current block hash to the database, at the same time, fast synchronization is also a logical complement to the other two synchronization methods.
Byzantine synchronisation
The Byzantine approach is used for both checksum and patch synchronisation. Checksum synchronisation Byzantine has three phases, the first phase queries 25 nodes across the network. After success, i.e., after comparing with local data, the next synchronisation will take place. If it fails then it will go to the next phase of the byzantine, the second phase of the byzantine will ask 250 nodes across the network, again the success will be the next synchronisation failure will be the next byzantine. The third stage will byzantine validate the nodes of the whole network, after pulling the data information of the nodes of the whole network, according to different synchronisation methods will take different strategies. Patch block synchronisation byzantine approach is a network-wide byzantine every time. Checksum synchronisation will roll back the wrong blocks and replenish the lesser blocks, and complementary block synchronisation will take the last data as the basis for the last addition to the local database.
At the same time, because the last byzantine access to the whole network nodes is almost the ultimate means to prevent malicious nodes from doing evil, greatly increasing the cost and difficulty of doing evil. Therefore, Transformers's unique Byzantine implies that Transformers is a highly secure public chain.