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

CREATE2 implementation in LegacyVM #5121

Merged
merged 6 commits into from
Jul 23, 2018
Merged

CREATE2 implementation in LegacyVM #5121

merged 6 commits into from
Jul 23, 2018

Conversation

gumb0
Copy link
Member

@gumb0 gumb0 commented Jul 17, 2018

@codecov-io
Copy link

codecov-io commented Jul 17, 2018

Codecov Report

Merging #5121 into develop will increase coverage by 0.08%.
The diff coverage is 93.62%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #5121      +/-   ##
===========================================
+ Coverage    58.39%   58.47%   +0.08%     
===========================================
  Files          336      337       +1     
  Lines        26973    27017      +44     
  Branches      3161     3162       +1     
===========================================
+ Hits         15750    15798      +48     
+ Misses       10154    10152       -2     
+ Partials      1069     1067       -2

@gumb0
Copy link
Member Author

gumb0 commented Jul 18, 2018

Somehow the test succeeds on Windows but generates BadInstruction elsewhere 😕

@gumb0
Copy link
Member Author

gumb0 commented Jul 23, 2018

Oh wow, switch statement in VM is implemented with some gcc extention magic on *nixes, I didn't notice it

@gumb0 gumb0 force-pushed the create2-legacyvm branch from 9b09e48 to 4229006 Compare July 23, 2018 10:37
@gumb0
Copy link
Member Author

gumb0 commented Jul 23, 2018

Still some details are not finalized:

Ortherwise this can be merged I guess.

@gumb0 gumb0 added this to the Constantinople milestone Jul 23, 2018
@gumb0 gumb0 removed the in progress label Jul 23, 2018
@gumb0 gumb0 requested a review from chfast July 23, 2018 14:18
@gumb0 gumb0 merged commit 4ae74c6 into develop Jul 23, 2018
@gumb0 gumb0 deleted the create2-legacyvm branch July 23, 2018 16:06
@@ -365,7 +365,7 @@ bool Executive::createOpcode(Address const& _sender, u256 const& _endowment, u25

bool Executive::create2Opcode(Address const& _sender, u256 const& _endowment, u256 const& _gasPrice, u256 const& _gas, bytesConstRef _init, Address const& _origin, u256 const& _salt)
{
m_newAddress = right160(sha3(_sender.asBytes() + toBigEndian(_salt) + sha3(_init).asBytes()));
m_newAddress = right160(sha3(_sender.asBytes() + toBigEndian(_salt) + _init));
Copy link
Member

Choose a reason for hiding this comment

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

I think the consensus is going towards adding the 0xff prefix. The benefit is that old addresses can't clash with new ones, which is a win because it prevents a class of corner cases that might appear in old create code.

Copy link
Member

Choose a reason for hiding this comment

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

I hope we will make the final decision in the next Add Dev Call. Unless there is a way to make it sooner.

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