-
Notifications
You must be signed in to change notification settings - Fork 368
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
Incorrect logs emitted when downcasting to bytes2
or bytes1
#860
Comments
Hi, thanks a lot for this detailed report. I believe this issue is caused by some hevm code, since Echidna will only print the events that receives from it. Can you try to reproduce the issue inside hevm so we can create a issue in their repository? Thanks! |
Thanks!
Yes, sure! I can do that. UPDATE 1
A repository with this example is available on my GitHub. Shall I create an issue in their repository? Thanks again! |
Hi, please go ahead and create an issue in the dapptool repository. Keep in mind that hevm is migrating to the EF repository here so if the issue is fixed already there, there is little chance they will backport the patch. Echidna will use the new HEVM as soon as they release a stable version, but in the meantime, we are using dapptool code. Thanks in advance! |
Good to know that! Issue submitted. |
Awesome work! Please let us know if something else fail. |
Thank you!
Sure thing 😎 |
@ChmielewskiKamil I'm wondering what is the status of this? |
@ggrieco-tob tldr; You can check out the whole conversation in the HEVM repo of the Ethereum Foundation. The question now is whether this is a bug or a feature. For an unaware user, I would say that this is a bug. I guess the HEVM team is waiting for our response on how to solve this issue. |
Update December 19, 2022, Once this HEVM PR (#134) by @d-xo is merged, the issue can be closed. Opportunistic decoding of fixed-size Update December 20, 2022, The above PR has been merged. Once Echidna moves to the new stable release of the HEVM, this issue will be solved*. *There is also a chance that the fix from the EF repo will also be added to the old Daptools repo. This would resolve the issue sooner. |
This is solved in |
What is the problem?
Logs emitted by Echidna are incorrect. When downcasting from
bytes32
tobytes2
orbytes1
, Echidna prints an incorrect value.I've created a simple contract to illustrate the issue (you can clone the repository from my GitHub):
This is the output from running Echidna on the contract above:
If you look closely at the last two logs (
HashCastedToBytes2
andHashCastedToBytes1
), Echidna prints values:«fb»
and«f»
, respectively.Every other log is acceptable.
Is this expected behaviour? Am I missing something?
This is the output from running a similar test in Foundry:
As you can see, the output for
bytes2
andbytes1
is printed correctly.Steps to reproduce the issue:
git clone https://github.com/ChmielewskiKamil/echidna-weird-behaviour.git
cd echidna-weird-behaviour
forge install
echidna-test src/WeirdLogs.sol --contract WeirdLogs --config echidna_config.yaml
forge test -vvv
Expected behaviour
Echidna emits the following logs:
Actual behaviour
The text was updated successfully, but these errors were encountered: