Method and device for determining performance index of block proposal mechanism
By constructing the Marcov chain model of the block connection relationship, calculating the state transfer matrix, determining the performance indicators of the block proposal mechanism, solving the performance evaluation problem of the Gasper consensus protocol, and realizing the accurate evaluation and improvement of the ETH2 system performance.
Patent Information
- Application Number
- CN202411631038.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-15
- Publication Date
- 2025-01-24
AI Technical Summary
The existing performance determination methods and models are not applicable to the Gasper consensus protocol, making it difficult to accurately evaluate the performance indicators of the ETH2 system, affecting performance improvement and application.
By constructing the Marcov chain model of the block connection relationship, calculating the state transfer matrix, determining the performance indicators of the block proposal mechanism, including system throughput, system efficiency, and system split probability.
It achieves accurate evaluation of the performance indicators of the block proposal mechanism, provides a scientific parameter configuration method, and improves the performance and application capabilities of the ETH2 system.
Smart Images

Figure CN119363468A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of information technology, and in particular to a method and device for determining performance indicators of a block proposal mechanism. Background Art
[0002] Ethereum 2.0 (ETH2) is a major upgrade to the mainstream blockchain platform Ethereum 1.0 and is a core component for building the Web3.0 architecture. The key feature of ETH2 is the Gasper consensus protocol it adopts, which greatly affects the performance of ETH2. Block proposal, as the first stage of the Gasper protocol, is the basis for the subsequent proof and finalization stages.
[0003] The performance of the block proposal phase will be affected by the system parameter configuration, so the parameter configuration can be optimized to adapt to different scenario requirements. For example, setting a longer block proposal interval will reduce system throughput, but it can improve system security because it reduces the probability of forks in the system. However, the current research on the Gasper consensus protocol is still in its early stages, and the existing performance determination methods and models are not suitable for the Gasper consensus protocol. The system's performance indicators are difficult to accurately evaluate, resulting in the system's configuration parameters relying only on empirical settings, which affects the performance improvement and application of ETH2.
[0004] Therefore, a method and device for determining performance indicators of a block proposal mechanism are needed, which can determine system performance under different block proposal interval settings. Summary of the invention
[0005] The present invention aims to provide a method and device for determining performance indicators of a block proposal mechanism, which can solve the above technical problems.
[0006] According to one aspect of the present invention, a method for determining a performance indicator of a block proposal mechanism is provided, comprising: constructing a Markov chain model of a block connection relationship according to a time slot length δ and a maximum network delay Δ of the block proposal mechanism; calculating a state transition matrix of the block connection relationship according to the Markov chain model; and determining a performance indicator of the block proposal mechanism according to the state transition matrix.
[0007] Preferably, constructing a Markov chain model of block connection relationships according to the time slot length δ and the maximum network delay Δ of the block proposal mechanism includes: judging all block connection relationships of the proposed block according to the ratio of the time slot length δ to the maximum network delay Δ; and dividing the state space of the proposed block according to all the block connection relationships to obtain the Markov chain model.
[0008] Preferably, when When , the state transfer matrix P is: Wherein, p represents the probability that a block is received within a time slot, q represents the probability that a block is not received within a time slot, and p+q=1.
[0009] Preferably, when When , the state transfer matrix P is:
[0010]
[0011] Among them, p1 represents the probability of a block being received in one time slot, q1 represents the probability of a block not being received in one time slot, p1+q1=1. p2 represents the probability of a block being received in two time slots; q2 represents the probability of a block not being received in two time slots, p2+q2=1.
[0012] Preferably, according to the state transfer matrix, determining the performance indicator of the block proposal mechanism includes: calculating the steady-state probability of each connection state in the state space according to the state transfer matrix; determining the performance indicator according to the steady-state probability, wherein the performance indicator includes system throughput, system efficiency and system bifurcation probability.
[0013] Preferably, the system throughput Γ is calculated as follows:
[0014]
[0015] Among them, π i represents the steady-state probability, when hour, when hour, P is the state transfer matrix, δ is the time slot length, and Δ is the maximum network delay.
[0016] Preferably, the system efficiency η is given by:
[0017]
[0018] Among them, Γ is the system throughput, δ is the time slot length, and Δ is the maximum network delay.
[0019] Preferably, the formula for the bifurcation probability of the system is: Among them, η is the system efficiency, δ is the time slot length, and Δ is the maximum network delay.
[0020] According to another aspect of the present invention, a device for determining a performance indicator of a block proposal mechanism is provided, comprising: a construction module, used to construct a Markov chain model of a block connection relationship according to a time slot length δ and a maximum network delay Δ of the block proposal mechanism; a calculation module, used to calculate a state transition matrix of the block connection relationship according to the Markov chain model; and a determination module, used to determine the performance indicator of the block proposal mechanism according to the state transition matrix.
[0021] Preferably, the determination device also includes: a judgment module, used to judge all the block connection relationships of the proposed block according to the ratio of the time slot length δ to the maximum network delay Δ; a division module, used to divide the state space of the proposed block according to all the block connection relationships to obtain the Markov chain model.
[0022] The present invention discloses a method for determining performance indicators of a block proposal mechanism, comprising: constructing a Markov chain model of a block connection relationship according to a time slot length δ and a maximum network delay Δ of the block proposal mechanism; calculating a state transfer matrix of the block connection relationship according to the Markov chain model; determining the performance indicators of the block proposal mechanism according to the state transfer matrix, and determining performance indicators such as the fork probability and throughput of the system by revealing the Markov state of the block connection relationship and deriving the transition probability between these states and the steady-state probability of each state. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:
[0024] Figure 1 is a flow chart of a method for determining a performance indicator of a block proposal mechanism according to an embodiment of the present invention;
[0025] Figure 2 According to an embodiment of the present invention Schematic diagram of block connection relationship when
[0026] Figure 3 According to an embodiment of the present invention Schematic diagram of the Markov chain state when ;
[0027] Figure 4 According to an embodiment of the present invention Schematic diagram of Markov chain state transition when ;
[0028] Figure 5 According to an embodiment of the present invention Schematic diagram of block connection relationship when
[0029] Figure 6 According to an embodiment of the present invention Schematic diagram of the Markov chain state when ;
[0030] Figure 7 According to an embodiment of the present invention Schematic diagram of Markov chain state transition when ;
[0031] Figure 8 is a schematic diagram of system throughput changes under different time slot lengths according to an embodiment of the present invention;
[0032] Fig. 9 is a schematic diagram of non-bifurcation probability changes under different time slot lengths according to an embodiment of the present invention; and
[0033] Fig.10 4 is a diagram showing a structure of a device for determining a performance indicator of a block proposal mechanism according to an embodiment of the present invention. DETAILED DESCRIPTION
[0034] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application can be combined with each other. The present invention will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0035] Figure 1 A flow chart of a method for determining a performance indicator of a block proposal mechanism according to an embodiment of the present invention is shown. As shown in the figure, an embodiment of the present invention provides a method for determining a performance indicator of a block proposal mechanism, including: constructing a Markov chain model of a block connection relationship according to a time slot length δ and a maximum network delay Δ of the block proposal mechanism; calculating a state transition matrix of the block connection relationship according to the Markov chain model; and determining a performance indicator of the block proposal mechanism according to the state transition matrix.
[0036] In the related art, the Gasper protocol is still in the preliminary research stage, and its parameter configuration and performance analysis mainly rely on experience. The present invention proposes a method for determining the performance index of the block proposal mechanism, which is used to analyze the performance of the Gasper block proposal mechanism. Specifically, under the condition of Δ synchronization network, the performance of the blockchain system is affected by the network delay, which makes the block connection relationship have Markov characteristics. We reveal the Markov state of the block connection relationship and derive the transition probability between these states. The fork probability and throughput of the system are analyzed by calculating the steady-state probability of each state.
[0037] In order to illustrate the performance indicator determination method of the block proposal mechanism of the embodiment of the present invention, some basic concepts in ETH2 are first introduced:
[0038] (1) Slot: The system time is divided into several slots, represented as {slot 0,…,slot i,…}. These slots are the basic time units in ETH2. The system can only propose one block in slot i, which is called B. i (2) Proposer: The proposer is a special node randomly generated by the ETH2 system, responsible for generating a block at the beginning of a time slot. In this embodiment of the present invention, the proposer of slot i is called proposer i, and it is assumed that proposer i proposes a block B in slot i. i (3) A→B: indicates that block A directly points to block B. (4) Forks and fork points (B f ): Fork refers to the situation where multiple blocks point to the same block. For example, if B2→B f And B1→B f , then B f It is called a bifurcation point. (5) Path: Path B1→B2→…→B n Indicates that from block B1 to B n The connection sequence of B1 is called the head of the chain. (6) Branch and head (B h ): A branch represents a chain from the head of the chain A to the fork point B. f The path (i.e. A→B f , where A is recorded as B h ). (7) Block weight: Each proposed block has a weight, which is greater than 0 and less than 1. (8) Branch weight: It represents the cumulative weight of all blocks in a branch. The weight of branch A→C→D→B is the sum of the weights of blocks A, B, C, and D. (9) Chain: It represents the weight of a branch from its head B. h The path to the genesis block B0, which is the first block generated on the blockchain. (10) The global canonical chain and its head (B H ): The chain with the highest weight is called the global canonical chain, B H Indicates the head of the chain. (11) The canonical chain from the proposer's perspective: refers to the chain with the highest weight from the proposer's perspective. (12) Forked branch: refers to any branch that does not belong to the global canonical chain.
[0039] Gasper, the consensus protocol of ETH2, divides time into a series of epochs, each of which contains m time slots. In slot i, proposer i proposes block B i . Each block B in the system iFrom creation to final confirmation, there are three stages: block proposal, justification, and finalization, among which: (1) Block proposal: the proposer proposes a block; (2) Justification: determine the connection relationship between the blocks proposed in the previous stage; (3) Finalization: confirm the connection relationship determined in the justification stage to ensure that it is irreversible. The transition between each stage follows the following rules: When the first block in epoch k enters the block proposal stage, all blocks in epoch (k-1) will be justified, and all blocks in epoch (k-2) will be finalized. For example, if B i is the first block in epoch 2. Once B i After system verification, the blocks in epoch 1 enter the proof phase, and the blocks in epoch 2 will enter the finalization phase.
[0040] Proposer i proposes block B at the beginning of slot i according to the block proposal mechanism i The process of proposing a block mainly includes the following three steps: (1) Proposer i calculates the weight of each branch according to the fork selection rule and selects the branch with the largest weight as the canonical chain from his perspective; (2) Proposer i generates block B i And point it to the head of the canonical chain from its perspective. Specifically, when generating block B i When it is executed, it packs the hash value of the head of the canonical chain from its perspective into B i (3) proposeri broadcasts block B in the network i (regardless of whether proposer i receives the block proposed before slot i).
[0041] In ETH2, forks are usually caused by network delays, resulting in multiple branches in the system. Proposer i selects one of the multiple branches as the canonical chain from his perspective according to the fork selection rule. The fork selection in the system can be summarized into the following three categories: no fork, multiple branches with different weights, and multiple branches with the same weights. Assuming that the weight of each block is 1, Rule 1 (no branch): If proposer i does not find a fork, it will block B i Directly points to the head of the canonical chain in its view; Rule 2 (multiple branches with different weights): If proposer i sees multiple branches with different weights, it will B i Point to the branch with the highest weight in its view; Rule 3 (multiple branches with the same weight): If proposer i sees multiple branches with the same weight, it will B iPoint to the branch with the earliest release time at the head of the chain.
[0042] According to an embodiment of the present invention, the determination method is used to determine performance indicators such as throughput and fork probability of the block proposal mechanism under different time slot length settings. Wherein, δ represents the time slot length, Δ represents the maximum network delay, and δ≤Δ, and other commonly used symbols are shown in the following table:
[0043] The determination method in the embodiment of the present invention has the following assumptions: (1) Synchronous clock: The clocks of all validators and proposers in the system are synchronized; (2) Δ-synchronous network: In this synchronous network, the block broadcast at time t must be received by all nodes before t+Δ. (3) Honest nodes: All participating nodes are honest nodes that strictly follow the block proposal protocol. (4) Unified block weights: The weight of each block defaults to 1; (5) Independent and identically distributed network delays: As shown in the table above, the network delay ξ is the time it takes for a block to be broadcast and received. Assume that the network delay is independent and identically distributed and obeys a truncated exponential distribution. When ξ obeys a truncated exponential distribution with an upper bound of Δ, its probability density function f(δ) and mean μ are expressed as:
[0044]
[0045] According to an embodiment of the present invention, constructing a Markov chain model of block connection relationships based on the time slot length δ and the maximum network delay Δ of the block proposal mechanism includes: judging all block connection relationships of the proposed block based on the ratio of the time slot length δ to the maximum network delay Δ; and dividing the state space of the proposed block based on all the block connection relationships to obtain the Markov chain model.
[0046] In the related art, the main focus is on revealing the vulnerabilities of the ETH2 protocol under malicious node attacks, but there is a lack of how to determine the performance of ETH2 based on network delay when there is no malicious node attack. Without considering malicious node attacks, the embodiment of the present invention uses the ratio of time slot length to maximum network delay as a variable to obtain the proposed Markov chain model of the block, laying the foundation for ultimately determining the system throughput and system fork probability under different time slot lengths.
[0047] Figures 2 to 4 The embodiment of the present invention is shown Schematic diagram of block connection relationship, Markov chain state diagram and Markov chain state transition diagram, as shown in the figure, when When , the state transfer matrix P is: Wherein, p represents the probability that a block is received within a time slot, q represents the probability that a block is not received within a time slot, and p+q=1.
[0048] Figures 2 to 4 The embodiment of the present invention is shown Schematic diagram of block connection relationship, Markov chain state diagram and Markov chain state transition diagram, as shown in the figure, when When , the state transfer matrix P is:
[0049]
[0050] Among them, p1 represents the probability of a block being received in one time slot, q1 represents the probability of a block not being received in one time slot, p1+q1=1. p2 represents the probability of a block being received in two time slots; q2 represents the probability of a block not being received in two time slots, p2+q2=1.
[0051] According to an embodiment of the present invention, determining the performance indicator of the block proposal mechanism according to the state transfer matrix includes: calculating the steady-state probability of each connection state in the state space according to the state transfer matrix; determining the performance indicator according to the steady-state probability, wherein the performance indicator includes system throughput, system efficiency and system bifurcation probability.
[0052] According to an embodiment of the present invention, the formula for the system throughput Γ is:
[0053]
[0054] Among them, π i represents the steady-state probability, when hour, when hour, P is the state transfer matrix, δ is the time slot length, and Δ is the maximum network delay.
[0055] According to an embodiment of the present invention, the formula for the system efficiency η is:
[0056] Among them, Γ is the system throughput, δ is the time slot length, and Δ is the maximum network delay.
[0057] According to an embodiment of the present invention, the formula for the bifurcation probability of the system is: Among them, η is the system efficiency, δ is the time slot length, and Δ is the maximum network delay.
[0058] Specifically, When exploring block B i There are 6 types of connection relationships with other blocks:
[0059] R1-R3: All blocks are received and the views are identical. In this scenario, proposer i receives Bi-2 and B i-1 , his view is exactly the same as the global view, B i Connected to the canonical chain: R1: Proposer i confirms B i-2 In the standard connection but B i-1 No. According to the fork choice rule Rule 3, B i Connect to B i-2 , B i On the canonical chain. R2: Proposer i determines B i-2 Not on the standard but B i-1 According to the fork choice rule Rule 3, B i Connect to B i-1 , B i On the canonical chain. R3: Proposer i determines B i-2 and B i-1 All are on the canonical chain. According to the fork selection rule Rule 1, B i Connect to B i-1 , B i On the canonical chain. R4: Partial block received, canonical chain views are equal. In this scenario, proposer i receives B i-2 , did not receive B i-1 , his view is different from the global view. But in the global perspective, B i-2 is the head of the canonical chain, and B i-1 is not on the canonical chain, so when considering the canonical chain, the proposer and the global are consistent, B i is connected to the canonical chain. Proposer i identifies B i-2 is the canonical chain head. According to the fork selection rule Rule1, B i Connect to B i-2 , B i On the canonical chain.
[0060] R5-R6: Partial block reception, unequal canonical chain views. In this scenario, proposer i receives B i-2 But I did not receive Bi-1, B i-1 On the canonical chain: R5: Proposer i confirms B i-1 and B i-2 Neither is on the canonical chain, B i-3 It is the head of the canonical chain B H According to Rule 3, B i Point to B i-3 , but from a global perspective, B i-1 It is B H , B i Not connected to the canonical chain. R6: Proposer i determines that B i-2 On the canonical chain, B i-1 Not in, and Bi-2 is the head of the canonical chain. According to Rule 3, B i Point to B i-2 But from a global perspective, B i-2 and B i-1 All on the canonical chain, B i-1 It is B H , B i Not connected in a canonical chain.
[0061] When a new block B i When connecting to the blockchain, there are six different connection situations (R1-R6). Based on these six situations, let Indicates B i The parent block is B i The block pointed to; B H Indicates that in B i The head of the canonical chain before connecting to the blockchain. From a global perspective, these connections can be mainly based on whether there is Divided into Figure 3 Two categories:
[0062] Category I (R1-R4, ): In this case, B i Point to the canonical chain, There is only B i A block directly points to B H .
[0063] Category II (R5-R6, ): In this case, B i Not on the canonical chain, There are multiple blocks pointing directly to But no block points directly to B H .
[0064] Based on these two types of connections, a Markov chain model is constructed, whose state space is:
[0065] S={S1,S2},S i =(M,N), M means directly pointing to B i The number of blocks Its value may be 1 or 2. N=1, otherwise, N=0. When M=1, N=1, S1=(1,1), B i On the canonical chain and pointing to B H When M=2,N=0,S2=(2,0), B i Not on the canonical chain and not pointing to B H Therefore, when Markov chain state space:
[0066] S∈{S1,S2}={(1,1),(2,0)}. Let p represent the probability of a block being received within a time slot. As mentioned above, ξ represents the network delay, δ represents the time slot length, and p=P(ξ≤δ). q represents the probability of a block not being received within a time slot, q=1-p. The state transition probability diagram is shown in Figure 4 As shown,
[0067] P((1,1)|(1,1))=p. Assume that in slot i, the system is in state (1,1). In this state, B i On the canonical chain and pointing to B H , in the next time slot slot(i+1), B i Become B H If the system state remains (1,1) from slot i to slot (i+1), then B i+1 Also on the canonical chain and pointing to B H . Known B i is the current B H , proposer i+1 receives B i , and B i+1 Point to it. Because proposer i+1 receives B in a time slot i The probability of the system state transitioning from (1,1) to (1,1) is p.
[0068] P((2,0)|(1,1))=q. Assume that in slot i, the system is in state (1,1). In this state, B i On the canonical chain and pointing to B H , in the next time slot slot(i+1), B i Become B H If the system state is transferred from (1,1) in slot i to (2,0) in slot (i+1), then B i+1 Not on the canonical chain and does not point to B H . Known B i is the current B H , proposer i+1 did not receive B i , and B i+1 Points to other blocks. Because proposer i+1 did not receive B in a time slot i The probability of the system state changing from (1,1) to (2,0) is q.
[0069] P((1,1)|(2,0))=1. Assume that in slot i, the system is in state (2,0). In this state, B i Not on the canonical chain and not pointing to BH . B i and B i+1 will not be off the canonical chain at the same time. i If it is not on the canonical chain, then in slot (i+1), proposer i+1 must put B i+1 Point to B H , and connected to the canonical chain. Therefore, the probability of transitioning from state (2,0) to (1,1) is 1.
[0070] Let Γ be the throughput, which represents the number of blocks connected to the canonical chain per unit time, η represents the efficiency, which represents the ratio of the number of blocks connected to the canonical chain to the total number of blocks proposed per unit time, P F represents the fork probability, that is, the probability of a fork occurring per unit time. The following is a mathematical expression for calculating steady-state probability, throughput, system efficiency, and fork probability. Let Δ be a unit time. Under this block proposal mechanism, the steady-state probabilities of state S1 and state S2 are π1 and π2 respectively: The formula for system throughput Γ is: The formula for system efficiency η is: The formula for the system bifurcation probability is:
[0071] Similarly, when hour, A block can be received within three time slots, and proposer i can receive the blocks from B0 to B i-3 Blocks. Figure 5 As shown in the proposed B i When the proposer i has the following five choices: (1) B i →B i-1 : If proposer i receives B i-1 And B i-1 It is B H , B i Point to B i-1 (2) B i →B i-2 : If proposer i receives B i-1 But B i-1 Not B H , B i-2 It is B H , B i Point to B i-2 (3) B i →B i-3 :If B i-1 and B i-2 None of them were received, B i Point to B i-3 (4) B i →Bi-4 :If B i-1 and B i-2 None of them received, and B i-3 Not on the canonical chain, B i Point to B i-4 (5) B i →B i-5 :If B i-1 and B i-2 I didn't receive any, but B i-3 and B i-4 Neither is on the canonical chain, B i Point to B i-5 Based on the above five possible connection options, a total of 28 different connection relationships can be derived.
[0072] In this case, a block must be received within three time slots, and the increase in reception time increases the number of potential block connections from 6 to 28. Just pay attention to and B H It is difficult to completely distinguish the connection between the two blocks, so we focus on one block, B. H The parent block of To help distinguish different connection relationships. H , and The following properties: 1) Directly connected to and 2) If Indicates B i On the canonical chain, otherwise B i Not on the canonical chain.
[0073] Based on this, a Markov chain model with a state space of S = {M, L, N} is established. M represents the direct connection to The number of blocks, can be 1, 2 or 3. L means directly connected to The number of blocks, which can be 0, 1, 2, or 3, because a block must be received within 3 time slots. N indicates whether there is N = 1 means existence, N = 0 means non-existence. Figure 6 As shown, the state (1,1,0) means: i) there is a block directly connected ii) A block direct connection iii) B i No direction to B H ,
[0074] consider Markov chain state space: S = {S0, S1, ... S7} = {(1,0,1), (1,1,1), (2,2,0), (1,2,1), (2,1,0), (3,3,0), (1,1,0), (2,2,0)*}. The state transition probability diagram is as follows Figure 7 As shown, the one-step transfer matrix is as follows:
[0075]
[0076] The specific expression of one-step transition probability is as follows:
[0077] P((1,1,1)∣(1,0,1))=p1; P((2,2,0)∣(1,0,1))=q1;
[0078] P((2,2,0)∣(1,1,1))=q1p2; P((2,1,0)∣(1,1,1))=q1q2;
[0079] P((1,0,1)∣(1,1,1))=p1; P((1,1,1)∣(1,1,0))=p1q2+p2;
[0080] P((2,2,0)∣(1,1,0))=q1p2; P((1,1,1)∣(1,2,1))=p1;
[0081] P((1,1,0)∣(1,2,1))=q1; P((1,1,0)∣(2,2,0))=p2;
[0082] P((1,0,1)∣(2,2,0))=p1q2; P((3,3,0)∣(2,2,0))=q1q2;
[0083] P((2,2,0 * )∣(2,1,0))=q2; P((1,0,1)∣(2,1,0))=p2;
[0084] P((1,0,1)||(2,2,0 * ))=1; P((1,0,1)∣∣(3,3,0))=1;
[0085] Here, p1 represents the probability of a block being received in one time slot, p1=P(ξ≤δ); q1 represents the probability of a block not being received in one time slot, q1=1-p1. p2 represents the probability of a block being received in two time slots, p2=P(ξ≤2δ); q2 represents the probability of a block not being received in two time slots, q2=1-p2. Let π i , i=0,…,7 represents state S iThe steady-state probability of π0,...,π7 can be obtained by solving the following equation:
[0086]
[0087] The formula for system throughput Γ is:
[0088] The formula for system efficiency η is:
[0089] The formula for the system bifurcation probability is:
[0090] In order to confirm the accuracy of the determination method of the embodiment of the present invention, simulation experiments were conducted under various parameter configurations. The simulation experiment was developed based on Python 3.9.6 and implemented the block propagation and fork selection rules. The simulation parameters include the time slot length (δ), the average network delay (μ), and the maximum network delay (Δ), where Δ = 1. The Monte Carlo method is used to estimate the probability that propser i receives the block {B0,…,B i-1}. Under the assumption that network delay follows a truncated exponential distribution, we evaluate the throughput and non-forking probability of the system through simulation. Each simulation result is run 2000 times and the average is taken. Figure 8 and Fig. 9 In the table, "ana" indicates theoretical results and "sim" indicates simulation results.
[0091] like Figure 8 As shown in the figure, the system throughput (Γ) varies with δ in the range of (0,1], and the average network delay μ is {0.1, 0.3, 0.6, 0.8}. Based on the theoretical and simulation results, the following conclusions can be drawn: (1) Given μ, as δ increases, the throughput Γ decreases, because the increase in δ reduces the number of blocks that can be created per unit time Δ, thereby reducing Γ; (2) Given δ, as μ increases, the throughput Γ decreases, because the increase in μ reduces the propser i receiving B within Δ. i The probability of the previous block leads to an increase in the number of forks in the system and a decrease in Γ. (3) The system throughput value obtained according to the embodiment of the present invention is very close to the simulation result, which verifies its accuracy.
[0092] like Fig. 9 As shown, the figure shows the probability of no forking With the changing trend of μ and δ, according to the theoretical and simulation results, we draw the following conclusions: (1) Under the given μ, As δ increases, it increases. This is because the increase in δ increases the probability that propser i receives block B. chThe probability of (2) When δ is given, decreases with the increase of μ, because higher μ reduces the probability that propser i receives block {B0,…,B i-1}, resulting in an increase in the number of forks in the system. (3) The non-bifurcation probability result obtained according to the embodiment of the present invention is highly consistent with the simulation result, which proves its accuracy.
[0093] Fig.10 FIG. 2 shows a block proposal mechanism performance indicator determination device according to an embodiment of the present invention. Fig.10 As shown, another embodiment of the present invention provides a device for determining a performance indicator of a block proposal mechanism, including: a construction module, used to construct a Markov chain model of a block connection relationship according to a time slot length δ and a maximum network delay Δ of the block proposal mechanism; a calculation module, used to calculate a state transition matrix of the block connection relationship according to the Markov chain model; and a determination module, used to determine the performance indicator of the block proposal mechanism according to the state transition matrix.
[0094] According to an embodiment of the present invention, the determination device also includes: a judgment module, used to judge all block connection relationships of the proposed block according to the ratio of the time slot length δ to the maximum network delay Δ; a division module, used to divide the state space of the proposed block according to all block connection relationships to obtain the Markov chain model.
[0095] Obviously, those skilled in the art should understand that the above modules or steps of the present invention can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, optionally, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present invention is not limited to any specific combination of hardware and software.
[0096] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A method for determining a performance indicator of a block proposal mechanism, comprising: According to the time slot length δ of the block proposal mechanism and the maximum network delay Δ, a Markov chain model of block connection relationship is constructed; According to the Markov chain model, a state transition matrix of the block connection relationship is calculated; According to the state transition matrix, a performance indicator of the block proposal mechanism is determined.
2. The determination method according to claim 1, characterized in that: According to the time slot length δ of the block proposal mechanism and the maximum network delay Δ, the Markov chain model for building the block connection relationship includes: Determining, according to a ratio of the time slot length δ to the maximum network delay Δ, all the block connection relationships of the proposed block; According to all the block connection relationships, the state space of the proposed block is divided to obtain the Markov chain model.
3. The determination method according to claim 1, characterized in that: when When , the state transfer matrix P is: Wherein, p represents the probability that a block is received within a time slot, q represents the probability that a block is not received within a time slot, and p+q=1.
4. The determination method according to claim 1, characterized in that: when When , the state transfer matrix P is: Among them, p1 represents the probability of a block being received in one time slot, q1 represents the probability of a block not being received in one time slot, p1+q1=1. p2 represents the probability of a block being received in two time slots; q2 represents the probability of a block not being received in two time slots, p2+q2=1.
5. The determination method according to any one of claims 1 to 4, characterized in that: According to the state transition matrix, the performance indicators of the block proposal mechanism are determined to include: Calculating the steady-state probability of each connection state in the state space according to the state transfer matrix; The performance indicator is determined according to the steady-state probability, wherein the performance indicator includes system throughput, system efficiency and system bifurcation probability.
6. The determination method according to claim 5, characterized in that: The formula for the system throughput Γ is: Among them, π i represents the steady-state probability, when When i=0,1, when When i=0,...,7, P is the state transfer matrix, δ is the time slot length, and Δ is the maximum network delay.
7. The determination method according to claim 6, characterized in that: The formula for the system efficiency η is: Wherein, Γ is the system throughput, δ is the time slot length, and Δ is the maximum network delay.
8. The determination method according to claim 7, characterized in that: The formula for the system bifurcation probability is: Wherein, η is the system efficiency, δ is the time slot length, and Δ is the maximum network delay.
9. A device for determining a performance indicator of a block proposal mechanism, comprising: A construction module is used to construct a Markov chain model of block connection relationship based on the time slot length δ of the block proposal mechanism and the maximum network delay Δ; A calculation module, used for calculating the state transition matrix of the block connection relationship according to the Markov chain model; A determination module is used to determine the performance indicator of the block proposal mechanism according to the state transition matrix.
10. A determination device according to claim 9, characterized in that: Also includes: A determination module, configured to determine the connection relationship of all the blocks of the proposed block according to the ratio of the time slot length δ to the maximum network delay Δ; The partitioning module is used to partition the state space of the proposed block according to all the block connection relationships to obtain the Markov chain model.