-
Notifications
You must be signed in to change notification settings - Fork 11.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
Use invalid opcode to consume all gas in MinimalForwarder #3035
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
@Amxx hey, I'm trying to understand the issue solved here. Could you explain why burning all gas is important and what it prevents from happening? |
@frangio the mentioned fix is only helpful for Forwarder calling another Forwarder. Though it still doesn't guarantee that the target contract gets specified amount of gas. |
Can you elaborate? |
Sure. Consider the target contract
User creates a meta tx request with req.gas = 1000000. Relayer picks it up and sends it with 500000 gas. |
Its a bit subtle, but here is what happens:
You contract check if there is a given amount of gas, but if that is not the case, it doesn't not trigger an out of gas exception. IMO, contract should not check gas that way.
|
Fixes #2864
PR Checklist