- The gas price suggestion.
- Pre-execution of transactions.
Gas price suggestion
The L2 network (the zkEVM) polls for L1 gas price values and uses them to:- Suggest L2 gas price to users as per user requests.
- Sets the minimum acceptable L2 gas price, denoted by .
Pre-execution of transactions
Pre-execution of transactions, which happens at the RPC level, involves estimating the gas required for processing the transactions submitted by the users. This is internally measured (internal to the zkEVM) in terms of resources spent to execute the transactions. These resources are the numbers of counters used up in the zkEVM ROM. A transaction is said to be out of counters (OOC) if the signed gas price is insufficient to pay for the required gas units. OOC transactions get rejected straight away, while those with no OOC stand a chance to be added to the pool. At this stage of the flow, the RPC also computes the “breakeven gas price”, denoted by . That is, where is the L2’s marginal profit for transaction processing. Transactions with no OOC get added to the pool of transactions if,- Either . where is the RPC’s estimated gas cost.
- Or .

Example (RPC tx flow)
Consider a scenario where a user sends a query for a suggested gas price during a 5-minute interval, as shown in the figure below. Values of L1 gas prices, polled every 5 seconds, are displayed above the timeline, while the corresponding L2 gas prices are depicted below the timeline. See the figure below.
- Observe that, in the above timeline, the user sends a query at the time indicated by the dotted-arrow on the left. And that’s when is . The RPC node responds with a , as the value of the suggested L2 gas price. This value is obtained as follows: where is the zkEVM’s suggested factor.
- Let’s suppose the user sends a transaction signed with a gas price of . That is, . However, by the time the user sends the signed transaction, the L1 gas price is no longer but . And its correponding suggested gas price is . Note that the minimum suggested L2 gas price, in the 5-min time interval, is . And since the transaction gets accepted for pre-execution.
- At this point, the RPC makes a request for pre-execution. That is, getting an estimation for the gas used, computed with a state root that differs from the one used when the transaction is sequenced. In this case, suppose an estimation of gas used is , without an out of counters (OOC) error.
- Since there’s no out of counters (OOC) error, the next step is to compute the . Suppose it works out to be: (Details on how this calculation are covered later in the Implementing EGP strategy section.)
- As noted in the outline of the RPC transaction flow, one more check needs to be done. That is, testing whether: Using the yields: And since , the transaction is not immediately stored in the transaction pool.
- However, since and despite the risk of the network sponsoring the transaction, it is included in the transaction pool.