-
Notifications
You must be signed in to change notification settings - Fork 135
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
<address>.call{value: value}(new bytes(0)) causes ERROR call may fail or behave unexpectedly due to empty code #793
Comments
Also I suspect that this is making somehow my tests running extremely slow (30 minutes on github actions, instead of like 5 mins), not sure if there's some retry mechanism under the hood, or it's just the fuzzing, but I have 100s of lines of the same error being reported (and ignored, execution continues). |
Hey @vmaark can you share an example of a test that is printing the error? A simple .call{value: value}("") is not printing it out for me.
From what I've seen it depends on how and where you do the deployment of the contract you are then calling. |
in this example you're sending to a contract which works fine. It happens when sending eth to an EOA using .call - sorry if that wasn't clear from the original description. Also additionally this ERROR / warning is making the test run extremely slow. |
Hey @vmaark we just merged a fix for this exact case. It should spare you from the error you were getting. Thanks for raising it. |
hey @Jrigada, thanks for the quick fix, sounds great! Updated zksync-forge, I assume it is not yet included in the following version:
|
Yes, is not present yet in the release. To use it right now you would have to build directly from main. Probably by today or early next week it will be on the new release! |
Component
Forge
Have you ensured that all of these are up to date?
What version of Foundry are you on?
forge 0.0.2 (68fcb7d 2024-12-16T00:45:46.210537000Z)
What command(s) is the bug in?
forge test
Operating System
macOS (Apple Silicon)
Describe the bug
Sending eth with .call causes the following log in my forge test output:
2024-12-18T22:55:36.093440Z ERROR foundry_zksync_core::vm::tracers::cheatcode: call may fail or behave unexpectedly due to empty code target=0x0000000000000000000000000000000000989682 calldata=""
Although it displays it as an
ERROR
, the execution continues. Due to having a lot of tests and fuzzing, this really pollutes my console.Proposed solution:
When calldata is empty, due not assume it's a function call, don't check the address for code.
The text was updated successfully, but these errors were encountered: