-
Notifications
You must be signed in to change notification settings - Fork 20.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
evm command line interface adds leading zeros in odd-length input #24711
Comments
The stack currently seems to print decimals, not entire word slots. e.g.
^ this was also in your trace that does the same thing as the truncation you didn't like. I think this is deliberate to easier interpret numbers, but maybe I'm wrong? CC @holiman |
Weird that it accepts odd-length input ( |
The problem is that |
That is correct. It seems that the problem is with odd length input specifically. I initially expected the call message to be filled bitwise from left to right, but that is not exactly what happens. Here is another minimal example, both of these commands give be the same result:
In both case, what is pushed in the stack is So the leading is zero is not dropped in the second case. It is in fact that a leading zero is added in the first one. |
@jwasinger was this fixed by #24721? can I close? |
I am executing the following dummy (smart) contract with
evm
command line.If I provide
0x101
as input I get the expected result (EDIT: see comments below, it turns out this is not the expected result):Although, if I input
0x001
, the heading zeros seem to be dropped by theevm
(see stack state on last line).I am using
evm version 1.10.17-stable-25c9b49f
on Linux (Pop!_OS). Why does theevm
drops the leading zeros? It seems like a bug to me.The text was updated successfully, but these errors were encountered: