2.4.1. PFQN Model
This discussion succinctly review how a transaction is confirmed in a sharded blockchain. A user-signed transaction is sent to a queue in a particular shard network, and the transaction is allocated to a specific shard based on certain rules (such as the hash value of the transaction). Once assigned to the corresponding shard, it enters the transaction pool maintained by the nodes of that shard, waiting to be selected for packaging into a block. Miners or validators in the shard select transactions from the pool and package them into a new block. This process occurs simultaneously across the network's various shards. Within each shard, a consensus mechanism is used to verify and confirm the new block. If a transaction involves cross-shard operations, it is first confirmed in the source shard. Subsequently, the transaction is relayed to other shards, and upon receiving the transaction information, the target shard verifies, executes, and confirms it.
In our nonlinear queueing networks, there are three distinct types of entities: regular customers, negative signals, and positive signals corresponding to customers.
There are five types of entity flows within PFQN, represented by c, , s, and .
The customer 's' represents a block component, and we refer to s here as a mini block, which contains only one transaction. A mini-block can represent a confirmed transaction and AC. We consider mini-block instead of the block because mini-block can simplify the process of the coordinator extracting transactions from the block to generate a corresponding AC. Customer c represents a transaction type customer, which in the context of blockchain is a regular user-signed transaction.
To simulate batch service in blockchain, we introduce and . If an arrives at an empty queue, it will disappear. However, if an arrives at a queue with n customers, it will cause the customer at position l to leave with probability such that . A higher-positioned c will fill the vacancy, triggering another at the output of the queue. will trigger at the output of the queue while adding an s to the queue.
stands for cross-queue signal, and k in is the phase of the current signal. Stages are introduced to represent the number of shards yet to be visited by the signal. By replacing the concept of target sets in signals with stages, the probabilistic routing method models the process of cross-shard transaction transfer.
In Chapter 2, we have already made preliminary assumptions about the consensus queue P and the network queue N, which explain the distribution followed by the arrival and service processes of entities.
However, we still need to further explain the representation of arrival rates and the interactions between entities across queues. It is important to note that the arrival mechanism of entities in queue J is the same as that in its network queue N. Therefore, to simplify the discussion, we will no longer differentiate between the entity arrival processes in these two types of queues. In subsequent discussions, descriptions of entity arrivals may be used interchangeably, aiming to refer to this common arrival mechanism.
To facilitate the distinction between user-initiated transactions and relay's transaction arrival rate we use the symbol to represent the arrival rate of new customers in queue J. Here, is a subset of , specifically denoting the rate at which new user-generated transactions arrive at queue J, i.e., . The arrival rates for queue J are represented by , and respectively.
After leaving a queue, each entity can change its type through network routing. For example, an entity u departing from queue J can become a v-type entity heading for queue J’ with probability . The only requirement for routing probabilities is that .
Next, we will use two simple examples to explain how a regular customer (a user-signed transaction) and a cross-queue signal (a cross-shard transaction) are processed and transmitted within the PFQN. For the regular signal, we consider the propagation process of a signal within a single queue. For cross-queue signals, we will explore how a signal propagates through multiple queue systems, including the behavior of signals as they transfer between different queues. By describing the transfer process of signals in a single queue, we obtain an accurate description of the arrival rate of transactions to a queue in PFQN.
The way a regular customer operates in a queue can represent the confirmation process of a transaction within a shard. Customer c is first created by the client and propagated through the network to the shard's network queue N. Then it enters N at rate λNc. N distributes c to the nodes in the shard at a service rate μNc. Miners received c will add c to their transaction memory pool, representing c entering the shard's consensus queue P. The service rate μNc represents the service rate of the transaction in the network. Since μNc is large in reality, the service time can be negligible. Therefore, we can simply see c entering queue P at rate λPc.
When c reaches the end of P, as illustrated in
Figure 1, the transaction first arrives at queue N and then reaches queue P at an extremely fast service rate. At this point, c is converted into signal
, represented by
, the signal then triggers a new s in N, transforming at the end of N to
, Here, i is equal to b-1 (0 ≤ i < b), where b represents the size of a block, that is, the number of transactions a block can contain. When
arrives at P, it will then cause the disappearance of the other c. Eventually, this process will remove b transactions from the node's mempool P, corresponding to a batch processing in the blockchain.
To satisfy quasi-reversibility, queues that receive positive signals must emit additional positive signals when empty. Therefore, we require network queues to emit positive signals whenever they do not contain block components. Following the approach in [
10] to maintain the QR property, we adopt a probabilistic method to decide whether to retain the departing positive signals or route them out of the network. By multiplying by the reciprocal of a service rate, we adjust the emission rate of positive signals as the queue transitions between different occupancy states, especially when the queue is empty. This adjustment compensates for the current load rate by emitting positive signals that maintain the QR property.
To ensure QR, must be multiplied by to adjust the rate of . However, to ensure that multiplying by does not deviate from the original scenario, we need to set and . In terms of service processes, represents the service rate of all entities in N. The utilization rate of queue N is represented as , which can be a combination of multiple category utilization rates. The total number of negative signals generated remains constant, so the queue is not affected by this setting.
We can derive the flow equations of the queueing network. Due to the symmetric architecture, we only need the equation of a shard, including the consensus queue and its related network queue. For
, the flow equation of the consensus queue is:
The cross-queue signals mainly include the generation and transfer stages. When the positive signal
arrives at N, the newly generated s is converted into a k-stage cross-queue signal
at a certain rate, routing it to other queues besides itself. Once
arrives and is processed, it continues to be routed as
to other queues, excluding itself, until k equals 0. Considering shards j and j' as examples, where J'≠J, J',J∈M, M = {1, 2, …, M} as the set of all queues representing shards. For k = 0,1,..., U, and for all stages k > U,
, where U is the maximum stage that the signal can reach. Given that the newly generated signal has the potential to impact a maximum of either M-1 or dmax ( indicating the maximum destination that a signal can reach in one stage.) shards, it follows that U = min(M-1, dmax) - 1.We can obtain the overall arrival rate of cross-shard signals at shard J in stage k:
The three terms in represent the arrival rate of in shard J, each term being one of the sources of: the first term is the client-generated c arriving at shard J at rate λδ[k] by P it transforming into , δ [.] is the Dirac function defined on the discrete domain. The second term is the signal generated by completing the block component service in other shards J’; the third term is the signal routed from shard J’ to shard J with rate . is multiplied to prevent the additional departure rate.
The discussion will now focus more closely on the second and third items. During the generation stage, we need to consider the probability that a block component contains a cross-shard signal, as well as the probability of a cross-shard signal being at a certain stage. We need to differentiate between AC and TX in block component ‘s’ to identify which components can be transformed into cross-queue signals. For this, we use
to represent the ACs with d destinations. We define:
as the rate at which the network queue of shard J’ generates block s at rate
and transforms it into
to be routed to shard J at rate
. The term
represents the probability of routing to other shards and
represents the probability that a block component contains a cross-queue signal of a certain stage. We know that all customers in a network queue are comprised of both newly issued “customers” by clients and “signals” routed from other shards. Hence, the probability that a block component generates a signal can be derived as the ratio of the rate of newly issued TXs (i.e., λD[d]) to the rate of all other customers in the network queue, i.e.,
. Thus:
To obtain the routing probabilities
, the first step is to find the number of distinct shards other than the source shard that a multi-destination TX points to. The number of sets with i (i ≤ d) distinct shards other than the originating shard in the destination fields of s
d are
Where
is the second kind of Stirling number which is the number of ways to partition a set of d+1 objects into i+1 non-empty subsets. Therefore, routing probability
is obtained by dividing
by
possible destination sets for s
d.
Owing to the population dynamics within the target shards, aside from the source shard, where the newly emerged signal may be directed, it necessitates the division of
by
. Given the symmetrical and identical nature of the queues within M,
, Consequently,
can be simplistically represented as
. By incorporating these equations into equation (4), we derive:
During the transfer stage, consider
and
as the multi-stage positive signals and their respective arrival rates, where i represents the stage. When a
enters the network queue, it not only adds a class
c customer to the queue but also the newly triggered signal is routed as
. If the stage of the signal is 1, then the signal is routed as a regular class
c customer. Due to uniformly distributed routing probabilities, it can be routed to any of the other
M − 1 shards with equal probability.
Due to the symmetricity structure and flow of each shard, each shard equally hosts the same rate of multi-destination TXs as others. Hence, both rates in the summation of equation (3) are independent of their originating queues. Therefore, we can simply replace the subscript J′ with J in
and rewrite it as
, then we replace equation (3) with equation (5), and obtain:
where
is the rate at which the transactions are processed. Starting to solve (7) from k=U down to k=0, we can obtain the total input rate of combined-flow customers to a network queue as
2.4.2. Derivation of Transaction Confirmation Delay
By PFQN we decouple the input model of the sharded blockchain, and we sum entities c in different stages to obtain the average expected value of transactions applicable to the sharded blockchain. However, obtaining a description of a queue's transaction flow is not sufficient to determine the transaction confirmation time for a queue. By utilizing the formula described in [
12] for the confirmation time of transactions in a single queue and combining it with the decoupled transaction entities, we have derived the expected confirmation time required for a cross-shard transaction.
We defined the block generation time E(S) as the time interval between consecutive block-confirmation time points. We also regard a block-generation time as a service time. Let Si denote the ith block-generation time. Similar to numerous studies [
11,
12,
20,
21], we consider the block generation time of PoW to follow an exponential distribution. Therefore, we define the block-generation time, S, as adhering to the exponential distribution, described by the following formulation:
It is assumed that the sequence {Si} consists of independent and identically distributed (i.i.d.) random variables, each characterized by the distribution function G(x). Let g(x) denote the probability density function of G(x). The mean block-generation time E[S] is given by
Let ζ(x) denote the hazard rate of S, which is given by .
T denotes the transaction confirmation time, i.e., the time interval between when the user issues a transaction and when a block containing the transaction is generated [
15] (Definition 26). Let Num(t) denote the number of entities c in P at time t, and X(t) denote the elapsed service time at t. We define
,
. Given Little's theorem, we know that the long-term average number of customers (E(N), or expected transaction volume) is equal to the long-term effective arrival rate (λ, or the speed at which transactions arrive at the system) times the average waiting time of customers in the system (E(T), or transaction confirmation delay). The average transaction confirmation time can be given by
.
We next introduce the entity concept into an important formula [
12] (Theorem 1) to find the entity confirmation time.
represents the probability that P has k-1 entities during the entire system runtime. This reveals the entities' confirmation time when , the system is stable. In a system comprising M queues, each conforming to a quasi-reversible M/M/1 queue model, the composite arrival process at an individual queue retains the characteristics of a Poisson process. This holds under the condition that each customer, upon service completion, has a probability r of being routed to any other queue in the system, with each of these queues having an equal probability of of receiving the customer. Recall that an entity with k stage arrives at P according to a uniform Poisson process with rate across all queues. So we apply this theorem to a synthetic flow queue P with satisfying Poisson distribution.
However, applying (7) directly to (9) will only give the expected time
for a
to be processed. Recall that our goal is to get the expected time for a TX, so this does not meet our expectations. Knowing that
is the average expected time for c to complete the service in queue P or the average expected time for
to accept the service and transform into
, we can obtain the expected service time for a transaction to accept service in the QN queue:
(10) reveals that new arrivals are multiplied by their numbers in the target fields. Since it needs to be executed sequentially k times in different shards. According to the definition of eventual sharded blockchain in [
15] (Definition 29), a transaction or block does not confirm instantly, and several blocks at the end of a blockchain must be added to obtain stable states. Therefore,
cannot represent the expected delay of transaction confirmation, because PFQN was designed according to PoW consensus within the shard and the cross-shard consensus relay method, so it should meet the definition of Eventual sharded blockchain. Although the PFQN model is very applicable to eventual sharded blockchain, the model still needs to introduce a new queue to simulate the confirmation time of transactions in the shard's main chain.
We additionally considered the stabilizing process of transactions on the main chain by adding a new confirmation queue F at the end of queue N, which is more consistent with the actual situation of transactions being confirmed on the blockchain. F is an M/M/1 queue, i.e., both arrival and service processes follow a Poisson distribution, as shown in
Figure 2 The arrival rate
of queue F includes two entities,
and
from queue N. It is obvious that
.The confirmation queue F processes block component s with a service rate
. The average processing and waiting time of the block component, which is also the confirmation time of the transaction on the main chain, can be obtained through the waiting time formula
. Substituting
,we get
By (10) and (11), the time from a transaction being issued to being fully confirmed, E[T], can be calculated as