Low-delay block delivery system and method based on transaction pre-synchronization

By adopting a low-latency block delivery method with pre-synchronization of transactions in the blockchain network, the problem of excessive latency in existing technologies is solved, achieving the effect of shortening block delivery latency and increasing transaction throughput without affecting security and fault tolerance.

CN119030683APending Publication Date: 2024-11-26CHONGQING UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410988736.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-23
Publication Date
2024-11-26

AI Technical Summary

Technical Problem

Existing block delivery methods focus on minimizing bandwidth consumption in resource-constrained large-scale distributed networks, while giving less consideration to shortening end-to-end latency. This results in excessively long transaction confirmation delays, which cannot meet the real-time requirements of network scenarios such as vehicles and drones. Furthermore, the lack of mempool transactions increases transaction transmission and verification time.

Method used

A low-latency block delivery method with transaction pre-synchronization is adopted. By using the pre-synchronization connection between full nodes, the transaction in the candidate block is used to synchronize the memory pool in advance, the transaction in the block is compressed into a short hash value and transaction index, the block size is reduced, and the original block is reconstructed at the receiver, thus shortening the end-to-end delivery latency.

Benefits of technology

It effectively shortens the end-to-end latency of the blockchain network, increases transaction throughput, and improves the data interaction efficiency of the blockchain network in real-time network scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119030683A_ABST
    Figure CN119030683A_ABST
Patent Text Reader

Abstract

The invention relates to a low-delay block delivery system and method based on transaction pre-synchronization, and belongs to the technical field of block chains. The system comprises a light node, a full node, a miner and a server. An effective analysis model is provided for the transaction pre-synchronization process and the compressed block delivery process, the number of transactions in the full-node memory pool before and after transaction pre-synchronization can be analyzed, then the size of the compressed block is obtained, and finally the end-to-end time delay and the transaction throughput gain of the method are determined. The invention further provides a low-delay block delivery method based on transaction pre-synchronization, the memory pools of all the nodes can be synchronized in advance based on transactions in the candidate blocks before effective block propagation, and therefore the problem of memory pool transaction missing caused by frequent access of the nodes in the block chain network is effectively solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of blockchain and relates to a low-latency block delivery system and method based on transaction pre-synchronization. Background Art

[0002] Blockchain is a distributed ledger technology with advantages such as high security, trustlessness, traceability, and autonomous rewards and penalties. It can coordinate and manage nodes in peer-to-peer networks, reach multi-party consensus under conditions of malicious interference, and drive decentralized applications. In recent years, the research on decentralized applications of blockchain has gradually expanded to strong real-time network scenarios such as vehicles and drones. The advantages of blockchain in vehicle and drone networks mainly include the following aspects: First, the consensus mechanism of blockchain can coordinate the data interaction process between vehicles and drones, ensure the openness and transparency of the data processing process and the immutability of confirmed data. Second, the transaction verification mechanism of blockchain can filter false and misleading information, achieve high-quality data sharing, and improve the decision-making accuracy of vehicles and drones. In addition, the chain storage structure of blockchain based on hash algorithm can help vehicles and drones quickly track data sources and verify the copyright and authenticity of data.

[0003] In this context, the compatibility of blockchain basic performance and real-time applications has become crucial. While blockchain provides security and reliability for vehicle and drone networks, it also brings additional message interactions and verification operations to the network, resulting in large delays in data interaction between smart terminals, which makes it impossible for terminal devices to make timely judgments and responses based on the current environment. In the past, blockchain systems mainly considered maximizing security tolerance and ensuring that new blocks can reach consensus normally and safely in distributed networks, without optimizing the rate of block delivery and consensus, resulting in large transaction confirmation delays and inability to cope with real-time network scenarios such as vehicles and drones.

[0004] In order to solve the above problems, the block delivery method, as a key technology that defines the block delivery method between peer nodes on a blockchain network, has received increasing attention from the industry. The block delivery method can significantly shorten the end-to-end latency, allowing new blocks to quickly propagate to the entire network, reach a distributed consensus, and meet the needs of real-time applications. When performing end-to-end block delivery, the sender needs to reasonably adjust the block delivery method, encode and compress the block, and control the byte size of the block without affecting security and fault tolerance.

[0005] The inventors found the following shortcomings in the process of studying the prior art:

[0006] Existing block delivery methods mainly focus on minimizing bandwidth consumption and ensuring that the block delivery process can be executed normally in large-scale distributed networks with limited resources, but less consideration is given to how to shorten end-to-end latency and ensure that new blocks can quickly reach a consensus across the entire network. In addition, existing block delivery methods rely on transactions in the node memory pool to reconstruct blocks, and their performance will be affected by the number of transactions in the memory pool. The more transactions missing from the memory pool, the more transactions the node needs to request and verify, which will greatly increase the transaction transmission time and transaction verification time, and ultimately lead to a longer latency for the block to reach a consensus across the entire network. Summary of the invention

[0007] In view of this, the purpose of the present invention is to provide a low-latency block delivery system and method based on transaction pre-synchronization, which can bring transaction throughput gain to the blockchain network while shortening the end-to-end latency.

[0008] In order to achieve the above object, the present invention provides the following technical solutions:

[0009] According to one aspect of an example of the present invention, a block delivery process system model supporting transaction pre-synchronization is provided, and the system model includes:

[0010] Light node: A resource-constrained terminal device that only needs to store lightweight ledgers and publish transactions.

[0011] Full node: needs to maintain complete ledger information and use the historical information of the ledger to verify transactions and blocks in the network.

[0012] Miner: A specialized device with consensus resources (such as hash rate and stake) responsible for finding new valid blocks.

[0013] Server: A special full node that runs both the mining pool protocol and the blockchain program. It is responsible for coordinating miners to generate new blocks and distribute revenue; it is also responsible for verifying, storing, and forwarding transactions and blocks in the network.

[0014] Further, consider a blockchain network with n servers, where k servers have transaction pre-synchronization enabled.

[0015] Furthermore, the transaction set of the server memory pool is M, the transaction set of the block sender memory pool is S, the transaction set of the block receiver memory pool is R, and the transaction set in the block is B. The sender constructs a compressed block based on the relationship between B and S; the pre-filled transaction is the part in B but not in S, and is filled with B. 12 Indicates that the short hash value is the intersection of B and S, represented by B 34 From the receiver's perspective, B will be divided into four subsets, satisfying B1∪B2=B 12 and B3∪B4=B 34; Among them, B1 is an unverified transaction, B2 and B4 are verified transactions, and B3 is a transaction missing from the memory pool.

[0016] Furthermore, consider the transaction propagation process as an independent repeated Bernoulli trial, where the probability that a full node receives a transaction is p, and the probability that a full node does not receive a transaction is q. For b Bernoulli trials, b 12 is the expected number of transactions missing from S, b 34 is the expected number of transactions that S has, b1 is the expected number of transactions that both S and R are missing, b2 is the expected number of transactions that S is missing but R has, b3 is the expected number of transactions that S has but R is missing, and b4 is the expected number of transactions that both S and R have.

[0017] Furthermore, there are Δ unsynchronized transactions and m-Δ synchronized transactions in the full node memory pool. Each server will randomly select b transactions from the m transactions for synchronization, excluding synchronized transactions during synchronization to avoid redundant synchronization. After synchronization, the number of transactions b1, b2, b3, b4 in each subset will change to b1′, b2′, b3′, b4′, which will affect the byte size of lwblock, getblocktxn, blocktxn messages.

[0018] Furthermore, the end-to-end delay t e It is the block delivery time between two full nodes, which consists of three parts: message round trip time 2.5t o , message transmission time (lwblock+getblocktxn+blocktxn) / θ, message verification time t h +(b1′+b3′)t v .

[0019] According to a second aspect of an example of the present invention, a low-latency block delivery method based on transaction pre-synchronization is also provided, the method comprising:

[0020] S1: Establish a pre-synchronization connection: All nodes establish connections and share addresses through syncon and syncaddr messages.

[0021] S2: Initiate transaction pre-synchronization: When the server's candidate block header hash value meets the pre-synchronization difficulty target, a synchronization message sync will be constructed and propagated, which contains the short hash values ​​of all unsynchronized transactions in the candidate block.

[0022] S3: Recover missing transactions in the memory pool: When the full node receives a synchronization message, it will use the short hash value to detect whether the transactions in its own memory pool are complete; if missing, it will use getblocktxn and blocktxn to request and recover the missing transactions.

[0023] S4: Compress transactions in blocks: When delivering blocks, the sender will use the transaction index in the synchronization message and the short hash value of the transaction in the memory pool to replace the complete transaction in the block, generate an lwblock message, and achieve byte compression of the transaction.

[0024] S5: Reconstruct the original block: The block receiver uses the short hash value in the lwblock message to retrieve the transaction in its own memory pool, and then restores the original block to perform block compression and delivery to the next hop.

[0025] Under the condition of using candidate blocks to pre-synchronize transactions in the memory pool of each full node, blocks are delivered by means of block compression and reconstruction to shorten end-to-end latency and bring transaction throughput gains.

[0026] Furthermore, the pre-synchronization connection in S1 is actively initiated by the full node to syncon or disconnect syncoff, and the full node can continue to establish the pre-synchronization connection according to the address in syncaddr.

[0027] Furthermore, S2 provides a transaction pre-synchronization method for full-node memory pool information differences. At each block height, the server will generate a new candidate block, which contains: block header header, coinbase transaction for revenue distribution, synchronized transaction synchronizedtxn and unsynchronized transaction unsyncedtxn; the server will send the block header to each miner for hash operation until the hash value of the block header meets the pre-synchronization difficulty target. The server will extract the short hash value of the unsynchronized transaction in the candidate block to construct the synchronization message. The candidate block will contain an average of Δb / m unsynchronized transactions and (m-Δ)b / m synchronized transactions, where Δ is expressed as

[0028]

[0029] Furthermore, S3 provides a method to recover missing transactions in the full node memory pool. Consider that there are k servers in the network with transaction pre-synchronization enabled. When a valid block is generated, any transaction in the block may be synchronized [1, k+1] times; the number of times a transaction is synchronized determines the probability of the transaction in the memory pool.

[0030] 1) For Δb / m unsynchronized transactions in a block, the probability that any transaction is not in the memory pool is

[0031]

[0032] 2) For (m-Δ)b / m synchronized transactions in a block, the probability that any transaction is not in the memory pool is

[0033]

[0034] Furthermore, S4 provides a method to compress transactions in blocks, thereby shortening the transmission time of blocks in the network. When delivering a block, the sender constructs an lwblock message based on the block transaction set B and the memory pool transaction set S. The message consists of pre-filled transactions, short hash values, and transaction indexes; the pre-filled transactions include transactions in set B but not in set S, and the number is

[0035]

[0036] The short hash values ​​and transaction indexes are generated by the overlapping transactions of set B and set S, the total number of which is

[0037]

[0038] Among them, the number of short hash values ​​is b3′4-Δb / m, and the number of transaction indexes is Δb / m.

[0039] Furthermore, S5 provides a method to reconstruct the original block based on the compressed block. When the receiver receives the lwblock message, it will compare the message with its own memory pool R; where b1′ is the number of transactions that have not been verified by the receiver, b2′ and b4′ are the number of transactions that have been verified, and b3′ is the number of transactions missing from the memory pool, which needs to be restored through getblocktxn and blocktxn. Using the set relationship, b1′, b2′, b3′ and b4′ can be expressed as

[0040]

[0041] b2′=b1′2-b1′, b3′=b2′, b4′=b3′4-b3′

[0042] After the receiver requests the missing transaction b3′ from the memory pool, all transactions in the block can be restored and the original block can be reconstructed.

[0043] Furthermore, the end-to-end latency of this low-latency block delivery method based on transaction pre-synchronization is

[0044] t e =2.5t o +(lwblock+getblocktxn+blocktxn) / θ+t h +(b1′+b3′)t v

[0045] The size of each message is

[0046] lwblock=header+coinbase+b1′2·txn+(b3′4-Δb / m)shorthash+Δb / m·index

[0047] getblocktxn=b3′·index, blocktxn=b3′·txn

[0048] At the same time, the transaction throughput gain obtained by this method is

[0049]

[0050] That is, under a given consensus fault tolerance f, the end-to-end delay t of block delivery e The smaller the transaction throughput The bigger.

[0051] The beneficial effects of the present invention are:

[0052] (1) A block delivery process system model that supports transaction pre-synchronization provides an effective analysis model for the transaction pre-synchronization process and the compressed block delivery process. It can analyze the number of transactions in the full node memory pool before and after transaction pre-synchronization, and then derive the size of the compressed block, and finally determine the end-to-end latency and transaction throughput gain of the proposed method.

[0053] (2) A low-latency block delivery method based on transaction pre-synchronization can synchronize the memory pool of each full node in advance based on the transactions in the candidate block before the effective block is propagated, thereby effectively addressing the problem of missing memory pool transactions caused by the frequent entry and exit of nodes in the blockchain network.

[0054] (3) A low-latency block delivery method based on transaction pre-synchronization, which compresses the transactions in the block into short hash values ​​and transaction indexes, reduces the overall byte size of the block, and shortens the end-to-end delivery latency of the block.

[0055] (4) A network slicing resource allocation method based on online auctions, which allows the blockchain network to carry and transmit larger blocks and process more transactions in the same amount of time, thereby bringing transaction throughput gains without affecting security and fault tolerance.

[0056] Other advantages, objectives and features of the present invention will be described in the following description to some extent, and to some extent, will be obvious to those skilled in the art based on the following examination and study, or can be taught from the practice of the present invention. The objectives and other advantages of the present invention can be realized and obtained through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0057] In order to make the purpose, technical solutions and advantages of the present invention more clear, the present invention will be described in detail below in conjunction with the accompanying drawings, wherein:

[0058] Figure 1 A block delivery process system model diagram supporting transaction pre-synchronization according to the present invention;

[0059] Figure 2 A message construction diagram of a low-latency block delivery method based on transaction pre-synchronization according to the present invention;

[0060] Figure 3 The present invention is a flowchart of a low-latency block delivery method based on transaction pre-synchronization. DETAILED DESCRIPTION

[0061] The following describes the embodiments of the present invention by specific examples, and those skilled in the art can easily understand other advantages and effects of the present invention from the contents disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that the illustrations provided in the following embodiments only illustrate the basic concept of the present invention in a schematic manner, and the following embodiments and features in the embodiments can be combined with each other without conflict.

[0062] Among them, the drawings are only used for illustrative explanations, and they only represent schematic diagrams rather than actual pictures, and should not be understood as limitations on the present invention. In order to better illustrate the embodiments of the present invention, some parts of the drawings may be omitted, enlarged or reduced, and do not represent the size of actual products. For those skilled in the art, it is understandable that some well-known structures and their descriptions in the drawings may be omitted.

[0063] The same or similar numbers in the drawings of the embodiments of the present invention correspond to the same or similar parts; in the description of the present invention, it should be understood that if the terms "upper", "lower", "left", "right", "front", "rear", etc. indicate the orientation or position relationship, they are based on the orientation or position relationship shown in the drawings, which is only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operate in a specific orientation. Therefore, the terms describing the position relationship in the drawings are only used for illustrative purposes and cannot be understood as limiting the present invention. For ordinary technicians in this field, the specific meanings of the above terms can be understood according to specific circumstances.

[0064] Figure 1 It is a system model diagram of the present invention, which specifically includes:

[0065] Light node: A resource-constrained terminal device that only needs to store lightweight ledgers and publish transactions.

[0066] Full node: needs to maintain complete ledger information and use the historical information of the ledger to verify transactions and blocks in the network.

[0067] Miner: A specialized device with consensus resources (such as hash rate and stake) responsible for finding new valid blocks.

[0068] Server: A special full node that runs both the mining pool protocol and the blockchain program. It is responsible for coordinating miners to generate new blocks and distribute revenue; it is also responsible for verifying, storing, and forwarding transactions and blocks in the network.

[0069] Further, consider a blockchain network with n servers, where k servers have transaction pre-synchronization enabled.

[0070] Furthermore, the transaction set of the server memory pool is M, the transaction set of the block sender memory pool is S, the transaction set of the block receiver memory pool is R, and the transaction set in the block is B. The sender constructs a compressed block based on the relationship between B and S; the pre-filled transaction is the part in B but not in S, and is filled with B. 12 Indicates that the short hash value is the intersection of B and S, represented by B 34 From the receiver's perspective, B will be divided into four subsets, satisfying B1∪B2=B 12 and B3∪B4=B 34 ; Among them, B1 is an unverified transaction, B2 and B4 are verified transactions, and B3 is a transaction missing from the memory pool.

[0071] Furthermore, consider the transaction propagation process as an independent repeated Bernoulli trial, where the probability that a full node receives a transaction is p, and the probability that a full node does not receive a transaction is q. For b Bernoulli trials, b 12 is the expected number of transactions missing from S, b 34 is the expected number of transactions that S has, b1 is the expected number of transactions that both S and R are missing, b2 is the expected number of transactions that S is missing but R has, b3 is the expected number of transactions that S has but R is missing, and b4 is the expected number of transactions that both S and R have.

[0072] Furthermore, there are Δ unsynchronized transactions and m-Δ synchronized transactions in the full node memory pool. Each server will randomly select b transactions from the m transactions for synchronization, excluding synchronized transactions during synchronization to avoid redundant synchronization. After synchronization, the number of transactions b1, b2, b3, b4 in each subset will change to b1′, b2′, b3′, b4′, which will affect the byte size of lwblock, getblocktxn, blocktxn messages.

[0073] Furthermore, the end-to-end delay t eIt is the block delivery time between two full nodes, which consists of three parts: message round trip time 2.5t o , message transmission time (lwblock+getblocktxn+blocktxn) / θ, message verification time t h +(b1′+b3′)t v .

[0074] Figure 2 It is a message construction diagram of the block delivery method based on transaction pre-synchronization of the present invention. At each block height, the server will generate a new candidate block, which includes: block header header I, coinbase transaction for distributing revenue, synchronized transaction synchronized txn and unsynchronized transaction unsynced txn; the server will send the block header to each miner for hash operation until the hash value of the block header meets the difficulty target of pre-synchronization.

[0075] Furthermore, the server will extract the short hash value of the unsynchronized transaction in the candidate block to construct a synchronization message, which contains: block header II, transaction index index and short hash value shorthash, where the transaction index and short hash value are in a one-to-one correspondence. The server will propagate the synchronization message to the entire network, allowing all nodes to detect and recover transactions missing from the memory pool.

[0076] Furthermore, the miner finds a valid block header, header III, and returns the block header to the server. At this point, the server will propagate the block to the entire network, and the block contains: header III, coinbase, and txns.

[0077] Furthermore, during the block propagation process, the sender will construct a compressed block based on the relationship between transactions in the block and transactions in the memory pool, including: header III, coinbase, hash, index, shorthash and txn; where hash and index are generated based on the synchronization message; shorthash is the short hash value of the overlapping transactions between the block and the memory pool, and excludes the short hash value in the synchronization message; txn is the transaction in the block but not in the memory pool.

[0078] Figure 3 This is a flowchart of the block delivery method based on transaction pre-synchronization. The specific steps are as follows:

[0079] S1: Establish a pre-synchronization connection: All nodes establish connections and share addresses through syncon and syncaddr messages.

[0080] S2: Initiate transaction pre-synchronization: When the server's candidate block header hash value meets the pre-synchronization difficulty target, a synchronization message sync will be constructed and propagated. The message contains the short hash values ​​of all unsynchronized transactions in the candidate block; before message delivery, the full node will use inv and getdata to perform a two-way handshake to avoid sending sync messages repeatedly.

[0081] S3: Recover missing transactions in the memory pool: When the full node receives a synchronization message, it will use the short hash value to detect whether the transactions in its own memory pool are complete; if missing, it will use getblocktxn and blocktxn to request and recover the missing transactions.

[0082] S4: Compress transactions in blocks: When delivering blocks, the sender will use the transaction index in the synchronization message and the short hash value of the transaction in the memory pool to replace the complete transaction in the block, generate an lwblock message, and achieve byte compression of the transaction; this message is also formally transmitted after the inv and getdata two-way handshake to avoid redundant delivery.

[0083] S5: Reconstruct the original block: The block receiver uses the short hash value in the lwblock message to retrieve transactions in its own memory pool, and uses getblocktxn and blocktxn to request and recover missing transactions to restore the original block.

[0084] Under the condition of using candidate blocks to pre-synchronize transactions in the memory pool of each full node, blocks are delivered by means of block compression and reconstruction to shorten end-to-end latency and bring transaction throughput gains.

[0085] Furthermore, the pre-synchronization connection in S1 is actively initiated by the full node to syncon or disconnect syncoff, and the full node can continue to establish the pre-synchronization connection according to the address in syncaddr.

[0086] Furthermore, S2 provides a transaction pre-synchronization method for full-node memory pool information differences. At each block height, the server will generate a new candidate block, which contains: block header header, coinbase transaction for revenue distribution, synchronized transaction synchronized txn and unsynchronized transaction unsynced txn; the server will send the block header to each miner for hash operation until the hash value of the block header meets the pre-synchronization difficulty target. The server will extract the short hash value of the unsynchronized transaction in the candidate block to construct the synchronization message. The candidate block will contain an average of Δb / m unsynchronized transactions and (m-Δ)b / m synchronized transactions, where Δ is expressed as

[0087]

[0088] Furthermore, S3 provides a method to recover missing transactions in the full node memory pool. Consider that there are k servers in the network with transaction pre-synchronization enabled. When a valid block is generated, any transaction in the block may be synchronized [1, k+1] times; the number of times a transaction is synchronized determines the probability of the transaction in the memory pool.

[0089] 1) For Δb / m unsynchronized transactions in a block, the probability that any transaction is not in the memory pool is

[0090]

[0091] 2) For (m-Δ)b / m synchronized transactions in a block, the probability that any transaction is not in the memory pool is

[0092]

[0093] Furthermore, S4 provides a method to compress transactions in blocks, thereby shortening the transmission time of blocks in the network. When delivering a block, the sender constructs an lwblock message based on the block transaction set B and the memory pool transaction set S. The message consists of pre-filled transactions, short hash values, and transaction indexes; the pre-filled transactions include transactions in set B but not in set S, and the number is

[0094]

[0095] The short hash values ​​and transaction indexes are generated by the overlapping transactions of set B and set S, the total number of which is

[0096]

[0097] Among them, the number of short hash values ​​is b3′4-Δb / m, and the number of transaction indexes is Δb / m.

[0098] Furthermore, S5 provides a method to reconstruct the original block based on the compressed block. When the receiver receives the lwblock message, it will compare the message with its own memory pool R; where b1′ is the number of transactions that have not been verified by the receiver, b2′ and b4′ are the number of transactions that have been verified, and b3′ is the number of transactions missing from the memory pool, which needs to be restored through getblocktxn and blocktxn. Using the set relationship, b1′, b2′, b3′ and b4′ can be expressed as

[0099]

[0100] b2′=b1′2-b1′, b3′=b2′, b4′=b3′4-b3′

[0101] After the receiver requests the missing transaction b3′ from the memory pool, all transactions in the block can be restored and the original block can be reconstructed.

[0102] Furthermore, the end-to-end latency of this low-latency block delivery method based on transaction pre-synchronization is

[0103] t e =2.5t o +(lwblock+getblocktxn+blocktxn) / θ+t h +(b1′+b3′)t v

[0104] The size of each message is

[0105] lwblock=header+coinbase+b1′2·txn+(b3′4-Δb / m)shorthash+Δb / m·index

[0106] getblocktxn=b3′·index, blocktxn=b3′·txn

[0107] At the same time, the transaction throughput gain obtained by this method is:

[0108]

[0109] That is, under a given consensus fault tolerance f, the end-to-end delay t of block delivery e The smaller the transaction throughput The bigger.

[0110] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solution of the present invention can be modified or replaced by equivalents without departing from the purpose and scope of the technical solution, which should be included in the scope of the claims of the present invention.

Claims

1. A low-latency block delivery system based on transaction pre-synchronization, characterized by: The system includes: Light node: a resource-constrained terminal device that only stores lightweight ledgers and publishes transactions; Full node: maintains complete ledger information and uses the historical information of the ledger to verify transactions and blocks in the network; Miner: A device with consensus resources responsible for finding new valid blocks; Server: A special full node that runs both the mining pool protocol and the blockchain program. It is responsible for coordinating miners to generate new blocks and distribute revenue. It is also responsible for verifying, storing, and forwarding transactions and blocks in the network.

2. A low-latency block delivery system based on transaction pre-synchronization according to claim 1, characterized in that: There are n servers, among which k servers have transaction pre-synchronization enabled; The transaction set of the server memory pool is M, the transaction set of the block sender memory pool is S, the transaction set of the block receiver memory pool is R, and the transaction set in the block is B; the sender constructs a compressed block based on the relationship between B and S; The prefilled transaction is the part that is in B but not in S, using B 12 Indicates that the short hash value is the intersection of B and S, represented by B 34 From the receiver's perspective, B will be divided into four subsets, satisfying B1∪B2=B 12 and B3∪B4=B 34 ; Among them, B1 is an unverified transaction, B2 and B4 are verified transactions, and B3 is a transaction missing from the memory pool; The transaction propagation process is an independent and repeated Bernoulli trial, where the probability that a full node receives a transaction is p, and the probability that a full node does not receive a transaction is q. For b Bernoulli trials, b 12 is the expected number of transactions missing from S, b 34 is the expected number of transactions that S has, b1 is the expected number of transactions that both S and R lack, b2 is the expected number of transactions that S lacks but R has, b3 is the expected number of transactions that S has but R lacks, and b4 is the expected number of transactions that both S and R have; There are Δ unsynchronized transactions and m-Δ synchronized transactions in the full node memory pool. Each server will randomly select b transactions from m transactions for synchronization, excluding synchronized transactions during synchronization to avoid redundant synchronization. After synchronization, the number of transactions b1, b2, b3, b4 in each subset changes to b1′, b2′, b3′, b4′, affecting the byte size of lwblock, getblocktxn, blocktxn messages. End-to-end delay t e It is the block delivery time between two full nodes, which consists of three parts: message round trip time 2.5t o , message transmission time (lwblock+getblocktxn+blocktxn) / θ, message verification time t h +(b1′+b3′)t v .

3. A low-latency block delivery method based on transaction pre-synchronization based on the system of claim 1, characterized in that: The method comprises the following steps: S1: Establish a pre-synchronization connection: All nodes establish connections and share addresses through syncon and syncaddr messages; S2: Initiate transaction pre-synchronization: When the hash value of the server's candidate block header meets the pre-synchronization difficulty target, a synchronization message sync will be constructed and propagated, which contains the short hash values ​​of all unsynchronized transactions in the candidate block; S3: Recover missing transactions in the memory pool: When a full node receives a synchronization message, it will use the short hash value to check whether the transactions in its own memory pool are complete; if missing, it will use getblocktxn and blocktxn to request and recover the missing transactions; S4: Compress transactions in blocks: When delivering blocks, the sender uses the transaction index in the synchronization message and the short hash value of the transaction in the memory pool to replace the complete transaction in the block, generate an lwblock message, and achieve byte compression of the transaction; S5: Reconstruct the original block: The block receiver uses the short hash value in the lwblock message to retrieve the transaction in its own memory pool, and then restores the original block to perform block compression and delivery to the next hop; Under the condition of using candidate blocks to pre-synchronize transactions in the memory pool of each full node, blocks are delivered by means of block compression and reconstruction to shorten end-to-end latency and bring transaction throughput gains.

4. The low-latency block delivery method based on transaction pre-synchronization according to claim 3 is characterized in that: In S1, the pre-synchronization connection is actively initiated by the full node to syncon or disconnect syncoff, and the full node continues to establish the pre-synchronization connection according to the address in syncaddr.

5. The low-latency block delivery method based on transaction pre-synchronization according to claim 3 is characterized in that: In S2, at each block height, the server generates a new candidate block, which contains: block header, coinbase transaction for distributing revenue, synchronized transaction synchronizedtxn and unsynchronized transaction unsyncedtxn; the server sends the block header to each miner for hash operation until the hash value of the block header meets the pre-synchronization difficulty target; the server extracts the short hash value of the unsynchronized transaction in the candidate block to construct the synchronization message, and the candidate block contains an average of Δb / m unsynchronized transactions and (m-Δ)b / m synchronized transactions, where Δ is expressed as:

6. The low-latency block delivery method based on transaction pre-synchronization according to claim 3 is characterized in that: In S2 and S3, consider that there are k servers in the network that enable transaction pre-synchronization. When a valid block is generated, any transaction in the block is synchronized [1, k+1] times. The number of times a transaction is synchronized determines the probability of the transaction being in the memory pool. 1) For Δb / m unsynchronized transactions in a block, the probability that any transaction is not in the memory pool is: 2) For (m-Δ)b / m synchronized transactions in a block, the probability that any transaction is not in the memory pool is:

7. The low-latency block delivery method based on transaction pre-synchronization according to claim 3 is characterized in that: In S2 and S4, when delivering a block, the sender will construct an lwblock message based on the block transaction set B and the memory pool transaction set S. The message consists of pre-filled transactions, short hash values, and transaction indexes. The pre-filled transactions include transactions in set B but not in set S, and the number is: The short hash values ​​and transaction indexes are generated by the overlapping transactions of set B and set S, and the total number is: Among them, the number of short hash values ​​is b3′4-Δb / m, and the number of transaction indexes is Δb / m.

8. The low-latency block delivery method based on transaction pre-synchronization according to claim 3 is characterized in that: In S2 and S5, when the receiver receives the lwblock message, it will compare the message with its own memory pool R; wherein b1′ is the number of transactions that have not been verified by the receiver, b2′ and b4′ are the number of transactions that have been verified, and b3′ is the number of transactions missing from the memory pool, which needs to be restored through getblocktxn and blocktxn; using the set relationship, b1′, b2′, b3′ and b4′ are respectively expressed as: b2′=b1′2-b1′, b3′=b2′, b4′=b3′4-b3′ After the receiver requests the missing transaction b3′ from the memory pool, all transactions in the block are restored and the original block is reconstructed; The end-to-end latency of the low-latency block delivery method based on transaction pre-synchronization is: t e =2.5t o +(lwblock+getblocktxn+blocktxn) / θ+t h +(b1′+b3′)t v Among them, the size of each message is: lwblock=header+coinbase+b1′2·txn+(b3′4-Δb / m)shorthash+Δb / m·index getblocktxn=b3′·index, blocktxn=b3′·txn The resulting transaction throughput gain is: Under a given consensus fault tolerance f, the end-to-end delay of block delivery is t e The smaller the transaction throughput The bigger.