L2 MEV Core Role: Sequencer
L2 Sequencer, as a core component of Ethereum Layer 2 solution, plays a key role. Its main task is to process transactions, that is, to package and submit them to the ETH main chain or off-chain network to improve the throughput and efficiency of the entire blockchain ecosystem. Specifically, Sequencer plays a similar role to the transaction pool on the Ethereum main chain, but the working method and scope are more specialized. In addition, L2 Sequencer also provides more operational freedom for applications and smart contracts, allowing more complex logic and contracts to be implemented at the L2 level without worrying about high gas fees.
Sequencer Transaction Processing
collect
The Sequencer receives transaction requests from users, which are usually in the format of Ethereum transactions, but they are sent to the Layer 2 network instead of the main chain.
verify
The Sequencer verifies the transaction, ensuring that the sender has sufficient funds to execute the transaction and that it complies with the rules of the Layer 2 network. It also ensures the validity of the transaction to prevent fraud and double spending.
Sorting
The Sequencer sorts transactions according to certain rules to ensure that they are executed in the correct order to prevent potential transaction conflicts.
submit
Once transactions are validated and ordered, the Sequencer submits them to the Layer 2 network so that they can be executed. This typically involves interacting with Layer 2 smart contracts, updating states, and ensuring that the ledger on Layer 2 is in sync with the ledger on the ETH main chain.
Sorting rules of different L2 sequencers
Arbitrum’s Ordering Rules
In order to avoid MEV problems as much as possible, Arbitrum does not have a public memory pool and adopts a first-come, first-served (FCFS) sorting mode, so that transactions submitted first can be processed earlier.
Optimism sorting mechanism
Optimism introduced an auction sorting mechanism, the MEV auction (MEVA), to fairly distribute the advantages and disadvantages of transaction processing. In addition, Optimism launched the Bedrock Sequencer after the Bedrock upgrade, which is used together with MEVA for sorting. Similar to Arbitrum, the Bedrock sequencer has its own private memory pool. MEVA has not been fully implemented yet, but according to the current plan, the winner of MEVA will have the right to reorder submitted transactions and insert their own transactions, but cannot delay a specific transaction for more than N blocks, which also means that the MEV profit of the MEVA winner is limited.
Ordering rules for other L2 solutions
In addition to Arbitrum and Optimism, there are many other L2 solutions such as zkSync, Loopring, Starknet, etc., each of which adopts different sorting rules to meet the needs of different users and applications.
MEV extraction in L2
In the blockchain world, the generation of MEV (miner extractable value) is the result of the interaction of multiple factors. The root cause is that there is an inevitable delay between the propagation of transaction information submitted by users in the network and the actual mining of blocks. This time difference provides space for nodes to operate. Due to the nature of decentralized systems, different nodes may receive transactions in different orders and times, which means that the system cannot guarantee that the status of all nodes is consistent at the same time. This inconsistency creates conditions for the generation of MEV.
On the Ethereum mainnet, the extraction of MEV has already generated large-scale profits. MEV attackers usually monitor transactions in the memory pool (Mempool) and ensure that their transactions are prioritized by participating in the so-called Gas Auction (bidding transaction fees to prioritize transactions) or paying bribes off-site. In this way, they can gain benefits through a predetermined transaction order.
The process of extracting MEV profits can be divided into two key steps. First, the attacker needs to identify potentially profitable transactions and construct a block of transactions optimized specifically for extracting MEV. Second, it must be possible to ensure that these specially constructed transactions are accepted by the network and included in the blockchain.
However, with the rise of Layer 2 (L2) solutions, MEV extraction methods and strategies have changed significantly. Since the sequencers of L2 solutions are often centralized, MEV extraction faces new challenges and opportunities compared with traditional Layer 1 (L1).
For those L2 solutions that do not have a memory pool, monitoring transactions becomes more difficult. In this case, the sorter has more power because it directly determines the order in which transactions are processed. The absence of a memory pool means that attackers cannot adjust the order of transactions by monitoring the transaction pool as in L1 solutions, which greatly increases the difficulty of conducting MEV attacks.
Under the control of a centralized sorter, in L2 solutions with memory pools, the impact of Gas Auction on sorting is also reduced. Some L2s even have no Gas Auction at all, which changes the rules of the game. Although attackers cannot determine the exact order of transactions, they can still try to influence the position of their own transactions by adjusting the Gas Fee. Compared with L1, the success rate and predictability of this strategy are much lower.
In addition, some independent DAPPs on L2 may maintain their own local transaction memory pools. These memory pools become potential monitoring targets for attackers, who may use these DAPP-specific memory pools to implement MEV extraction.
For L2 chains that run Gas Auction, such as Polygon, the joining of validators is not completely open and permissonless. In this case, when attackers detect MEV opportunities, they may adopt a strategy of submitting a large number of transactions to increase the possibility of their own transactions being on the chain. This strategy relies on luck and low transaction costs and is a less certain attack method.
Finally, attackers may also exploit the interaction between L1 and L2 or between different L2 solutions to extract MEV. This requires the attacker to have a deep understanding and analytical ability of cross-chain states and dynamics.
Differences in MEV extraction space between different L2s
The MEV extraction space differs significantly between different L2 solutions. These differences are mainly determined by factors such as L2's sorter rules, mempool design, transaction volume, and transaction size. Generally, the more centralized the sequencers of an L2 solution are, the more concentrated the MEV extraction space is and therefore the extraction opportunities are relatively smaller. The more open the memory pool design is, the more space is provided to attackers, and they have more opportunities for transaction monitoring and sequential operations.
At the same time, the transaction volume and transaction scale of the L2 solution also have an important impact on the MEV extraction space. L2 with large transaction volume and large transaction scale provides more opportunities to extract MEV, because in a high-traffic environment, there are more profitable transactions and attackers have more opportunities to extract profits. Conversely, L2 with small transaction volume and small transaction scale has relatively small space for MEV extraction because there are fewer opportunities.
L2 MEV Future Solutions
One of the essential problems of blockchain technology is how to achieve true decentralization. In L2, the core of this problem is the implementation of a decentralized sequencer, which is about how to distribute the right to decide the order of transactions. This directly affects the fairness, security and other key performance of the blockchain system. The MEV problem of L2 is actually a derivative problem of transaction sorting rights. At present, most L2s are centralized sequencers, and MEV extraction is opaque. There are two potential solutions. One is to achieve decentralization of the sequencer through a specific mechanism, and the other is to outsource the sorting rights to a third party, and let the third party build the sorting solution.
Decentralized Sorter
Blockspace Auction is a mechanism that allocates ranking rights through bidding. In this mechanism, participants publicly bid for block space in a specific period of time, and then have the ranking rights for that block space. The advantage of this method is its transparency and competitiveness, which can encourage participants to offer more reasonable prices. However, the disadvantage is that it may cause the "winner's curse", that is, the winner actually suffers losses due to excessive bidding.
Random leader election, which sorts by randomly selecting leaders from a pool of participants that meet certain conditions. For example, from those who have staked 32 ETH, such as Starknet's random extraction method. The advantage of this method is its randomness, which can reduce potential unfair competition, but the disadvantage is that it may ignore the ability and contribution of participants, and the lack of competition may lead to reduced efficiency.
Proof-of-Work allows many potential sorters to compete for the construction of a block, and the sorter wins by becoming the most efficient or fastest competitor. The advantage of this method is that it encourages technological innovation and efficient operation, but the disadvantage is that it may lead to a large waste of resources.
Economic competition is a method in which different participants compete to achieve the best economic results. For example, the order of block inclusion is determined based on block fees. This method is relatively flexible and has a lot of design space, such as MEV redistribution, MEV auctions, etc., which encourage everyone to build blocks through open economic mechanisms. This method encourages market vitality, but it may also allow a few entities to monopolize the right to sort through competitive advantages.
Fair Sequencing is a way to directly sort transactions through a specific algorithm. It is essentially a language and a network. Chainlink has already implemented this solution. The advantage of fair sorting is that it limits the space for extracting MEV value by adjusting the transaction order from the bottom layer, but the disadvantage is that DAPP's performance will deteriorate under fair sorting, and the applicability of fair sorting rules is not high.
The implementation of a decentralized sorter may not only promote fairness and transparency, but also improve the security of the entire system. However, it also brings a series of challenges, such as waste of resources and market barriers. From a future perspective, each L2 will move towards a decentralized sorter, but at present, for efficiency and cost considerations, most L2s should maintain a centralized sorter.
Outsourcing sorting rights to a third party
1. Shared sorters, such as Espresso and Astria. They focus on providing sorting services and organize sorting in a specific way. The chain that accesses their services does not need to consider the issue of sorting. The advantage of this approach is that the work of the sorter can be standardized and professionalized, but it may also introduce external dependencies, thus affecting the degree of decentralization. From a personal perspective, the solution of shared sorters is actually a modular idea, but we should also think that for a public chain, establishing a viable decentralized solution and mechanism for block construction and transaction sorting is itself part of building a public chain. With the rise of modularity, shared sorters may be widely used.
2. Provide sorting services in disguise by organizing cross-chain MEV auctions, such as SUAVE. SUAVE is actually a chain, and the solution using SUAVE is actually to outsource block construction and memory pool services to SUAVE. The characteristics of SUAVE include: SUAVE itself does not capture MEV (except gas fee); searchers (who express their preferences on SUAVE) extract MEV by requiring executors to accept their transaction packages (including cross-chain MEV); executors can also capture part of the searcher's MEV (paying as much back to the searcher as possible). The advantage of this approach is that resource allocation can be optimized through the open market, and the disadvantage is that it may increase the complexity of the system and may reduce the level of decentralization to a certain extent.
3. Outsource block construction to L1, i.e. Based Rollup (e.g. Taiko). L1 has built a sufficiently decentralized system and is capable of providing decentralized sorting services. Based Rollup’s MEV extraction method is as follows: MEV naturally flows to Ethereum, strengthening the economic security of L1; L2 searchers (creating L2 transaction packages) and L2 builders (who can run mev-boost) can also get a portion of MEV; if L2 searchers monitor the Ethereum memory pool, the Rollup-based memory pool, and the status of the two chains, cross-chain MEV value can also be captured. This solution is more feasible, but the disadvantage is that the upper limit will not exceed the current solution. Ethereum has a large MEV extraction space under the current architecture. If the sorting rights are handed over to L1, this will not improve the MEV ecosystem.
Outsourcing block proposal work to a third party can bring the advantages of resource optimization and risk diversification, but it also poses a potential threat to decentralization.
L2 MEV Data
The dune panel created by Dragonfly data analyst @hildobby shows some L2 MEV data.
Polygon
Sandwich attacks on Polygon are relatively rare, most of the time less than 1%. In September of this year, it reached a peak of about 2.3%. Based on the transaction volume, the transaction volume affected by the sandwich attack is very low.
Sandwich Trading Ratio
Sandwich Trading Volume
The proportion of arbitrage transactions on the Polygon network is higher, and the transaction volume is significantly larger than the sandwich attack.
Arbitrage trading ratio
Arbitrage volume
Decision
Since 2023, the proportion of sandwich attacks in Arbitrum block transactions has dropped to a sufficiently low level. In terms of transaction volume, the total transaction volume is billions of dollars, while the transaction volume involved in sandwich attacks is only hundreds of thousands of dollars, which is also very small. This may be related to the transaction sorting rules of Arbitrum FIFO.
Sandwich Trading Ratio
Sandwich Trading Ratio
The percentage of arbitrage trades on Arbitrum is relatively small compared to other chains. However, the volume of arbitrage trades is still much larger than sandwich trades on Arbitrum.
Arbitrage trading ratio
Arbitrage volume
Optimism
On Optimism, the situation is different. The proportion of sandwich attacks in block transactions was as high as 62.7% at one point, but has gradually decreased over time due to the bedrock upgrade that introduced a gas mechanism similar to EIP-1559. Recently, the proportion of sandwich attacks has dropped to a low enough level that the size of sandwich attacks has been reduced to a few thousand dollars in terms of transaction volume.
Sandwich Trading Ratio
Sandwich Trading Volume
On Optimism, the percentage of arbitrage trading is between 2% and 4%, showing a downward trend compared to last year. The volume of arbitrage trading is relatively low.
Arbitrage trading ratio
Arbitrage trading ratio
Summarize
In general, the relationship between L2 Sequencer and MEV is of great significance to the development of the ETH ecosystem. At present, the challenge facing L2 is to ensure a fair and transparent sorting mechanism to prevent the extraction of MEV. However, the complexity and diversity of L2 solutions bring many challenges, including how to resist MEV, ensure a fair and transparent sorting mechanism, etc. At the current stage, there are already some feasible solutions, such as Shared Sequencer, and cryptographic methods to protect the privacy of transaction sorting.
In the future, practical solutions may focus more on the decentralization of Sequencer to reduce the potential MEV extraction space. At the same time, it is also possible to consider outsourcing block generation to a third party to improve the fairness and efficiency of the entire network system. On the other hand, the emergence of cross-chain MEV requires us to re-examine the definition and importance of MEV and explore new solutions such as Slot Auctions and Interchain Scheduler. In addition, future research issues include how to quantify MEV on the L2 chain, the impact of PGA on L2, etc. The solution of these problems will help further improve the MEV resistance strategy in the L2 field.