Skip to main content

Network

Transformers chain adopts a fully connected decentralized and distributed P2P network structure. Transformers chain is connected to the blockchain network through P2P. In the blockchain network, all nodes are equal, acting as both clients and servers.

image

Network Structure

In transformers chain, all nodes are equal and possess all the characteristics of a node.

  • Archiving Preserve the historical state of all blocks, with the world state corresponding to any block in history saved on the node.

  • Validation Directly validate the validity of the transaction data locally.

  • Broadcast Participate in the whole network broadcast of block information and transaction information.

  • Synchronization Node After the new node joins the block, it will be discovered and connected to broadcast other nodes.

  • Heartbeat Verify the robustness of the connection status of nodes in the network.

  • Interface Open query interface to provide accurate basic current information.

How to identify and authenticate each node?

Each verification node is marked with a unique ID through the node list to ensure the authenticity of the verification node in the network. By validating the node list data, the verification nodes meeting the conditions are gathered into the verification pool. A discrete random function is used for the random selection of block verification nodes to ensure the smoothness and fairness of node selection,thus avoiding the unfairness caused by continuous functions due to network speed and other reasons. The core purpose is to ensure the randomness and security of the verification nodes and block generation, thereby confirming the tolerance interval for malicious nodes. All nodes participating in the validation of block legality can get the corresponding reward.

Why Use Fully Connected & Quantity Limit?

Transformers chain uses a fully connected approach in its design, which has the characteristics of high throughput, high reliability and low latency. To maintain these advantages, Transformers can maintain the best performance and security when the number of network nodes is kept between500-1000. According to its unique mechanism, the computational capacity of a single node in the network will be designed. If the high pressure causes the performance bottleneck of public network nodes, the network nodes that cannot participate in transactions will be temporarily unavailable. Due to the strong liquidity of the process in which nodes participate in the network, the availability of the transformers network layer is stable in the long term.

graph TD
A (Node A)
B(NodeB)
C(NodeC)
D(NodeD)
E(NodeE)
F(NodeF)

A-->B
B-->A

A---->C
C-->A

A--->D
D--->A

B-->E
E-->B

B-->F
F-->B

Network communication process

Transformers uses relatively stable TCP point-to-point communication.When using TCP communication, messages are first stored in the cache, then distributed by the transaction distributor, and finally processed by various processing functions.

Communication implementation

Node list: In other P2P networks, each node saves the information about other nodes.

When requesting one of the nodes, you only need to quickly find the corresponding node in your own node list. The current problem shared by some blockchain projects is that when the number of network nodes continues to expand, it is impossible to store the information about all other nodes on each node. With the increase of the number of digits, the number of layers is also increasing, and the higher the layer, the more information will be stored. This will cause great difficulty in quickly reading subsequent data and will reduce the timeliness of network data. Transformers is designed to solve this problem. At the application level, Transformers network sacrifices the number of nodes to improve network node, and can quickly complete full network communication within the service quantity level. which can quickly complete the whole network communication within the service quantity level. If the quantity exceeds the tolerance value, it will slow down transactions, and Transformers chain will kick out some unstaked nodes to solve this problem.

When a node receives a request message, the sender's node information is used to update the corresponding node list.The specific steps are as follows:

  1. Record the IP, block height and other information of the sending node.
  2. If Sender B already exists in the node list, update the node list information.
  3. If node B is not in the node list, add node B information to the node list.
  4. Broadcast this node information to other nodes.

The node list is the node information recorded by the current node, mainly used to view node information, judge whether the communication method between nodes is direct sending or forwarding and exercising routing functions, and the node information includes address, IP, name, identification, etc. Nodes will save information about all connected nodes.

Network Function Module

TCP registration steps

  1. The sending node sends a registration request to other registered node. If two nodes are not connected, they will establish a connection first. If the connection fails, the registration request will be resent.
  2. The registered node processes the registration request and returns specific node information.
  3. The sending node processes the registration response from the registered node and records the corresponding node information.

Heartbeat mechanism

If a node goes offline and does not reconnect within the specified time , the heartbeat number will change to 0, and the node information will be deleted

  • Steps:

The node reduces the heartbeat countof all known nodes by 1 and sends a ping request.

When the receiving node successfully receives the ping request, it resets the heartbeat of the sending node’s heartbeat count and sends a pong request.

When the sending node successfully receives the pong request, it resets the receiving node's heartbeat count and updates its node information.

Block height change notification

  • Step:

When the node height changes, it sends its own node height to other connected nodes. The receiving node processes the change request and updates the block height of the corresponding node.

Transformers uses the various mechanisms introduced above to ensure that the network status of each node in the network is good, ensuring the consistency of the data status of each node, and providing guarantee for the security and success rate of Transformers's continuous and rapid transactions.