-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
Conversation
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. |
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
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.
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>
Co-authored-by: Micah Zoltu <micah@zoltu.net>
EIPS/eip-3403.md
Outdated
| Constant | Value | | ||
| - | - | | ||
| `FORK_BLOCK` | TBD | | ||
| `SSTORE_REFUND_GAS` | 15000 | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| `SSTORE_REFUND_GAS` | 15000 | | |
| `SSTORE_REFUND_GAS` | 19000 | |
Co-authored-by: Martin Holst Swende <martin@swende.se>
EIPS/eip-3403.md
Outdated
## 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.' | ||
|
There was a problem hiding this comment.
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
## Implementation | ||
|
||
See https://github.com/ethereum/go-ethereum/pull/22539 | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
## 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.
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. |
Remove gas refunds for SELFDESTRUCT, and restrict gas refunds for SSTORE to one specific case.
Remove gas refunds for SELFDESTRUCT, and restrict gas refunds for SSTORE to one specific case.
Alternative to EIP 3298 that makes a more limited change.