Skip to content
This repository was archived by the owner on Oct 28, 2021. It is now read-only.

Reset code to empty in rollback#5641

Merged
gumb0 merged 3 commits intomasterfrom
rollback-empty-code
Jun 27, 2019
Merged

Reset code to empty in rollback#5641
gumb0 merged 3 commits intomasterfrom
rollback-empty-code

Conversation

@gumb0
Copy link
Copy Markdown
Member

@gumb0 gumb0 commented Jun 26, 2019

I think we don't need to save the old code for rollback anymore, because overwriting the code is not allowed according to address collision rules (ethereum/EIPs#684 and https://eips.ethereum.org/EIPS/eip-689) and we never get to rolling back the overwritten code.

A bit of history of this code:
It was written as a fix of incorrect rollback of code overwrite in case of address collision (back then it was possible to overwrite the code)
#4130
#4151

Then in preparation for Byzantium new collision rules were introduced, which applied retroactively to all previous forks, too.
#4384

To quote EIP-689:

Regarding testing, this EIP relieves clients from supporting reversion of code overwriting.

This will simplify a little bit the implementation of EIP-1702 Generalized Account Versioning Scheme, because if we don't need to save the old code in journal, then we don't need to save the version either.

@codecov-io
Copy link
Copy Markdown

codecov-io commented Jun 26, 2019

Codecov Report

Merging #5641 into master will increase coverage by 0.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #5641      +/-   ##
==========================================
+ Coverage   62.74%   62.76%   +0.01%     
==========================================
  Files         348      348              
  Lines       29670    29682      +12     
  Branches     3343     3343              
==========================================
+ Hits        18617    18629      +12     
- Misses       9841     9842       +1     
+ Partials     1212     1211       -1

@gumb0 gumb0 force-pushed the rollback-empty-code branch from 4a9ff0f to 0b36dc1 Compare June 26, 2019 16:53
…code.

Because it's not allowed to overwrite code now.
@gumb0 gumb0 force-pushed the rollback-empty-code branch from 0b36dc1 to 2af454b Compare June 26, 2019 17:26
@gumb0 gumb0 force-pushed the rollback-empty-code branch from d5c1e1a to 6c55857 Compare June 27, 2019 10:19
@gumb0 gumb0 removed the in progress label Jun 27, 2019
@gumb0 gumb0 requested review from chfast and halfalicious June 27, 2019 11:50
@chfast
Copy link
Copy Markdown
Member

chfast commented Jun 27, 2019

Why is the EIP-689 still a draft?

@gumb0
Copy link
Copy Markdown
Member Author

gumb0 commented Jun 27, 2019

@chfast Probably no one cared to accept it yet. There was some discussion recently on All Core Devs call, where @holiman mentioned that it's already implemented, see discussion of "Action 60.6" in https://github.com/ethereum/pm/blob/master/All%20Core%20Devs%20Meetings/Meeting%2061.md

@gumb0 gumb0 merged commit be6ce38 into master Jun 27, 2019
@gumb0 gumb0 deleted the rollback-empty-code branch June 27, 2019 12:57
@halfalicious
Copy link
Copy Markdown
Contributor

@gumb0 : When would we need to rollback to old code before EIP-689? When there's a chain reorg?

@gumb0
Copy link
Copy Markdown
Member Author

gumb0 commented Jul 9, 2019

@halfalicious No, rollback happens any time after exception during transaction execution (for example Out-of-gas or invalid instruction)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants