EIP-3300: Phase Out Refunds#3300
Conversation
|
GasTokens are effectively an exploit, and their authors warned that it may be fixed at core devs leisure. It's not our fault that certain people hoarded them against this advice. And most certainly it shouldn't lead to stretching out selfdestruct phase out. |
|
Use the discussions-to URL
…On Sat, Feb 27, 2021 at 10:53 AM Artem Vorotnikov ***@***.***> wrote:
GasTokens are effectively an exploit, and their authors warned that it may
be fixed at core devs leisure.
It's not our fault that certain people hoarded them against this advice.
And most certainly it shouldn't lead to stretching out selfdestruct phase
out.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#3300 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAGDGVJOCDYOTWPAFLGSHLDTBE5TJANCNFSM4YJKZMHA>
.
|
MicahZoltu
left a comment
There was a problem hiding this comment.
Some changes required to the formatting and the metadata. My comments about improving the specification section can be dealt with sometime before Review.
EIPS/eip-3300.md
Outdated
| On the block this EIP activates, and again every 100 blocks, the gas refunds for `SELFDESTRUCT` and `SSTORE` would diminish by 1, until reaching their refund activation cost. | ||
| When reaching their refund activation cost, refunds will be removed. | ||
| The refund activation cost of `SSTORE` is defined to be the lowest possible opcode cost of setting a nonzero value to zero. | ||
| The refund activation cost of `SELFDETRUCT` is defined to be the lowest possible opcode cost of `SELFDESTRUCT`. |
There was a problem hiding this comment.
It would be valuable to spec this out a little more clearly. Defining the refund provided for each operation as a function of block number would be the best I think. It would also be good to include details on how this interacts with the various refunds of SSTOREs based on their previous and new values and mention how this interacts with the SSTORE counters from EIP-1283.
There was a problem hiding this comment.
The lack of clarification is deliberate because the SSTORE pricing seems to change with every hard fork, and might be changed again in London. But I can be more absolute.
There was a problem hiding this comment.
I see why the prior specification was insufficient; metering approaches can be complex. If 2929 happens in Berlin I'll specify that behavior too, but it currently seems to be excluded from the hard fork meta.
There was a problem hiding this comment.
https://github.com/ethereum/eth1.0-specs/blob/master/network-upgrades/berlin.md
2929 is definitely on board for Berlin.
There was a problem hiding this comment.
Okay. I thought perhaps it was removed because it wasn't in EIP-2070.
Co-authored-by: Micah Zoltu <[email protected]>
Co-authored-by: Micah Zoltu <[email protected]>
Co-authored-by: Micah Zoltu <[email protected]>
Co-authored-by: Micah Zoltu <[email protected]>
Co-authored-by: Micah Zoltu <[email protected]>
Co-authored-by: Micah Zoltu <[email protected]>
Co-authored-by: Micah Zoltu <[email protected]>
Co-authored-by: Micah Zoltu <[email protected]>
|
I think removing the early removal "activation cost" specification is worth it for simplification. It also plays nicer with metering. |
MicahZoltu
left a comment
There was a problem hiding this comment.
Minor cleanup suggestions for consistency with one real suggestion. Nothing blocking merge as draft though.
| There is also a case where `SSTORE_CLEARS_SCHEDULE` is removed from the refund counter. | ||
| That removal will also diminish by `REFUND_DECAY_STEP` until 0, maintaining the non-negative refund counter invariant. | ||
|
|
||
|
|
|
|
||
| This change is less work for the protocol developers than compensation and cleanup, while likely still achieving cleanup. | ||
|
|
||
|
|
| * `SSTORE_SET_GAS - SLOAD_GAS` (20000 - 100) | ||
| * `SSTORE_CLEARS_SCHEDULE` (15000) | ||
|
|
||
|
|
|
|
||
| For gas-cost regimes with refund removals that cancel prior refunds, the invariant that the refund counter cannot go negative will be preserved by diminishing the magnitude of those removals by `REFUND_DECAY`, until 0. | ||
|
|
||
|
|
| Computed: | ||
| * `REFUND_DECAY`: `REFUND_DECAY_STEP * ceil((block.number + 1 - FORK_BLOCK_NUM) / REFUND_DECAY_FREQUENCY)` | ||
|
|
||
|
|
| The rate of diminishing specified would currently require (24000-5000) * 100 = 1,900,000 blocks for `SELFDESTRUCT` and (15000-5000) * 100 = 1,000,000 blocks for `SSTORE`. | ||
| This timeframe is currently about a year, which should be enough flexibility for the remaining refunds to be consumed. | ||
|
|
||
|
|
| ### EIP-2929 | ||
| The refunds as of EIP-2929 are as follows: |
There was a problem hiding this comment.
| ### EIP-2929 | |
| The refunds as of EIP-2929 are as follows: | |
| The refunds are as follows: |
Ideally, we should try to avoid creating dependencies between EIPs (when possible) and instead prefer to just assert the new behavior. This way, the EIP makes sense with or without the dependent EIP or knowledge of it. In this case, we can just state the new gas refunds as of this EIP's implementation and ignore 2929's existence.
|
|
||
| ## Specification | ||
| Parameters: | ||
| * `FORK_BLOCK_NUM`: EIP-3300 activation block |
There was a problem hiding this comment.
| * `FORK_BLOCK_NUM`: EIP-3300 activation block | |
| * `FORK_BLOCK_NUM`: TBD |
The common way to handle this is to just say TBD here.
|
Thanks for the review @MicahZoltu |
* wip phase out refunds * update create date and eip number * discussions-to * rename file to eip# * fix discussions-to url error from Travis * Update EIPS/eip-3300.md Co-authored-by: Micah Zoltu <[email protected]> * Update EIPS/eip-3300.md Co-authored-by: Micah Zoltu <[email protected]> * Update EIPS/eip-3300.md Co-authored-by: Micah Zoltu <[email protected]> * Update EIPS/eip-3300.md Co-authored-by: Micah Zoltu <[email protected]> * Update EIPS/eip-3300.md Co-authored-by: Micah Zoltu <[email protected]> * Update EIPS/eip-3300.md Co-authored-by: Micah Zoltu <[email protected]> * Update EIPS/eip-3300.md Co-authored-by: Micah Zoltu <[email protected]> * Update EIPS/eip-3300.md Co-authored-by: Micah Zoltu <[email protected]> * initial clarification * specify 1283 behavior * specify negative refund removal * start specifying activation costs and then simplify by disregarding them * cleanup activation cost specifications Co-authored-by: Micah Zoltu <[email protected]>
* wip phase out refunds * update create date and eip number * discussions-to * rename file to eip# * fix discussions-to url error from Travis * Update EIPS/eip-3300.md Co-authored-by: Micah Zoltu <[email protected]> * Update EIPS/eip-3300.md Co-authored-by: Micah Zoltu <[email protected]> * Update EIPS/eip-3300.md Co-authored-by: Micah Zoltu <[email protected]> * Update EIPS/eip-3300.md Co-authored-by: Micah Zoltu <[email protected]> * Update EIPS/eip-3300.md Co-authored-by: Micah Zoltu <[email protected]> * Update EIPS/eip-3300.md Co-authored-by: Micah Zoltu <[email protected]> * Update EIPS/eip-3300.md Co-authored-by: Micah Zoltu <[email protected]> * Update EIPS/eip-3300.md Co-authored-by: Micah Zoltu <[email protected]> * initial clarification * specify 1283 behavior * specify negative refund removal * start specifying activation costs and then simplify by disregarding them * cleanup activation cost specifications Co-authored-by: Micah Zoltu <[email protected]>
Phase out refunds for
SSTOREandSELFDESTRUCTReviewer @lightclient