Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EIP 3403: Partial removal of refunds #3403

Merged
merged 15 commits into from
Mar 21, 2021
Merged

EIP 3403: Partial removal of refunds #3403

merged 15 commits into from
Mar 21, 2021

Conversation

vbuterin
Copy link
Contributor

Alternative to EIP 3298 that makes a more limited change.

@vbuterin vbuterin changed the title EIP 3402: Partial removal of refunds EIP 3403: Partial removal of refunds Mar 16, 2021
EIPS/eip-3403.md Outdated Show resolved Hide resolved
EIPS/eip-3403.md Outdated Show resolved Hide resolved
EIPS/eip-3403.md Outdated
Gas refunds additionally have multiple harmful consequences:

* Refunds give rise to [GasToken](https://gastoken.io/). GasToken has benefits in moving gas space from low-fee periods to high-fee periods, but it also has downsides to the network, particularly in exacerbating state size (as state slots are effectively used as a "battery" to save up gas) and inefficiently clogging blockchain gas usage
* Refunds increase block size variance. The theoretical maximum amount of actual gas consumed in a block is nearly twice the on-paper gas limit (as refunds add gas space for subsequent transactions in a block, though refunds are capped at 50% of a transaction's gas used). This is [not fatal](https://notes.ethereum.org/@vbuterin/eip_1559_spikes), but is still undesirable, especially given that refunds can be used to maintain 2x usage spikes for far longer than EIP 1559 can.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Refunds increase block size variance. The theoretical maximum amount of actual gas consumed in a block is nearly twice the on-paper gas limit (as refunds add gas space for subsequent transactions in a block, though refunds are capped at 50% of a transaction's gas used). This is not fatal, but is still undesirable, especially given that refunds can be used to maintain 2x usage spikes for far longer than EIP 1559 can.

EIPS/eip-3403.md Outdated
For blocks where `block.number >= FORK_BLOCK`, the following changes apply.

1. Remove the `SELFDESTRUCT` refund.
2. Remove the `SSTORE` refund in all cases except for one specific case: if _new value_ and _original value_ both equal 0 but _current value_ does not, refund 15000 gas.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel like this needs to be more specific. new value, original value, and current value aren't defined in this specification, and as a reader I don't know what you are referring to.

EIPS/eip-3403.md Outdated Show resolved Hide resolved
EIPS/eip-3403.md Outdated Show resolved Hide resolved
vbuterin and others added 5 commits March 19, 2021 11:41
Co-authored-by: Micah Zoltu <micah@zoltu.net>
Co-authored-by: Micah Zoltu <micah@zoltu.net>
Co-authored-by: Micah Zoltu <micah@zoltu.net>
Co-authored-by: Micah Zoltu <micah@zoltu.net>
EIPS/eip-3403.md Outdated Show resolved Hide resolved
EIPS/eip-3403.md Outdated Show resolved Hide resolved
EIPS/eip-3403.md Outdated Show resolved Hide resolved
EIPS/eip-3403.md Outdated
| Constant | Value |
| - | - |
| `FORK_BLOCK` | TBD |
| `SSTORE_REFUND_GAS` | 15000 |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
| `SSTORE_REFUND_GAS` | 15000 |
| `SSTORE_REFUND_GAS` | 19000 |

EIPS/eip-3403.md Outdated Show resolved Hide resolved
EIPS/eip-3403.md Outdated Show resolved Hide resolved
EIPS/eip-3403.md Outdated Show resolved Hide resolved
EIPS/eip-3403.md Outdated Show resolved Hide resolved
vbuterin and others added 2 commits March 20, 2021 15:34
Co-authored-by: Martin Holst Swende <martin@swende.se>
EIPS/eip-3403.md Outdated
Comment on lines 111 to 130
## The mutex usecase

There are two typical ways to implement mutexes: '0-1-0' and '1-2-1. Let's see how they differ

- '0-1-0':
- Istanbul: 1612
- Berlin: 212
- NoRefund: 20112
- EIP-3403: 1112
- '1-2-1':
- Istanbul: 1612
- Berlin: 212
- NoRefund: 3012
- EIP-3403: 3012


**Note**: In reality, there are never a negative gas cost, since the refund is capped at 0.5 * gasUsed.
However, these tables show the negative values, since a more real-world scenario would likely spend the
extra gas on other operations.'

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This content should be in the ## Motivation section (the "why" section aka the "use cases" section).

EIPS/eip-3403.md Outdated
Comment on lines 57 to 60
## Implementation

See https://github.com/ethereum/go-ethereum/pull/22539

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
## Implementation
See https://github.com/ethereum/go-ethereum/pull/22539

Links to external repositories should be left out as they go stale with time. Recommend linking to this in the discussions-to link. Also, this section isn't part of EIPs anymore. There is ## Reference Implementation, but that is intended to be inlined (e.g., an inline python implementation or something) and it is optional.

@MicahZoltu
Copy link
Contributor

I have been pretty busy lately so I took the liberty to apply the last couple points of feedback myself. I'm hoping this won't be too contentious, but I'm worried another round trip review may take many days/week and since this is trying to get pushed to Review phase so it can be considered it for London inclusion I thought the risk of offending someone with my changes was worth it.

@MicahZoltu MicahZoltu merged commit a302e1b into master Mar 21, 2021
@MicahZoltu MicahZoltu deleted the vbuterin-patch-1 branch March 21, 2021 12:31
phi-line pushed a commit to phi-line/EIPs that referenced this pull request Apr 29, 2021
Remove gas refunds for SELFDESTRUCT, and restrict gas refunds for SSTORE to one specific case.
PhABC pushed a commit to PhABC/EIPs that referenced this pull request Jan 25, 2022
Remove gas refunds for SELFDESTRUCT, and restrict gas refunds for SSTORE to one specific case.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants