-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Document InstructionResult
#7463
Comments
It fails on the PUSH0 opcode with
Will open a PR to always display the call result in traces because I've encountered this before |
Where would we see why we are getting |
It means the opcode is not supported in the current EVM version |
ahhhhhhhhhhhhhhh. I see! I forgot to add I think we may start seeing stuff like this more... Maybe we can flesh out that error some more? Instead of And/or maybe a line in the foundry docs to say what |
I've added this here for web crawler to pick up for others who may run into this issue. |
InstructionResult
Hi @zerosnacks, I'd like to work on this one 👍 The "Understanding Traces" section in the Foundry book's "Forge Overview" would be an appropriate place to include information about trace interpretation. I think this section could be expanded to provide more detailed explanations of trace outputs and their meanings. Regarding the approach to explaining the
I prefer the dynamic approach, but it requires several steps:
What do you think? |
Hi @leovct thanks! I think dynamic documentation generation is beyond the scope of this specific ticket. It is sufficient to document only the non-obvious ones that users face regularly (such as the If you see any improvements in terms of clarifying specific instructions that can be upstreamed to REVM I'm sure they will be appreciative of it as well. |
The PR has been merged into the foundry book, I think we can close the problem now :) |
Component
Forge
Have you ensured that all of these are up to date?
What version of Foundry are you on?
forge 0.2.0 (1a4960d 2024-03-20T00:28:07.727577000Z)
What command(s) is the bug in?
forge test
Operating System
macOS (Intel)
Describe the bug
I hate that I'm doing this, because the reproducibility is... weird. Here is my test contract, you can copy paste the code directly into a blank foundry template created from
forge init
.Running the following command gets an expected fail:
However why it fails is a mystery to me, it seems foundry just "cuts out" the call. Here is an image of calling the bytecode deployed contract using the debug flag:
This line:
(bool success,) = addr.call(data);
so inside theaddr
contract.We see the call ends with a
PUSH0
opcode. However, looking at the deployed bytecode, there should at LEAST be anotherSLOAD
opcode after the call. theRETURN
opcode from the contract deployment code isf3
so we can remove60a88060093d393df3
from the bytecode, and we are left with the runtime code. The first few opcodes there are at least:So why is the call showing kicking the bucket after
PUSH0
?What I've tried
According to the EVM, there are a few reasons why a
CALL
opcode will fail:I tried running with
{gas: 100}
on the call, and saw no difference, but running with{gas: 6}
seemed to correctly limit the opcodes to just:So adding more gas probably isn't the issue, since removing gas works fine.
2. Not enough values on the stack.
: This doesn't make sense since we are in a new call contextAnd
3
doesn't make sense since we are not in a staticcall.So I'm not sure what's going on.
The text was updated successfully, but these errors were encountered: