-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Fix testeth VMTest false account creations and deletions #4731
base: master
Are you sure you want to change the base?
Fix testeth VMTest false account creations and deletions #4731
Conversation
do we really need a VM test suite by now? |
This is a good discussion point. The The case for VMTests: The EVM is the most complex part of the Ethereum protocol (not considering the networking portion). Its behavior is also the focus of most of the changes that occur between milestones. A set of tests isolating the EVM functionality from transaction semantics may make sense. While this would impose clients to have a separate EVM module for these tests, this is already the case in reality. Migrating these tests to the The case against VMTests: The EVM is only invoked when transactions are processed and the current Proposal: Based on weighing the pros and cons of each situation, I agree with your line of thinking to migrate the Let me know what you think. I am more than happy to help with this porting effort if we agree it's the right thing to do. |
@winsvega I'm still using VM tests. |
How do we want to proceed? |
looks like we keep VMTests for now. so if @pirapira approves this PR should be merged. |
I took this week off. Coming back here next week. |
@matthalp will you modify the test cases in |
I am happy to give it a shot. |
@matthalp thank you. I'm ready to answer any questions. |
How is this going? |
@matthalp meanwhile I removed these problematic instructions from VM tests. Do you still see the problem in |
It seems like the
VMTest
filler currently creates and deletes accounts in situations that deviate from the Ethereum specification:BALANCE
operation should not be able to create accounts. If the account whose balance is being looked up does not exist, the operation should simply push0
onto the stack and not modify world state.EXTCODECOPY
operation has a similar issue asBALANCE
in the sense that a default value should be returned when the account subject to the lookup does not exist.EXTCODESIZE
operation has a similar issue asBALANCE
andEXTCODECOPY
in the sense that a default value should be returned when the account subject to the lookup does not exist.SELFDESTRUCT
(formerlySUICIDE
) operation should not be able to delete accounts. It should only mark the corresponding account for deletion (by adding it to the self-destruct set held within the transaction substate).At the crux of the account creation issue in
BALANCE
,EXTCODECOPY
, andEXTCODESIZE
is that thestd::map
that holds the address-to-account mapping is not checked to see whether or not the address exists before performing the lookup. As a result, perstd::map
'soperation[]
semantics the entry is default constructed for these non-existent addresses -- adding them to the world state.