Commit 7bf56d64 authored by Mark Tyneway's avatar Mark Tyneway

specs: guaranteed gas market cleanup

Adds in an additional section explaining that the gas burn
helps with sybil resistance, to prevent network spam on L2.
It was not clear that this was the case when reading the doc.
Also clean up the pseudocode.
parent ce9e7f21
...@@ -11,9 +11,9 @@ ...@@ -11,9 +11,9 @@
<!-- END doctoc generated TOC please keep comment here to allow auto update --> <!-- END doctoc generated TOC please keep comment here to allow auto update -->
[Deposited transaction](./glossary.md#deposited-transaction) are transactions on L2 that are [Deposited transaction](./glossary.md#deposited-transaction) are transactions on L2 that are
initiated on L1. The gas that they use on L2 is bought on L1 via a gas burn or a direct payment. We initiated on L1. The gas that they use on L2 is bought on L1 via a gas burn (or a direct payment
maintain a fee market and hard cap on the amount of gas provided to all deposits in a single L1 in the future). We maintain a fee market and hard cap on the amount of gas provided to all deposits
block. in a single L1 block.
The gas provided to deposited transactions is sometimes called "guaranteed gas". The gas provided to The gas provided to deposited transactions is sometimes called "guaranteed gas". The gas provided to
deposited transactions is unique in the regard that it is not refundable. It cannot be refunded as deposited transactions is unique in the regard that it is not refundable. It cannot be refunded as
...@@ -56,9 +56,9 @@ at a multiple of the target, we enable deposits to temporarily use more L2 gas a ...@@ -56,9 +56,9 @@ at a multiple of the target, we enable deposits to temporarily use more L2 gas a
# the ability of the account to afford this gas. # the ability of the account to afford this gas.
BASE_FEE_MAX_CHANGE_DENOMINATOR = 8 BASE_FEE_MAX_CHANGE_DENOMINATOR = 8
ELASTICITY_MULTIPLIER = 4 ELASTICITY_MULTIPLIER = 4
MAX_RESOURCE_LIMIT = 8,000,000 MAX_RESOURCE_LIMIT = 8_000_000
TARGET_RESOURCE_LIMIT = MAX_RESOURCE_LIMIT / ELASTICITY_MULTIPLIER TARGET_RESOURCE_LIMIT = MAX_RESOURCE_LIMIT / ELASTICITY_MULTIPLIER
MINIMUM_BASEFEE=10000 MINIMUM_BASEFEE = 10000
# prev_basefee is a u128, prev_bought_gas and prev_num are u64s # prev_basefee is a u128, prev_bought_gas and prev_num are u64s
prev_basefee, prev_bought_gas, prev_num = <values from previous update> prev_basefee, prev_bought_gas, prev_num = <values from previous update>
...@@ -108,6 +108,10 @@ store_values(now_basefee, now_bought_gas, now_num) ...@@ -108,6 +108,10 @@ store_values(now_basefee, now_bought_gas, now_num)
## Rationale for burning L1 Gas ## Rationale for burning L1 Gas
There must be a sybil resistance mechanism for usage of the network. If it is very cheap to get
guaranteed gas on L2, then it would be possible to spam the network. Burning a dynamic amount
of gas on L1 acts as a sybil resistance mechanism as it becomes more expensive with more demand.
If we collect ETH directly to pay for L2 gas, every (indirect) caller of the deposit function will need If we collect ETH directly to pay for L2 gas, every (indirect) caller of the deposit function will need
to be marked with the payable selector. This won't be possible for many existing projects. Unfortunately to be marked with the payable selector. This won't be possible for many existing projects. Unfortunately
this is quite wasteful. As such, we will provide two options to buy L2 gas: this is quite wasteful. As such, we will provide two options to buy L2 gas:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment