-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Conversation
yann300
commented
Apr 19, 2017
- Set the address of any contract created through a creation transaction to equal sha3(NULL_SENDER + sha3(init code)) % 2**160, where + represents concatenation, replacing the earlier address formula of sha3(rlp.encode([sender, nonce]))
- Create a new opcode at 0xfb, CREATE_P2SH, which sets the creation address to sha3(sender + sha3(init code)) % 2**160. If a contract at that address already exists, fails and returns 0 as if the init code had run out of gas.
On Travis CI limit cache to 1 GB and cleanup after the build. Print better CMake logs and stats.
move transaction verification checks to sealEngine
libethereum/Executive.cpp
Outdated
@@ -391,6 +400,8 @@ bool Executive::go(OnOpFunc const& _onOp) | |||
auto vm = _onOp ? VMFactory::create(VMKind::Interpreter) : VMFactory::create(); | |||
if (m_isCreation) | |||
{ | |||
if (m_s.addressHasCode(m_newAddress)) |
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 think this happens only after Metropolis (although I doubt I can trigger this right now).
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 remember there is a test case about this...
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.
That stuff will basically never return true before Metropolis. but yeah that worth testing only after metro
I'will start working on the tests tomorrow. |
test/tools/jsontests/vm.cpp
Outdated
|
||
h160 MetropolisFakeExtVM::create(u256 _endowment, u256& io_gas, bytesConstRef _init, OnOpFunc const&, Instruction _creationType) | ||
{ | ||
(void)_creationType; |
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.
Do you need this line?
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.
if not it will not build (not used parameter are treated as error)
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 parameter is used below.
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.
well wait... you're right :) don't need this line
Looks OK except the Travis failure. |
libevm/VM.cpp
Outdated
|
||
CASE(CREATE_PSH) | ||
{ | ||
m_bounce = &VM::caseCreate; |
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.
It should be available only after Metropolis and generate BadInstruction before. See for example how REVERT handles this
remove blockHash tests from stateTests
Also the changes are needed in libevmcore/Instruction.cpp - add new instuction to See my changes for REVERT https://github.com/ethereum/cpp-ethereum/pull/3635/files#diff-eebc659bb21aa390ba67700a3586fb13 |
test/tools/jsontests/vm.h
Outdated
@@ -80,5 +80,12 @@ class FakeExtVM: public eth::ExtVMFace | |||
u256 execGas; | |||
}; | |||
|
|||
class MetropolisFakeExtVM: public FakeExtVM |
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 class looks not used
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.
yep we will try to remove the entire fakeExtVM with @winsvega
libevm/ExtVMFace.h
Outdated
@@ -298,7 +298,7 @@ class ExtVMFace | |||
virtual void suicide(Address) { sub.suicides.insert(myAddress); } | |||
|
|||
/// Create a new (contract) account. | |||
virtual h160 create(u256, u256&, bytesConstRef, OnOpFunc const&) { return h160(); } | |||
virtual h160 create(u256, u256&, bytesConstRef, OnOpFunc const&, Instruction) { return h160(); } |
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 would better make OnOpFunc
parameter the last one, because it's kind of different than all the others - all others are configuring the creation and this one is a callback
Improve ccache usage
…eip86_create Conflicts: libethereum/Executive.cpp libevm/VM.cpp libevmcore/Instruction.cpp libevmcore/Instruction.h test/tools/jsontests/vm.cpp
will move to #4051 |