-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
fix(verify-bytecode): use local creation code for fork deployment #8402
Conversation
revm adds additional zeroes to the end of bytecode during analysis I believe. you should use foundry/crates/verify/src/bytecode.rs Line 355 in 1e0603f
https://docs.rs/revm/11.0.0/revm/precompile/primitives/enum.Bytecode.html#method.original_bytes |
Found the bug related to verifying We were using the onchain creation code (instead of the locally built creation code) to deploy the contract on the fork and get the runtime code. |
@yash-atreya Nice find! Let me know whenever this is merged 🙏 |
@mattsse this can be merged |
Motivation
Fixes #8255
Printing wrong
verification_type
in json result.Solution
WIP
Print the correct verification_type from the result.
This is only a partial fix though, since the runtime doesn't even match partially with the onchain runtime code. Though it was supposed to in the case of #8255 (comment).
Upon investigating, I observed that; the runtime code that we generate locally by forking has trailing zeros and the onchain runtime code doesn't
Onchain runtime code:
Local runtime code, we cross-check with the onchain code:
Removing the trailing zeros would match the codes exactly.
@mattsse @klkvr any input here as to why this happens? Need some insight on how to fix this, or maybe it's just an edge case of the compiler?