Shoal solves two main problems with Bullshark:
- The first problem is that Bullshark requires a timeout in order to prevent livelocks. A livelock is a situation where two or more nodes are continuously sending messages to each other, but neither one can make progress. The timeout prevents this by ensuring that nodes will eventually give up and try again. However, the timeout adds latency to the protocol.
- The second problem is that Bullshark’s latency is not deterministic. The latency of a transaction depends on the number of nodes that are participating in the consensus round. This can make it difficult to predict how long a transaction will take to be confirmed.
Shoal solves these problems by introducing two new features:
- Pipelining: Shoal allows multiple transactions to be processed in parallel, which reduces the latency of the protocol.
- Leader reputation: Shoal assigns a reputation to each leader, which is based on how quickly they have processed transactions in the past. This reputation is used to bias the selection of leaders towards fast leaders, which further reduces the latency of the protocol.
Overall, Shoal has been shown to reduce the latency of Bullshark by 40% in the failure-free case and by 80% in the failure case. This makes Aptos one of the most latency-efficient blockchains in the world.
Here are some additional details about Shoal:
- Pipelining: Pipelining is a technique that allows multiple transactions to be processed in parallel. This is done by dividing the transactions into batches, and then processing each batch in a separate round. This reduces the latency of the protocol because it allows transactions to be processed more quickly.
- Leader reputation: Leader reputation is a mechanism that is used to bias the selection of leaders towards fast leaders. This is done by assigning a reputation to each leader, which is based on how quickly they have processed transactions in the past. The leader with the highest reputation is then more likely to be selected as the leader for the next round. This helps to ensure that the protocol is as efficient as possible.