How does Sui's mempool differentiate from other chains?

Can someone help me understand the basics of Sui’s mempool in relation to other chains? The docs are too big brain for me.

As I understand it EVM chains use a mempool that can be a bottleneck for many things. Solana doesn’t use a mempool? Sui uses a mempool but it’s highly optimized with some DAG?

What benefits does a mempool have, what does Solana use instead, and how does Sui differentiate its mempool or usage of it such that it limits or removes the limitations compared to EVM chains and their mempools?

1 Like

Just to add to this, I don’t have the answer but was also curious and posted the original Q. on discord, and found this while looking into it:

  • Mempools are used kind of like a processing center for broadcasted transactions to get them onto the chain
  • Solana uses Gulf Stream rather than mempool, so transactions are sent directly to the leader that then finalizes it into the chain.

To me it sounds like Gulf Stream is a far more performant and scalable solution than a mempool, but I’m not so sure about the details. Is Sui’s unique object-like storage more suited to a mempool? I guess my main question is why was a mempool chosen over something like Gulf Stream for Sui, and how does Narwhal/Sui handle issues of too many unconfirmed transactions getting backed up, or if gas prices can be manipulated, and whatever issues that plague EVM chains with their mempool issues.

Hi all, this is George here from the mysten team, and co-designer of Narwhal, which is the component that plays the role of the mempool in Sui.

So what is a mempool? It is a way for transactions to find their way to validators, so that they stand a chance of being included in consensus commits, sequenced and executed. In ETH type chains the mempool is a gossip network: all transactions make their way to all miners / validators, and the leader (either through PoW or PoS) grabs some of the available transactions to make a block to extend the chain. So all transactions end up in all validators and then all blocks containing them are re-distributed again to all validators - its a heavy process.

Sui uses a more structured approach to this problem, through the use of the Narwhal (mempool) / Bullshark (consensus) design for consensus. In Narwhal, all validators build blocks and share them with all others. In turn new blocks are created that refer to the previous ones. As a result a transaction that is included in a Narwhal block is disseminated to all others, and probably included in future blocks. This is the data dissemination function fulfilled. Consensus can then refer to a block in Narwhal and commit its full history of transactions contained in all blocks contributed by all validators.

Ultimately this is just a different approach to how to distribute transactions. But it has some theoretical and empirical benefits. In theory transactions only need to be distributed once, directly, and without gossip which leads to low latency. Workers can be used to further increase capacity (although even one worker exceeds the throughput of any chain so far). In practice we have observed a very large amount of data being able to be shared that way, and then committed.

I am far from an expert on Solana, so probably someone else should compare this with their approach.

2 Likes

Basically having a mempool means there is another p2p network going on before the blocks of the blockchain is even formed, that is based around propagating transactions peer to peer to random/semirandom other nodes.

Some people think this is good it allows for visibility of transactions before they are “committed” and makes for an additional layer of decentralisation. One thing to note here is that there is no “global mempool”, it is just a theoretical idea of all the transactions getting gossiped (moved around) in the system, but each node will always have an imperfect view of it. (This is why for MEV, there are agents called searchers that try to get as perfect as a view as possible of the mempool!).

Solana

Well as you can guess, it can be seen as a waste to send transactions to nodes other than the current leader of the blockchain (the node that is tasked with building a block). So in Solana, they decided to skip this part by having it be “semi” known ahead of time who the leader is. Now nodes can directly just send transactions to the leader as its known ahead of time! No need to waste time on “gossip”!

Actually, nodes can even know the upcoming leaders to a certain extent! Which allows Solana to go even further - you can send transactions to the leader AND the upcoming leaders in the case that you don’t fit into the current block.

But this of course introduces an issue, how do we order these transactions and not have duplicates?

This is where the “proof of history” thing comes in, which is an internal clock that allows everyone to follow the same sense of “time”. With a global clock, transaction ordering is predetermined to be kinda FIFO.

More on gulf stream: Gulf Stream: Solana’s Mempool-less Transaction Forwarding Protocol | by Anatoly Yakovenko | Solana | Medium

You can also probably sense that MEV gets weird with the above model. You can also know understand why Solana needs beefy compute and high networking capacity.

Narwhal

Now funnily enough, Narwhal also approaches performance improvements from the same angle. The creators also thought that the p2p network is holding us back.

I think @georged already explained Narwhal well above, so I will not dive to deep into it. From what I understand, its about everyone propagating blocks constantly, as well as some kind of compressed form of a series of blocks. These are then accepted to the chain via some kind of verification method.

Its very interesting to kinda compare the two approaches and realize that they are trying to solve the same problem - both identify the gossip layer as a bottleneck.

Solana - Removes gossiping by making the leaders known beforehand
Narwhal - Removes gossiping transactions by… gossiping blocks?

Solana - Solves ordering by having universal time and using FIFO
Narwhal - Individual nodes order inside blocks, but blocks are ordered by round number.

Correct me if im wrong about the above and if you have further questions please DM me on twitter:
https://twitter.com/joakimhi

1 Like