深度解读L2 MEV:排序器工作流与MEV数据分析

avatar
DODO 研究院
9 months ago
This article is approximately 2597 words,and reading the entire article takes about 4 minutes
L2 Sequencer 与 MEV 互动的深层分析,洞察其对加密生态的影响力。

Original author: Burce, Hildobby

Original editor: Lisa

* Thanks to Dragonflys data analyst Hildobby for supporting L2 MEV data.

L2 MEV core role: Sequencer

L2 Sequencer, as the core component of the 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 its working method and scope are more specialized. In addition, L2 Sequencer also provides applications and smart contracts with more operational freedom, allowing more complex logic and contracts to be implemented at the L2 level without worrying about high gas costs.

Sequencer process of processing transactions

1. collect

Sequencer receives transaction requests from users, these requests are usually in the format of Ethereum transactions, but they are sent to the Layer 2 network instead of the main chain.

2.Verification

The Sequencer verifies the transaction to ensure that the sender has sufficient funds to execute the transaction and complies with the rules of the Layer 2 network. It also ensures the validity of transactions to prevent fraud and double spending.

3. Sort

Sequencer sorts transactions according to certain rules to ensure they are executed in the correct order to prevent potential transaction conflicts.

4. Submit

Once transactions are verified and sequenced, 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 state, and ensuring that the ledger on Layer 2 is synchronized with the ledger on the ETH main chain.

Sorting rules for different L2 Sequencers

Arbitrums sorting rules

In order to avoid the MEV problem as much as possible, Arbitrum does not have a public memory pool and adopts a first-come-first-served (FCFS) sorting model so that transactions submitted first can be processed earlier.

Optimism’s sorting mechanism

Optimism introduces an auction ranking mechanism, namely 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 for sequencing together with MEVA. Similar to Arbitrum, Bedrock sequencer has its own private memory pool. MEVA has not been fully implemented yet, but according to the current plan, MEVA winners 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 MEVA winners MEV profits are subject to limit.

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 ordering rules to meet the needs of different users and applications.

深度解读L2 MEV:排序器工作流与MEV数据分析

MEV extraction in L2

In the blockchain world, the generation of MEV (Miner Extractable Value) is the result of a combination of factors. The root cause is the inevitable delay between the transaction information submitted by users being propagated in the network and the actual blocks being mined. This time difference gives nodes room to operate. Due to the nature of a decentralized system, different nodes may receive transactions in different orders and at different times, which means that the system cannot guarantee that the status of all nodes at the same time is consistent. This inconsistency creates conditions for the emergence of MEV.

On the Ethereum mainnet, the withdrawal of MEV has generated large-scale profits. MEV attackers usually monitor transactions in the Mempool and ensure that their transactions are prioritized by participating in so-called Gas Auction (bidding transaction fees to prioritize transactions) or by paying bribes over the counter. In this way, they are able to obtain benefits through a predetermined sequence of transactions.

The process of earning MEV profits can be broken down into two key steps. First, the attacker needs to identify potentially profitable transactions and construct a transaction block specifically optimized for extracting MEV. Secondly, it is necessary to ensure as much as possible that these specially constructed transactions can be 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 without mempools, monitoring transactions becomes more difficult. In this case, the sequencer 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.

In L2 solutions with memory pools under the control of a centralized sorter, the impact of Gas Auction on sorting is also reduced. Some L2s even have no Gas Auction at all, which is a game changer. Although attackers cannot determine the exact order of transactions, they can still try to influence the position of their transactions by adjusting the Gas Fee. Compared to L1, the success rate and predictability of this strategy is much lower.

In addition, some independent DAPPs on L2 may maintain their own local transaction memory pool. These memory pools have become potential monitoring targets for attackers, who may use these DAPP-specific memory pools to implement MEV extraction.

For those L2 chains that run Gas Auction, such as Polygon, the addition of validators is not completely open and thresholdless. 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 uploaded to the chain. This strategy relies on luck and low transaction costs and is a less deterministic attack method.

Finally, attackers may exploit interactions between L1 and L2 or between different L2 solutions to extract MEV. This requires attackers to have a deep understanding and analysis of cross-chain status and dynamics.

Differences in MEV extraction space between different L2s

The MEV extraction space varies significantly between different L2 solutions. These differences are mainly determined by factors such as L2s sorter rules, memory pool design, transaction volume, and transaction size. Generally, the more centralized the sequencer of an L2 solution is, 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 size of L2 solutions also have an important impact on the MEV extraction space. L2 with large transaction volume and transaction size 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. On the contrary, for L2 with small transaction volume and transaction size, the space for MEV extraction is relatively small because the opportunities themselves are few.

L2 MEV future solutions

One of the essential issues of blockchain technology is how to achieve true decentralization. In L2, the core of this problem is the implementation of the decentralized sequencer, which is related to how the order decision-making power of transactions is allocated. 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 ordering weight. At present, most L2 are centralized sorters, and MEV extraction is opaque. There are two potential solutions. One is to decentralize the sorter through a specific mechanism, and the other is to outsource the sorting right to a third party. third party to build the sorting scheme.

Decentralized sorter

  • Blockspace Auction realizes the allocation of sorting rights through bidding. In this mechanism, participants publicly bid for block space for a specific period of time and then have the right to sort the block space. The advantage of this approach is that it is transparent and competitive, which can encourage participants to offer more reasonable prices. However, the disadvantage is that it may create a winners curse, where the winner actually suffers a loss due to excessive bidding.

  • Random leader election, which is ordered by randomly selecting a leader from a pool of participants that meet certain conditions. For example, select from those users who have pledged 32 ETH, such as Starknets random drawing method. The advantage of this method is its randomness, which can reduce potential unfair competition, but the disadvantage is that the abilities and contributions of participants may be ignored, and the lack of competition may lead to a decrease in efficiency.

  • Proof-of-Work, by allowing many potential sequencers to compete for the construction of a certain block, the sequencer wins by becoming the most efficient or fastest competitor. The advantage of this approach 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 block inclusion order is determined based on the block fee. This method is more flexible and has a lot of room for design, such as MEV redistribution, MEV auction, etc., and encourages everyone to build blocks through an open economic mechanism. This approach encourages market dynamism, but it is also possible for a few entities to monopolize the right to sort through competitive advantage.

  • Fair Sequencing is a way of directly sorting transactions through a specific algorithm. It is essentially a language and network. Chainlink has now implemented this solution. The advantage of fair sorting is that it limits the space for extracting MEV value from the bottom by adjusting the transaction sequence. However, the disadvantage is that the performance of DAPP under fair sorting will become worse, and the applicability of fair sorting rules is not high. .

The implementation of a decentralized sorter has the potential not only to promote fairness and transparency, but also to improve the security of the entire system. However, it also brings a series of challenges, such as resource waste and market barriers. From a future perspective, each L2 will develop in the direction of decentralized sorters, but currently, for efficiency and cost considerations, most L2s should maintain centralized sorters.

Outsource sorting rights to a third party

  • Shared sequencers such as Espresso and Astria. They focus on providing sorting services and organize sorting in a specific way. The chain connected to their service does not need to consider the issue of sorting itself. The benefit of this approach is that it can standardize and specialize the work of the sequencer, but it may also introduce external dependencies, thus affecting the degree of decentralization.

  • From a personal point of view, the solution of sharing the sequencer is actually a modular idea, but we should also think about it. For a public chain, establishing a feasible decentralized solution and mechanism for block construction and transaction ordering is itself a construction Part of the public chain. As modularity takes off, shared sequencers are likely to become more widely used.

  • By organizing cross-chain MEV auctions, ordering services are provided in disguise, 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.

  • Features of SUAVE include: SUAVE itself does not capture MEV (except for gas fees); searchers (expressing their preferences on SUAVE) extract MEV by asking executors to accept their transaction packages (including cross-chain MEV); executors can also Capture a portion of the searchers MEV (pay back as much as possible to the searcher). The advantage of this approach is that it can optimize resource allocation through the open market, but the disadvantage is that it may increase system complexity and may reduce the level of decentralization to a certain extent.

  • Outsource block construction to L1, or Based Rollup (e.g. Taiko).

  • L1 has built a sufficiently decentralized system to provide decentralized sorting services. Based Rollups MEV extraction method is as follows: MEV naturally flows to Ethereum, which strengthens the economic security of L1; L2 searchers (create L2 transaction packages) and L2 builders (can run mev-boost) can also be divided into part MEV; cross-chain MEV value can also be captured if an L2 searcher monitors the Ethereum memory pool, the Rollup-based memory pool, and the status of both chains. 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 power is given to L1, this will not improve the MEV ecology.

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 Dragonflys data analyst @hildobby shows some of the L2 MEV data.

Polygon

Sandwich attacks on Polygon are relatively rare, less than 1% most of the time. In September this year, it peaked at about 2.3%. Based on the transaction volume, the transaction volume affected by the sandwich attack is very low.

深度解读L2 MEV:排序器工作流与MEV数据分析

Sandwich transaction ratio

深度解读L2 MEV:排序器工作流与MEV数据分析

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.

深度解读L2 MEV:排序器工作流与MEV数据分析

Arbitrage trade ratio

深度解读L2 MEV:排序器工作流与MEV数据分析

Arbitrage volume

Arbitrum

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 in the billions of dollars, while the transaction volume involved in the sandwich attack is only a few hundred thousand dollars, which is also very small. This may be related to the transaction ordering rules of Arbitrum FIFO.

深度解读L2 MEV:排序器工作流与MEV数据分析

Sandwich transaction ratio

深度解读L2 MEV:排序器工作流与MEV数据分析

Sandwich transaction ratio

The proportion of arbitrage trading on Arbitrum is relatively small compared to other chains. However, the volume of arbitrage trading is still much higher compared to sandwich trading on Arbitrum.

深度解读L2 MEV:排序器工作流与MEV数据分析

Arbitrage trade ratio


深度解读L2 MEV:排序器工作流与MEV数据分析

Arbitrage volume

Optimism

On Optimism, things are different. The proportion of sandwich attacks in block transactions was once as high as 62.7%, but has gradually decreased over time because the bedrock upgrade introduced a gas mechanism similar to EIP-1559. Recently, the proportion of sandwich attacks has dropped to sufficiently low levels. In terms of transaction volume, the size of sandwich attacks has been reduced to a few thousand dollars.

深度解读L2 MEV:排序器工作流与MEV数据分析

Sandwich transaction ratio

深度解读L2 MEV:排序器工作流与MEV数据分析

sandwich trading volume

On Optimism, the proportion of arbitrage trades ranges between 2% and 4%, showing a downward trend compared to last year. The trading volume of arbitrage trades is relatively low.

深度解读L2 MEV:排序器工作流与MEV数据分析

Arbitrage trade ratio

深度解读L2 MEV:排序器工作流与MEV数据分析

Arbitrage trade ratio

Summarize

Generally speaking, the relationship between L2 Sequencer and MEV is of great significance to the development of the ETH ecosystem. Currently, the challenge faced by L2 is to ensure a fair and transparent sorting mechanism to prevent the extraction of MEV. However, the complexity and diversity of L2 solutions have brought 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 encryption methods to protect the privacy of transaction sequencing.

In the future, practical solutions may focus more on the decentralization of Sequencer to reduce potential MEV extraction space. At the same time, you can also 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 questions include how to quantify MEV on the L2 chain, the impact of PGA on L2, etc. Solving these issues will help further improve MEV resistance strategies in the L2 field.

Original article, author:DODO 研究院。Reprint/Content Collaboration/For Reporting, Please Contact report@odaily.email;Illegal reprinting must be punished by law.

ODAILY reminds readers to establish correct monetary and investment concepts, rationally view blockchain, and effectively improve risk awareness; We can actively report and report any illegal or criminal clues discovered to relevant departments.

Recommended Reading
Editor’s Picks