You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/zkEVM/architecture/user-fees.md
+15-17Lines changed: 15 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,6 @@
1
1
The aim with this document is to describe the Effective Gas Price (EGP), a mechanism by which the Polygon zkEVM network charges gas fees in a more fair and accurate manner. These fees cover L1 data-availability and L2 execution costs. It is meant to help users set the $\texttt{gasPrice}$ such that there's little chance for a transaction revert or failure.
2
2
3
3
4
-
5
4
## Basic Ethereum fee schema
6
5
7
6
Let's make a quick recollection of the basic fee schema used in Ethereum.
The total fees received by L2 are calculated with the following formula:
430
432
431
433
$$
432
434
\texttt{GasUsed} \cdot \texttt{L2GasPrice}
@@ -440,7 +442,7 @@ $$
440
442
441
443
In particular, we choose a factor of $0.04$.
442
444
443
-
In contrast to costs for data availability, calculating computational costs necessecitates transactions to be executed.
445
+
444
446
445
447
446
448
@@ -838,11 +840,7 @@ Let’s examine the above figure in more detail.
838
840
Recall that the $\texttt{GasUsedRPC}$ is obtained in the RPC pre-execution using;
839
841
840
842
- A previous state root, which has now changed, and
841
-
- The current $\texttt{L1GasPrice}$, which may also differ from the one used when sending the transaction to the RPC, for all the transactions stored in the Pool, and sequence the one having higher $\texttt{EEGP}$.
842
-
843
-
It is important to note that this should be done in this precise order.
844
-
845
-
We could have calculated the $\texttt{EEGP}$ just before storing the transactions in the Pool and sorting it by EEGP, but this would not yield the same result because the $\texttt{L1GasPrice}$ at that moment is different from the one at the time of sequencing a transaction, potentially changing the $\texttt{EEGP}$ as well as the prioritization order of transactions.
843
+
- The current $\texttt{L1GasPrice}$, which may also differ from the one used when sending the transaction to the RPC.
0 commit comments