-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Test aleth-interpreter with evm-test #5653
Comments
@gumb0 if you have some free time, can you take a look on this? |
I'm investigating
|
@chfast evmone though fails early with OOG because it expects memory requirements not to exceed 4 Gb - 1 https://github.com/ethereum/evmone/blob/f25d9c7a05d5a88bd17bd5db9402bb3568c61ddc/lib/evmone/instructions.cpp#L24. In the end I think interpreter for me throws |
I know there's proposal https://eips.ethereum.org/EIPS/eip-1985 So probably we should introduce the same |
Ok, thanks very much for checking. These were evmone unit tests so they were testing evmone implementation limits. I think it would be good to modify the test by limiting the gas limit to something that will not allow allocating 4GB of memory. Maybe also add 2G offset + 2G size case. About EIP-1985, we actually discussed that yesterday whenever this should also set a limit for memory size. It do not do it at the moment. We should move this discussion to https://ethereum-magicians.org/t/eip-1985-sane-limits-for-certain-evm-parameters/3224. |
With lower gas limit interpreter still fails Does it make sense to change the order of checks in interpreter here - first check gas for memory, then check return data size? Then it will return OOG first aleth/libaleth-interpreter/VM.cpp Lines 1016 to 1022 in 089e7dd
It seems that not enough return data is more important, so maybe this could be changed in evmone? |
|
Another failure is
Here the problem is with newer opcodes (bit shifts) not defined yet in old revisions, interpreter checks the stack requirements first, before figuring out that it's not defined for the given revision aleth/libaleth-interpreter/VM.cpp Line 244 in 089e7dd
Stack is empty in test, so it fails with EVMC_STACK_UNDERFLOW instead of EVMC_UNDEFINED_INSTRUCTION
|
The order of check is not specified and I expected such issues. In general we will have to modify tests to allow different errors. But in this case evmone can be changed. |
Here you can add some stack items before the instruction in code. Please check the |
I've changed |
I checked evmone's implementation. It is easier to check memory first (OOG) because then we know that the "size" is not insane value and returndata buffer checking is easier. I will modify the test accordingly. |
The test already expects |
No change needed. |
For instructions These are special codes used by optimizer ( |
All green now! |
In ethereum/evmone#85 there is the
evm-test
tool that can test the aleth-interpreter DLL.I have run it already and noticed some failures.
One is fixed by #5651.
Many of failures are due to a fact the unit test checks are more restrictive than EVMC requires. E.g. EVMC do not require to return specific error code, it is acceptable to return generic
EVMC_FAILURE
instead of specific errors.To make such unit test more generic I propose to
I also noticed some tests run a long time and fail.
The text was updated successfully, but these errors were encountered: